Created
February 17, 2011 00:22
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 |
dang! That's awesomely short!
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
https://github.com/frewsxcv pointed out that using 'ls' instead of 'find' would have been cleaner - - because it doesn't print the path...all my layers loaded with './' prepended to the name.