Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BUG/ fiona parity: error on writing zipped shapefile with .shp.zip #449

Open
m-richards opened this issue Jul 15, 2024 · 0 comments
Open

Comments

@m-richards
Copy link
Member

gdf = gpd.read_file(geodatasets.get_path("nybb"))
gdf.to_file("out.path.shz")
read = gpd.read_file("out.path.shz") # this works fine

gdf.to_file("out2.shp.zip", engine='pyogrio', driver='ESRI Shapefile') # this fails with pyogrio, works with fiona
read = gpd.read_file("out2.shp.zip")
File "C:\Data\myDocuments\Code\python_other\data_science_open_source\pandas_new\venv\lib\site-packages\pyogrio\geopandas.py", line 645, in write_dataframe
    write(
  File "C:\Data\myDocuments\Code\python_other\data_science_open_source\pandas_new\venv\lib\site-packages\pyogrio\raw.py", line 709, in write
    ogr_write(
  File "pyogrio\\_io.pyx", line 2294, in pyogrio._io.ogr_write
  File "pyogrio\\_io.pyx", line 2193, in pyogrio._io.create_ogr_dataset_layer
pyogrio.errors.DataLayerError: Failed to create file /vsizip/out2.shp.zip/out2.shp.shp: No error

Picked this up going through the handful of recent zipfile related geopandas issues. Seems to be a double .shp.shp extension inside the last line, not sure if that's related or also an oddity.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant