So I have some geoplotting code within a python recipe. Something similar to this:
world = gpd.read_file(gpd.datasets.get_path('naturalearth_lowres'))
usa = world[world.name == "United States of America"]
ax = world[world.name == 'United States of America'].plot(
# We can now plot our ``GeoDataFrame``.
So I would like to read in and overlay a shapefile of my own instead of using the geopandas naturalearth_lowres file.
So I uploaded the shapefile and tried this: https://knowledge.dataiku.com/latest/kb/analytics-ml/geospatial/shapefiles.html, tho I think that is not what I want. I just want the raw shapefile.
So then I created a managed folder and tried to upload the shapefile from there and tried reading it in. The code looks similar to this:
handle = dataiku.Folder("shapefiles")
paths = handle.file_path("CA_Counties_TIGER2016.shp")
ca = gpd.read_file(paths)
This gives me an error of:
CPLE_OpenFailedError: Unable to open /home/ubuntu/DATA_DIR/bucket/dataiku/DYNAMICDEPARTUREROUTING/JmYR0Zm2/CA_Counties_TIGER2016.shx or /home/ubuntu/DATA_DIR/bucket/dataiku/DYNAMICDEPARTUREROUTING/JmYR0Zm2/CA_Counties_TIGER2016.SHX. Set SHAPE_RESTORE_SHX config option to YES to restore or create it.
How do I get ahold of that managed file to pass it into geopandas?
Welcome to the Dataiku Community. So pleased that you found your answer, and shared your question. I suspect that someone in the future will have a similar question. You have provided some insights on how you solved your problem.
Hope you are having a great day.