Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
I have a list of dataframes, all of the same structure and all are polygons.
How can I add them all together using geopandas?
it seems that this is the right way to do that right now:
rdf = gpd.GeoDataFrame( pd.concat( dataframesList, ignore_index=True) )
rdf = gpd.GeoDataFrame(pd.concat(dataframesList, ignore_index=True), crs=dataframesList.crs)
I just experimented with this - maybe in GeoPandas 0.2.1 and Pandas 0.20.3 it is a bit more concise:
gdf = pd.concat([gdf1, gdf2])
gdf is automatically created as a GeoDataFrame. Of course if there is a chance of conflicting indices you'll want to keep the 'ignore_index=True' parameter.
gdf1.to_file(xxx, driver='ESRI Shapefile')
'DataFrame' object has no attribute 'to_file'
Required, but never shown