Created
October 21, 2014 15:22
-
-
Save rmarianski/491e50f3dd7159ebdf23 to your computer and use it in GitHub Desktop.
Data
This file contains 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
#!/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