Skip to content

Instantly share code, notes, and snippets.

@rmarianski
Created October 21, 2014 15:22
Show Gist options
  • Save rmarianski/491e50f3dd7159ebdf23 to your computer and use it in GitHub Desktop.
Save rmarianski/491e50f3dd7159ebdf23 to your computer and use it in GitHub Desktop.
Data
#!/bin/bash
export PGPASSWORD=password
PGOPTS="-d database -h host -U user"
# water polygons
#
wget http://data.openstreetmapdata.com/water-polygons-split-3857.zip
unzip water-polygons-split-3857.zip
shp2pgsql -dID -s 900913 -W Windows-1252 -g the_geom water-polygons-split-3857/water_polygons.shp water_polygons | psql $PGOPTS
rm ./water-polygons-split-3857.zip && rm -rf ./water-polygons-split-3857
# land polygons
#
wget http://data.openstreetmapdata.com/land-polygons-split-3857.zip
unzip land-polygons-split-3857.zip
shp2pgsql -dID -s 900913 -W Windows-1252 -g the_geom land-polygons-split-3857/land_polygons.shp land_polygons | psql $PGOPTS
rm ./land-polygons-split-3857.zip && rm -rf ./land-polygons-split-3857
# simplified land polygons
#
wget http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip
unzip simplified-land-polygons-complete-3857.zip
shp2pgsql -dID -s 900913 -W Windows-1252 -g the_geom simplified-land-polygons-complete-3857/simplified_land_polygons.shp simplified_land_polygons | psql $PGOPTS
rm ./simplified-land-polygons-complete-3857.zip && rm -rf ./simplified-land-polygons-complete-3857
# vector data
#
git clone https://github.com/mapzen/vector-datasource.git
cd vector-datasource/data
for i in `ls *.zip`
do
unzip $i
done
./shp2pgsql.sh | psql $PGOPTS
./perform-sql-updates.sh $PGOPTS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment