3dcitydb / citydb-tool

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

Unsuccessful export of a CityGML dataset with many generic attributes. #8

Closed joemureithi closed 8 months ago

joemureithi commented 8 months ago

I have a transport dataset converted from OpenDrive to CityGML 3.0, which is successfully imported into the 3DCityDB v5 using the _citydbtool. However, exporting the same data to a CityGML file takes too long while throwing no errors. For instance, in the dataset and setup described below, a successful import of all the features took 28 seconds, while I had to cancel the export after waiting for 6 hours. The import/export works perfectly with another smaller transportation dataset (13MB, 805 features, 2,004 properties, and 8-10 attributes per feature).

Tools Setup

Data Characteristics Import file size: ≈ 155MB Import time: ≈ 28 seconds

Row counts feature: 27,844 property: 430,915 geometry_data: 27,569

The number of generic attributes per feature varies, with many features having more than 40 attributes.

I will privately provide the dataset for testing.

BWibo commented 8 months ago

Hey @joemureithi,

please add some details about your setup. Did you use the Docker images for both the database and citydb-tool or native installations? What PostgreSQL/PostGIS versions do you use?

yaozhihang commented 8 months ago

Hi, let's move the issue to the citydb-tool. There is a better place, because the issue is caused by the java tool.

yaozhihang commented 8 months ago

@clausnagel I think we should add an additional condition referenceType == ReferenceType.GLOBAL_REFERENCE to the following code line: https://github.com/3dcitydb/citydb-tool/blob/main/citydb-operation/src/main/java/org/citydb/operation/exporter/hierarchy/PropertyBuilder.java#L79

yaozhihang commented 8 months ago

@clausnagel I think we should add an additional condition referenceType == ReferenceType.GLOBAL_REFERENCE to the following code line: https://github.com/3dcitydb/citydb-tool/blob/main/citydb-operation/src/main/java/org/citydb/operation/exporter/hierarchy/PropertyBuilder.java#L79

No, it doesn't work in case of filtered-export. Have to find a better way.

clausnagel commented 8 months ago

I think I already found the solution.

We should change this line https://github.com/3dcitydb/citydb-tool/blob/2c6851b8f518bc6278d04076e1e617f792a56e67/citydb-operation/src/main/java/org/citydb/operation/exporter/hierarchy/HierarchyBuilder.java#L80

into if (referenceType != ReferenceType.GLOBAL_REFERENCE.getDatabaseValue()) {

yaozhihang commented 8 months ago

referenceType != ReferenceType.GLOBAL_REFERENCE.getDatabaseValue()

Looks correct.

clausnagel commented 8 months ago

Thanks for your feedback. Should we do more tests or just commit?

yaozhihang commented 8 months ago

it is obviously a bug. We can just commit.

clausnagel commented 8 months ago

Addressed by #9.

joemureithi commented 8 months ago

Addressed by #9.

I just tested the fix, and it works smoothly now even with a bigger dataset. The import and export times are approximately similar. Thank you!