AequilibraE / qaequilibrae

Free QGIS add-on for transportation modeling
https://www.aequilibrae.com/qgis/latest/
Other
75 stars 24 forks source link

Unable to compute graph #246

Closed Art-Ev closed 11 months ago

Art-Ev commented 1 year ago

While doing a bit of translation work I came across a bug: it was impossible to create the graph (either via the shortest path menu or when adding a traffic class in the assignment menu).

ValueError: invalid literal for int() with base 10: '2A099' 
Traceback (most recent call last):
  File "C:\Users/a.evrard/AppData/Roaming/QGIS/QGIS3\profiles\1_Classique/python/plugins\qaequilibrae\modules\paths_procedures\traffic_assignment_dialog.py", line 258, in _create_traffic_class
    self.project.network.build_graphs(modes=[mode_id])
  File "C:\Users/a.evrard/AppData/Roaming/QGIS/QGIS3\profiles\1_Classique/python/plugins\qaequilibrae\packages\aequilibrae\project\network\network.py", line 339, in build_graphs
    centroids = np.array([i[0] for i in curr.fetchall()], np.uint32)
ValueError: invalid literal for int() with base 10: '2A099'

QGIS 3.28 qAequilibraE 0.9.3

I've looked for unusual values in nodes or links IDs but cannot find the solution. AequilbraE project was working fine with 0.9.2 : https://egis-group.fromsmash.com/aequilibrae-TestProject

pedrocamargo commented 11 months ago

I am not sure how that worked with a previous version of AequilibraE (It should not have). There are two nodes on this model that have non-numeric IDs and are tagged as centroids.

image

Art-Ev commented 11 months ago

Thanks ! And I don't get how it can even be saved in an integer only field...

pedrocamargo commented 11 months ago

SQLite is not super strict about types. I think the solution could be to add triggers or include a check in the table creation

pedrocamargo commented 11 months ago

@Art-Ev , I went ahead and made sure that this specific error can't happen in the future. https://github.com/AequilibraE/aequilibrae/pull/455