0

I try to use GML data from Landesvermessung Brandenburg in GeoPandas. It generally works to load files like this:

df = gpd.read_file(r'/vsizip//vsicurl/https://data.geobasis-bb.de/geobasis/daten/3d_gebaeude/lod2_gml/lod2_33379-5805.zip/lod2_33379-5805_geb.gml')

This gives the following warning, which I tend to ignore:

C:\Daten\Anaconda\lib\site-packages\geopandas\geodataframe.py:422: RuntimeWarning: Sequential read of iterator was interrupted. Resetting iterator. This can negatively impact the performance.
  for feature in features_lst:

But one file in the bulk does contain one odd polygon, where linestrings are expected:

df = gpd.read_file(r'/vsizip//vsicurl/https://data.geobasis-bb.de/geobasis/daten/3d_gebaeude/lod2_gml/lod2_33379-5806.zip/lod2_33379-5806_geb.gml')

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Daten\Anaconda\lib\site-packages\geopandas\io\file.py", line 133, in _read_file
    columns = list(features.schema["properties"])
  File "C:\Daten\Anaconda\lib\site-packages\fiona\collection.py", line 208, in schema
    self._schema = self.session.get_schema()
  File "fiona/ogrext.pyx", line 719, in fiona.ogrext.Session.get_schema
  File "fiona/_geometry.pyx", line 81, in fiona._geometry.normalize_geometry_type_code
fiona.errors.UnsupportedGeometryTypeError: 2147483648

I only want linestrings (MULTILINESTRING Z) and want to ignore other geometry types. Is there a way in GeoPandas?

  • It looks as a geometry type present in the dataset is not understood by Fiona. I would recommend to post this on Fiona's issue tracker: github.com/Toblerity/Fiona/issues – rbuffat Dec 2 '20 at 11:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.