Skip to content

Instantly share code, notes, and snippets.

@mccraigmccraig
Created November 2, 2017 11:31
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save mccraigmccraig/cdbd74e2a869ce5c46f36f5fa10a61dc to your computer and use it in GitHub Desktop.
Save mccraigmccraig/cdbd74e2a869ce5c46f36f5fa10a61dc to your computer and use it in GitHub Desktop.
## import to PostGIS
# import OS shapefiles
# import all shapefiles in the current directory into tables
# of the same name, with an "osbl_" prefix
for a in **/*.shp ; do
if [[ "$a" =~ "^(.*)\.shp$" ]] ; then
shp2pgsql -s 27700:4326 -d -I ${match}.shp osbl_${match} | psql -d clustermap2
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment