3dcitydb / citydb-tool

3D City Database 5.0 CLI to import/export city model data and to run database operations
Apache License 2.0
11 stars 2 forks source link

Missing feature envelopes and geometries after importing CityGML 3.0 data #29

Closed bsttsai closed 5 months ago

bsttsai commented 5 months ago

Hi, I'd like to inquire about an issue encountered when importing CityGML 3.0 test datasets into PostgreSQL.

I imported the TUM_citygml_V3.gml file using citydb-tool v. 0.7.1-beta, and no errors were seen in the log file. However, upon checking the feature and geometry_data tables, I found that the features' envelopes and geometries were missing—they were both empty.

To troubleshoot, I also tried importing the FZK Haus CityGML 3.0 test dataset from this link. In this case, the feature envelopes and geometries were imported correctly.

excerpt of FZK gml file: image

I appreciate any insights or suggestions on resolving this issue in advance. Thank you.

clausnagel commented 5 months ago

The TUM dataset violates the CityGML conceptual model. That's why it's not fully imported by citydb-tool.

The issue is not the geometry. gml:Surface, gml:patches, and gml:PolygonPatch are all supported by citydb-tool.

The problem is caused by the core:boundary elements which link tran:TrafficArea and tran:AuxiliaryTrafficArea boundaries to tran:Section spaces. According to the CityGML 3.0 conceptual model standard, both boundary types are not allowed for sections (see here).

You can manually fix the dataset by replacing

<tran:Section>
  <core:boundary>
    <tran:TrafficArea>
      ...
    </tran:TrafficArea>
  </core:boundary>
</tran:Section>

with

<tran:Section>
  <tran:trafficSpace>
    <tran:TrafficSpace>
      <core:boundary>
        <tran:TrafficArea>
          ...
        </tran:TrafficArea>
      </core:boundary>
    </tran:TrafficSpace>
  </tran:trafficSpace>
</tran:Section>

Be careful to use tran:auxiliaryTrafficSpace and tran:AuxiliaryTrafficSpace instead to enclose the tran:AuxiliaryTrafficArea boundaries in the dataset.

ChBeil commented 5 months ago

Thanks for pointing this out. We fixed the issue and updated the dataset.

clausnagel commented 5 months ago

Nice, thanks @ChBeil

bsttsai commented 5 months ago

@clausnagel Thanks for the explanations and solutions. @ChBeil Thanks for updating the TUM dataset! now it works normally with the citydb-tool. Could you please also update the "CityGML3_Transportation_NYC" dataset in the same repository? as it has the same missing (auxiliary) traffic space issue to link with tran:Section spaces.

clausnagel commented 5 months ago

Closing this isssue. Disucssion about fixing other datasets should take place in the TUM repository.