Skip to content

Instantly share code, notes, and snippets.

@alexanno
Created November 28, 2014 20:15
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 alexanno/8ccda40ba2a1e7b20503 to your computer and use it in GitHub Desktop.
Save alexanno/8ccda40ba2a1e7b20503 to your computer and use it in GitHub Desktop.
find ./ -name \*Elveg.SOS -execdir echo "ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln elveg {}" \;
find ./ -name \*Adresser.SOS -execdir ogr2ogr -update -append -f PostgreSQL PG:'host=localhost port=54321 dbname=sandbox user=postgres active_schema=sandbox' -progress -nln adresser {} \;
####################################################
#using shp2pgsql
#!/bin/bash
for f in *.shp
do
shp2pgsql -I -s <SRID> $f `basename $f .shp` > `basename $f .shp`.sql
done
for f in *.sql
do
psql -d <DATABASE> -f $f
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment