nens / threedi-schematisation-editor

QGIS tool for editing schematisations
0 stars 0 forks source link

Missing connection node breaks import to geopackage #75

Closed leendertvanwolfswinkel closed 1 year ago

leendertvanwolfswinkel commented 2 years ago

If the spatialite contains a v2_surface_map or v2_impervious_surface_map with a connection_node_id that does not exist in v2_connection_nodes, an error is raised and the whole import process is broken.

Please change this to:

Example data can be found here: https://app.zenhub.com/files/481141268/de49e8f0-3fed-4cef-ab93-6498493b163d/download

leendertvanwolfswinkel commented 2 years ago

Error is:


KeyError: 1303895 
Traceback (most recent call last):
  File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\threedi_schematisation_editor\__init__.py", line 175, in load_from_spatialite
    converter.import_all_model_data()
  File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\threedi_schematisation_editor\conversion.py", line 490, in import_all_model_data
    self.add_surface_map_geometries()
  File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\threedi_schematisation_editor\conversion.py", line 296, in add_surface_map_geometries
    connection_node_geom = connection_node_points[node_id]
KeyError: 1303895
leendertvanwolfswinkel commented 1 year ago

Perfect