I am able to read and write shapefiles in ArcGIS Pro using geopandas, but it would be more useful to read and write within a geodatabase. When I try to read a feature class in a file geodatabase, I get the following driver error:
DriverIOError: Attempt to create csv layer (file) against a non-directory datasource.
When I try to write a geodataframe as a feature class, I get the following error:
No such file or directory
I am wondering what I'm doing wrong... Please see my script below:
file = outGDB + '\FC_Name'
FC_gdf = gp.read_file(file, driver = 'FileGDB'))
FC_gdf = gp.to_file(file, driver = 'FileGDB')
Thanks for your help!
Solved! Go to Solution.
I think this is an issue with having the FileGeodatabase drivers in a place that gdal / fiona can find it. Those two libraries are the backend for GeoPandas. You can get this setup, but it can be a pain to get it all working. For example: https://gis.stackexchange.com/questions/378890/adding-support-to-esris-filegdb-driver-when-fiona-gda...
Some other info: https://gdal.org/drivers/vector/filegdb.html#vector-filegdb
An alternative is to use the ArcGIS API for python and read and write a spatially enabled DataFrame. GeoPandas is better in a lot of ways, but SEDF generally works well with File Geodatabases and an ArcGIS Pro license: https://developers.arcgis.com/python/guide/part2-data-io-reading-data/
I think this is an issue with having the FileGeodatabase drivers in a place that gdal / fiona can find it. Those two libraries are the backend for GeoPandas. You can get this setup, but it can be a pain to get it all working. For example: https://gis.stackexchange.com/questions/378890/adding-support-to-esris-filegdb-driver-when-fiona-gda...
Some other info: https://gdal.org/drivers/vector/filegdb.html#vector-filegdb
An alternative is to use the ArcGIS API for python and read and write a spatially enabled DataFrame. GeoPandas is better in a lot of ways, but SEDF generally works well with File Geodatabases and an ArcGIS Pro license: https://developers.arcgis.com/python/guide/part2-data-io-reading-data/