geopandasfiona

geopandas readfile not recognizing a legit shape file


I am trying to read to geopandas what looks like a legitimate shapefile:

gpd.read_file('https://github.com/altcoder/philippines-psgc-shapefiles/blob/master/source/2015/Municities.zip')

However, I am getting a driver error:

DriverError: '/vsimem/dff0663a4e584987848e40266f6b73e8' not recognized as a supported file format.

Searching unfortunately did not produce useful clues. I hope someone who knows geopandas or fiona could help.


Solution

  • When loading from GitHub, you need to pass a link to raw version of zip file. Otherwise, it links to GitHub page, not the file.

    gpd.read_file('https://github.com/altcoder/philippines-psgc-shapefiles/raw/master/source/2015/Municities.zip')