简体   繁体   中英

Writing .shp file to S3

I try to write a geopandas dataframe ( df ) as a shape file to my s3 bucket (using databricks)

the S3 bucket is correctly mounted under mnt/jk/Geo_data

But

df.to_file('mnt/jk/Geo_data/shapefiles/Geometries.shp', driver='ESRI Shapefile')

returns

 Failed to create file /databricks/driver/mnt/jk/Geo_data/shapefiles/Geometries.shp: No such file or directory

As geopandas is Python library, in databricks you need to prepend all paths with /dbfs/ . So your path should be "/dbfs/mnt/jk/Geo_data/shapefiles/Geometries.shp".

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM