3dcitydb / 3dcitydb-qgis-explorer

QGIS Plugin for working the the 3DCityDB
GNU General Public License v2.0
7 stars 5 forks source link

Update version retrieval for 3dcitydb version 4, add sql rollback on error #8

Closed calvinjlin closed 3 months ago

calvinjlin commented 4 months ago

Not sure if this repo is still active, but here goes:

It looks like between version 3 and 4, the version function was changed.

CityDB version 3 image

CityDB version 4 image

When a v4 db is loaded, a silent error occurs where the program just returns a -1 instead of stopping. https://github.com/3dcitydb/3dcitydb-qgis-explorer/blob/6ed4bf022f7c4b883a7e35c73df9cca16c62d538/db/postgresql.py#L132-L141

However, due to the error, further SQL transactions are blocked until a rollback is executed, and so the next sql call to retrieve the citydb srs fails as described in #6.

"current transaction is aborted, commands ignored until end of transaction block"

This PR adds code to handle version retrieval for v3 and v4, as well as connection rollbacks to the exception handling. However, there maybe be other api changes in v4 that have not been addressed.

clausnagel commented 3 months ago

Thanks @calvinjlin for proposing this PR. Development in this repo is not really active anymore. You should try this work if you want to use the 3DCityDB with QGIS: https://github.com/tudelft3d/3DCityDB-Tools-for-QGIS