-
-
Notifications
You must be signed in to change notification settings - Fork 25
WIP: Differences with fiona
Pieter Roggemans edited this page Feb 23, 2024
·
2 revisions
-
pyogrio
writes EMPTY geometries to gpkg,fiona
writes None.
import geopandas as gpd`
import shapely`
gdf = gpd.GeoDataFrame(geometry=[shapely.Polygon()], crs=31370)`
gdf.to_file("test_fiona.gpkg", engine="fiona")`
gdf.to_file("test_pyogrio.gpkg", engine="pyogrio")`
print(f'{gpd.read_file("test_fiona.gpkg", engine="pyogrio").geometry.item()=}')`
print(f'{gpd.read_file("test_pyogrio.gpkg", engine="pyogrio").geometry.item()=}')`
print(f'{gpd.read_file("test_fiona.gpkg", engine="fiona").geometry.item()=}')`
print(f'{gpd.read_file("test_pyogrio.gpkg", engine="fiona").geometry.item()=}')`
Output:
gpd.read_file("test_fiona.gpkg", engine="pyogrio").geometry.item()=None
gpd.read_file("test_pyogrio.gpkg", engine="pyogrio").geometry.item()=<POLYGON EMPTY>
gpd.read_file("test_fiona.gpkg", engine="fiona").geometry.item()=None
gpd.read_file("test_pyogrio.gpkg", engine="fiona").geometry.item()=<POLYGON EMPTY>