Skip to content

Instantly share code, notes, and snippets.

@oeon
Created February 17, 2011 00:22
Show Gist options
  • Save oeon/830644 to your computer and use it in GitHub Desktop.
Save oeon/830644 to your computer and use it in GitHub Desktop.
batch upload folder of shapefiles which are all in same .prj to PostGIS database
#!/bin/bash
FILES=$(ls *.shp | sed 's/\..\{3\}$//');
for FILE in $FILES
do
shp2pgsql -s 4326 -I -k ${FILE} gis.${FILE} | psql -d HSIP
done
@patdevinwilson
Copy link

dang! That's awesomely short!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment