You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While preparing #435 it seems that write_dataframe() is happy to write a dataframe with (e.g.) a "POINT EMPTY" geometry. However, read_dataframe() will read this geometry as None, so the two geodataframes don't round-trip. E.g.:
frompyogrio.geopandasimportread_dataframe, write_dataframeimportgeopandasasgpfromgeopandas.arrayimportfrom_wktexpected=gp.GeoDataFrame({"x": [0]}, geometry=from_wkt(["POINT EMPTY"]), crs=4326)
print(expected)
# x geometry# 0 0 POINT EMPTYfilename="/tmp/test.shp"write_dataframe(expected, filename)
df=read_dataframe(filename)
print(df)
# x geometry# 0 0 None
Note this is the same as fiona, e.g.:
gp.read_file(filename, engine="fiona")
returns the same. And raw fiona doesn't do much better except identify the geometry type in the schema:
While preparing #435 it seems that
write_dataframe()
is happy to write a dataframe with (e.g.) a "POINT EMPTY" geometry. However,read_dataframe()
will read this geometry as None, so the two geodataframes don't round-trip. E.g.:Note this is the same as fiona, e.g.:
returns the same. And raw fiona doesn't do much better except identify the geometry type in the schema:
The text was updated successfully, but these errors were encountered: