teksi / wastewater

[DEV] Future TEKSI wastewater module, adapted data model to fit VSA-DSS 2020 new standard
https://teksi.github.io/wastewater
GNU General Public License v3.0
2 stars 5 forks source link

2024-10-30-fix-loosing-coordinates-interlis-import #484

Closed sjib closed 3 weeks ago

sjib commented 3 weeks ago

Add function geometry3D_convert

sjib commented 3 weeks ago

Should solve https://github.com/teksi/wastewater/issues/475

sjib commented 3 weeks ago

Conversion with 'Nan' not yet as expected - result is None

2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a008080000000000008930444100000000a96331410000000000d49d40.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a008080000000000009d30444100000000ae6331410000000000da9d40.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a008080000000000009330444100000000a96331410000000000d49d40.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a008080000000000808130444100000000a96331410000000000d49d40.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a008080000000000007030444100000000956331410000000000d09d40.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a00808000000000000e03344410000000068723141cdcccccccc32a140.
2024-10-30T20:47:07        teksi_wastewater.utils: debug: controling situation3d_geometry : 01010000a0080800005eba49ccde334441d122dbf981723141000000000034a140.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01325A- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01325E- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01326A- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01326E- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01327A- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01327E- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01328A- situation3d_geometry z-value set to "Nan" instead: None.
2024-10-30T20:47:07        teksi_wastewater.utils:No reach_point.cote (Haltungpunkt.Kote) provided for object ch080qwzHP01328E- situation3d_geometry z-value set to "Nan" instead: None.
sjib commented 3 weeks ago

error: cannot format plugin/teksi_wastewater/interlis/interlis_model_mapping/interlis_importer_to_intermediate_schema.py: Cannot parse: 434:91: geom = self.session_tww.scalar(ST_Force3D(coteattribute, COALESCE (NULL,'NaN'))::numeric)

sjib commented 3 weeks ago

@ponceta Any idea how to adapt that?

error: cannot format plugin/teksi_wastewater/interlis/interlis_model_mapping/interlis_importer_to_intermediate_schema.py: Cannot parse: 434:91: geom = self.session_tww.scalar(ST_Force3D(coteattribute, COALESCE (NULL,'NaN'))::numeric)

sjib commented 3 weeks ago

Do we need also treat the case when there is a level but no geometry? What should we do then?

sjib commented 3 weeks ago

Now also for cover:

grafik

and wastewater_node: grafik

sjib commented 3 weeks ago

This now also improves network following:

Downstream works from the beginning grafik

ponceta commented 3 weeks ago

Do we need also treat the case when there is a level but no geometry? What should we do then?

ST_FORCE3D(None) = None

So technically it is already supported, but we should encourage the user to fix geometries otherwise he will face issues when using TWW (network, ...).

ponceta commented 3 weeks ago

Thank you @sjib for providing this!

sjib commented 3 weeks ago

grafik

sjib commented 3 weeks ago

Logger Messages for all 4 cases, example cover:

2024-10-31T11:31:44        teksi_wastewater.utils: debug: situation3d_geometry created with geometry (x,y) and level (z): 01010000a008080000000000008827444100000000b2a031410000000000fcaa40.
2024-10-31T11:31:44        teksi_wastewater.utils:No cover.level (Deckel.Deckelkote) and geometry (Lage) provided for object ch080qwzDE001408 - situation3d_geometry cannot be defined! Object cannot be displayed in TEKSI TWW!
2024-10-31T11:31:44        teksi_wastewater.utils:No cover.level (Deckel.Deckelkote) and geometry (Lage) provided for object ch080qwzDE001409 - situation3d_geometry cannot be defined! Object cannot be displayed in TEKSI TWW!
2024-10-31T11:31:44        teksi_wastewater.utils:No cover.level (Deckel.Deckelkote) provided for object ch080qwzDE001410- situation3d_geometry with no z-value created: 01010000a008080000000000408827444100000080b2a031410000000000000000.
2024-10-31T11:31:44        teksi_wastewater.utils:cover.level (Deckel.Deckelkote) provided but no geometry (Lage) provided for object ch080qwzDE001411 - situation3d_geometry cannot be defined! Object cannot be displayed in TEKSI TWW!
2024-10-31T11:31:44        teksi_wastewater.utils: debug: situation3d_geometry created with geometry (x,y) and level (z): 01010000a008080000000000009227444100000000fca131416666666666fcaa40.
2024-10-31T11:31:44        teksi_wastewater.utils: debug: situation3d_geometry created with geometry (x,y) and level (z): 01010000a0080800007d3f35fe40294441e17a142edf9d31413333333333d8a840.
2024-10-31T11:31:44        teksi_wastewater.utils: debug: situation3d_geometry created with geometry (x,y) and level (z): 01010000a008080000000000804d2a444100000000bb9f31410000000000b4aa40.
sjib commented 3 weeks ago

When I import cases with no coordinates I get this network following error again: https://github.com/teksi/wastewater/issues/476

sjib commented 3 weeks ago

When I import cases with no coordinates I get this network following error again: #476

So we have to finish this also: https://github.com/teksi/wastewater/pull/457

sjib commented 3 weeks ago

Danke @tomep for this testing:

Ich habe die angepassten Files ausgetauscht und 2 Erfolgreiche Imports machen können 😊

Das funktioniert also, da freue ich mich aber. Super Sache.

Ich sehe nun auch wieder alle SAA-Objekte und die Netzverfolgung kann ausgeführt werden.

ponceta commented 3 weeks ago

@sjib are we ready to integrate this? Please undraft and merge if ready!

sjib commented 3 weeks ago

Should I change some of the messages to logger.debug?

sjib commented 3 weeks ago

I leave as is - logger levels seem reasonable to me.