Closed Patrick-Nijman closed 1 year ago
Patrick: Not important to Lukasz, basically a description why Casper can't solve this in the model checker. I thought this needed fixing in the modelchecker. But it's the conversion from GPckg to Sqlite
Ik heb het lijstje afgelopen en ik begrijp eigenlijk alle punten niet. Ik vermoed dat dit over records in de v2_cross_section_definition
table met een tabulated shape gaat (dus: shape = 5 of 6).
-empty cross section table (NULL)
Er is al een check op NULL waardes in de width kolom (error code 81) of height kolom (error code 82)
-cross section tables with extra blank line
Wat bedoel je precies? een newline aan het einde van width of height veld is valid input en geeft geen errors in gridbuilder.
-cross section table with space after comma
Er zitten geen komma's in de input
-cross section table with a . in stead of , between with and height
Width en height zitten in aparte velden; daar zit geen . of , tussen.
Discussed with @Patrick-Nijman -- issue is in the plugin (conversion gpkg -> sqlite)
Changes available on branch: https://github.com/nens/threedi-schematisation-editor/tree/cross_section_table_validators
I tested it. Test results:
Saving to Spatialite failed. The following features have cross sections with incorrect table inputs
. Please auto-fix this kind of input (just remove all spaces and blank lines before trying to parse the input?).0,2.5\n1.5,2.5\n1.5,0
, save to spatialite fails. Please make sure input (without spaces) and 0, 2.5\n1.5, 2.5\n1.5, 0
(with spaces) are accepted and correctly parsed. 0, 2,5\n1,5, 2,5\n1,5, 0
(comma's as decimal separators) does not have to be acceptedv2_cross_section_definition.width
and v2_cross_section_definition.height
fieldsValueError: not enough values to unpack (expected 2, got 1)
Traceback (most recent call last):
File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\Release candidates June 2022/python/plugins\threedi_schematisation_editor\__init__.py", line 195, in save_to_default
self.save_to_spatialite(pick_destination=False)
File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\Release candidates June 2022/python/plugins\threedi_schematisation_editor\__init__.py", line 243, in save_to_spatialite
converter.export_all_model_data()
File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\Release candidates June 2022/python/plugins\threedi_schematisation_editor\conversion.py", line 706, in export_all_model_data
self.export_cross_section_definition_data()
File "C:\Users/leendert.vanwolfswin/AppData/Roaming/QGIS/QGIS3\profiles\Release candidates June 2022/python/plugins\threedi_schematisation_editor\conversion.py", line 611, in export_cross_section_definition_data
height_values, width_values = list(zip(*parsed_table))
ValueError: not enough values to unpack (expected 2, got 1)
Tested again, all previously mentioned issues have been solved now, except for the last two:
@leendertvanwolfswinkel Those 2 issues should be solved now.
@ldebek Both issues are solved, but now I get several "Do you want to save changes to the layer Manhole" popups again (I think four times, between data validation and saving to spatialite.
This also happens if I toggle editing on for the Pipe layer and then off again, even when I haven't edited anything.
More info to reproduce the issue:
@leendertvanwolfswinkel Issue reported in comment above is not related with validation. It seems that there is an issue with handling NULL values in the custom forms comboboxes. Best to move it to the separate ticket.
If the geopackage
cross_section_table
input cannot be correctly parsed to width / height series in the spatialite, data can be lost. Some examples:NULL
)Suggested solution:
"Saving to Spatialite failed. The following features have cross sections with incorrect table inputs: Cross section location {ids} Culvert {ids} Orifice {ids} Pipe {ids} Weir {ids}"