Skip to content

Instantly share code, notes, and snippets.

@talllguy
Created April 11, 2019 12:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save talllguy/cf903de8a0599b95f21a5edaf4a52af8 to your computer and use it in GitHub Desktop.
Save talllguy/cf903de8a0599b95f21a5edaf4a52af8 to your computer and use it in GitHub Desktop.
Batch ogr2ogr script that combines multiple shapefiles in a folder into one geodatabase layer
REM Replace `gdb_name.gdb` and `name_of_layer` with your own names
REM Citation: https://gis.stackexchange.com/a/283981/15499
for %f in (*.shp) do (if not exist test.gdb (ogr2ogr -progress --config shape_encoding "UTF-8" -f "filegdb" gdb_name.gdb %f -nln name_of_layer -lco encoding="UTF-8") Else (ogr2ogr --config shape_encoding "UTF-8" -progress -f "filegdb" -update -append gdb_name.gdb %f -nln name_of_layer -lco encoding="UTF-8"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment