Using GCSFS to load shapefiles #1133
Unanswered
afernando79
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all,
I am curious as to whether it is possible to read a shapefile from a a GCS bucket without having to explicitly download the files (DBF, SHP and SHX files)?
I have been able to resolve this issue by using GCSFuse but want to avoid using os-level libraries to achieve this if possible so have been trying to get a python library to help here.
So far I am able to open a shapefile by zipping it up and using:
But if I replace the zip with a path to a "shp" file, I am faced with an error similar to:
DriverError: '/vsimem/2b892643b1ee48afada92f1543270fba' not recognized as a supported file format.
I am assuming this is because the other required files are not accessible as native
open
function? I have not found a way to pass the filesystem into geopandas.read_file (and thus fiona).pyarrow
appears to support filesystem as a kwarg allowing it access a parquet file as needed.If zipping is the only way for this to work, so be it but it would be especially cool to be able to pass the filesystem for fiona to leverage the provided fs and potentially read the other files as needed?
I may be way off the mark here but figured why not ask the question!
Any help on how to achieve "read a shapefile from GCS" would be appreciated.
Beta Was this translation helpful? Give feedback.
All reactions