-
Notifications
You must be signed in to change notification settings - Fork 207
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnsupportedGeometryTypeError in Fiona 1.8.22 #1155
Comments
Do you know what type of geometries you have stored in the file? The error indicates that fiona received a geometry type it doesn't support (16 typically indicates TIN, https://en.wikipedia.org/wiki/Well-known_text_representation_of_geometry#Well-known_binary) |
QGIS states MultiPolygonZ, which makes sence for LoD1. I could open about 66 %. (I added an example in my first post). |
Using
|
QGIS automatically maps TIN to MultiPolygon (https://gdal.org/development/rfc/rfc64_triangle_polyhedralsurface_tin.html, qgis/QGIS#5298). Something similar could probably be done for Fiona (or optionally) |
There should be support for converting TIN's to MultiPolygon: Thus, there might be something not working as intended. |
Ah, wasn't aware that this was already supported. Indeed I can read the test file that is included in Fiona:
But so with the same Fiona install, reading the file provided here results in the UnsupportedGeometryTypeError: 16 error. So something else is still going wrong. Maybe the issue here is that it's actually a GeometryCollection containing a TIN? So the type code of the actual geometry is not 16 for TIN, but 7 for GeometryCollection. For that reason, it's not converted on the GDAL, and then when actually converting the geometry in the GeomBuilder class, it sees TIN as one of the parts (so also in |
@jorisvandenbossche thanks, now it makes sense! It looks as if the code in https://github.com/Toblerity/Fiona/blob/maint-1.8/fiona/ogrext.pyx#L298-L311 needs to be also in https://github.com/Toblerity/Fiona/blob/master/fiona/_geometry.pyx#L148, or better refactored that it is only in one place, e.g. in GeomBuilder.build. |
Done! |
Expected behavior and actual behavior.
Opening the file. Is working wit some files. Others raises the error below:
Steps to reproduce the problem.
open the file with geopandas' read_file
Operating system
OS Ubuntu 20.04 derivative
Fiona and GDAL version and provenance
installed with mamba 0.27.0:
fiona 1.8.2.2
gdal 3.5.2
Example Shape File: LoD1_23445938.zip
(1/3 of the LoD1 files (by Lower Saxony (open Data)) I tried did not open). But this example opens in QGIS.
The text was updated successfully, but these errors were encountered: