1

I wanted to open a gkpg file in geopandas 0.8.2, on windows, using conda mith channel conda-forge

obj = r'path.gpkg'
layer="layername"
gdf = gpd.read_file(obj, layer=layer)

Throws the errors:

fiona/ogrext.pyx in fiona.ogrext.Session.get_schema()
fiona/_geometry.pyx in fiona._geometry.normalize_geometry_type_code()
UnsupportedGeometryTypeError: 12

other programms using fiona can open the data, so I tried it in fiona:

features = []
with fiona.open(obj, 'r', layer=layer) as src:
     for feature in src:
            features.append(feature)
        
features   

Which made me wonder why, I cannot open it with geopandas using fiona but with fiona itself?

What even works is using the features to build a geoDataFrame

gdf = gpd.GeoDataFrame.from_features([feature for feature in features], crs=25833)
0

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.