Skip to content

Instantly share code, notes, and snippets.

@JamesHarrison
Last active February 19, 2016 17:24
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 JamesHarrison/36ae52f7846eb16e8b80 to your computer and use it in GitHub Desktop.
Save JamesHarrison/36ae52f7846eb16e8b80 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Set PGPASSWORD envvar if you don't want to be typing in your password all day
for tile in {TV,TR,TQ,TM,TL,TG,TF,TA,SZ,SY,SX,SW,SV,SU,ST,SS,SR,SP,SO,SN,SM,SK,SJ,SH,SE,SD,OV,NZ,NY,NX,NW,NU,NT,NS,NR,NO,NN,NM,NL,NK,NJ,NH,NG,NF,ND,NC,NB,NA,HZ,HY,HX,HW,HU,HT,HP}
do
for layer in {Building,ElectricityTransmissionLine,Foreshore,FunctionalSite,Glasshouse,ImportantBuilding,MotorwayJunction,NamedPlace,RailwayStation,RailwayTrack,RailwayTunnel,Road,RoadTunnel,Roundabout,SurfaceWater_Area,SurfaceWater_Line,TidalBoundary,TidalWater_Line,Woodland}
do
shp2pgsql -s 27700 -p -I "OSOpenMapLocal (ESRI Shape File) $tile/data/${tile}_${layer}.shp" "OSOML_$layer" | psql -h your-host -U username -d database
done
done
#!/bin/bash
# Set PGPASSWORD envvar if you don't want to be typing in your password all day
for tile in {TV,TR,TQ,TM,TL,TG,TF,TA,SZ,SY,SX,SW,SV,SU,ST,SS,SR,SP,SO,SN,SM,SK,SJ,SH,SE,SD,OV,NZ,NY,NX,NW,NU,NT,NS,NR,NO,NN,NM,NL,NK,NJ,NH,NG,NF,ND,NC,NB,NA,HZ,HY,HX,HW,HU,HT,HP}
do
for layer in {Building,ElectricityTransmissionLine,Foreshore,FunctionalSite,Glasshouse,ImportantBuilding,MotorwayJunction,NamedPlace,RailwayStation,RailwayTrack,RailwayTunnel,Road,RoadTunnel,Roundabout,SurfaceWater_Area,SurfaceWater_Line,TidalBoundary,TidalWater_Line,Woodland}
do
shp2pgsql -s 27700 -a "OSOpenMapLocal (ESRI Shape File) $tile/data/${tile}_${layer}.shp" "OSOML_$layer" | psql -h your-host -U username -d database
done
done
@JamesHarrison
Copy link
Author

This assumes you've downloaded all/subset of the mentioned OS OpenMap Local datasets as listed above.

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