I have a geodataframe of several thousand rows, mixed geometry (Point, LineString, Polygon). I would like to write this out to a geopackage with different layers per geometry type. Here's what I've got so far (in jupyter nb):
import geopandas as gpd %matplotlib inline geojson_file = "C:/Temp/data.geojson" gdf = gpd.read_file(geojson_file) gdf.head() # yields good results gdf.plot() # draws all the various geometries where they should be gpkg = "C:/Temp/converted.gpkg" gdf.to_file(gpkg, driver="GPKG")
Then when I load the layers...
import fiona for ln in fiona.listlayers(gpkg): with fiona.open(gpkg, layer=ln) as dataset: print(ln, len(dataset))
it only gives me
Where am I going wrong?
EDIT: I'm on Windows 10, Python 3.8 (anaconda), and GeoPandas 0.8.1