Last active
August 29, 2015 14:18
-
-
Save glw/6fc733c9beaaad462900 to your computer and use it in GitHub Desktop.
shp2pgsql bulk import shpfiles
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
#Import a directory of shapefiles into postgis as a geometry | |
#replace EPSG SRID, database, and username, and others if necessary | |
for f in *.shp; | |
do | |
shp2pgsql -s <EPSG SRID> -g geom $f main.${f%.*} | psql -h localhost -p 5432 -d <database> -U <username>; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment