Skip to content

Instantly share code, notes, and snippets.

@wriglz
Last active January 24, 2020 09:38
Show Gist options
  • Save wriglz/fefa1cbe820ffdcd3d24848eea085fc4 to your computer and use it in GitHub Desktop.
Save wriglz/fefa1cbe820ffdcd3d24848eea085fc4 to your computer and use it in GitHub Desktop.
from pathlib import Path
import pandas
import geopandas
folder = Path("/path/to/shapefile/folder")
shapefiles = folder.glob("shapefile_name_with_wildcards_*.shp")
gdf = pandas.concat([
geopandas.read_file(shp)
for shp in shapefiles
]).pipe(geopandas.GeoDataFrame)
gdf.to_file(folder / 'merged_shape.shp')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment