Skip to content

Commit

Permalink
Replace existing tile.openstreetmap.org coastline files with openstre…
Browse files Browse the repository at this point in the history
…etmapdata.com files

Closes gravitystorm#39

Also index the shapefiles for performance as the new ones don't come pre-indexed
  • Loading branch information
pnorman committed Jun 10, 2013
1 parent 3285e21 commit a0c8099
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 15 deletions.
38 changes: 25 additions & 13 deletions get-shapefiles.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,22 +5,22 @@ set -e -u

mkdir -p data/
mkdir -p data/world_boundaries
mkdir -p data/shoreline_300
mkdir -p data/simplified-land-polygons-complete-3857
mkdir -p data/ne_110m_admin_0_boundary_lines_land
mkdir -p data/ne_10m_populated_places
mkdir -p data/processed_p
mkdir -p data/land-polygons-split-3857

# world_boundaries
echo "dowloading world_boundaries..."
curl -z data/world_boundaries-spherical.tgz -L -o data/world_boundaries-spherical.tgz http://tile.openstreetmap.org/world_boundaries-spherical.tgz
echo "expanding world_boundaries..."
tar -xzf data/world_boundaries-spherical.tgz -C data/

# shoreline_300
echo "dowloading shoreline_300..."
curl -z data/shoreline_300.tar.bz2 -L -o data/shoreline_300.tar.bz2 http://tile.openstreetmap.org/shoreline_300.tar.bz2
echo "expanding shoreline_300..."
tar -xjf data/shoreline_300.tar.bz2 -C data/shoreline_300/
# simplified-land-polygons-complete-3857
echo "downloading simplified-land-polygons-complete-3857..."
curl -z "data/simplified-land-polygons-complete-3857.zip" -L -o "data/simplified-land-polygons-complete-3857.zip" "http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip"
echo "simplified-land-polygons-complete-3857..."
unzip -qq data/simplified-land-polygons-complete-3857.zip -d data/

# ne_110m_admin_0_boundary_lines_land
echo "dowloading ne_110m_admin_0_boundary_lines_land..."
Expand All @@ -34,15 +34,27 @@ curl -z data/ne_10m_populated_places.zip -L -o data/ne_10m_populated_places.zip
echo "expanding ne_10m_populated_places..."
unzip -qq data/ne_10m_populated_places.zip -d data/ne_10m_populated_places/

# processed_p
echo "dowloading processed_p..."
curl -z data/processed_p.tar.bz2 -L -o data/processed_p.tar.bz2 http://tile.openstreetmap.org/processed_p.tar.bz2
echo "expanding processed_p..."
tar -xjf data/processed_p.tar.bz2 -C data/processed_p/
# land-polygons-split-3857
echo "dowloading land-polygons-split-3857..."
curl -z "data/land-polygons-split-3857.zip" -L -o "data/land-polygons-split-3857.zip" "http://data.openstreetmapdata.com/land-polygons-split-3857.zip"
echo "expanding land-polygons-split-3857..."
unzip -qq data/land-polygons-split-3857.zip -d data/


#process populated places
echo "processing ne_10m_populated_places..."
ogr2ogr data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/ne_10m_populated_places/ne_10m_populated_places.shp

ogr2ogr -overwrite data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp data/ne_10m_populated_places/ne_10m_populated_places.shp

#index
echo "indexing shapefiles"

shapeindex --shape_files \
data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp \
data/land-polygons-split-3857/land_polygons.shp \
data/ne_10m_populated_places/ne_10m_populated_places_fixed.shp \
data/ne_110m_admin_0_boundary_lines_land/ne_110m_admin_0_boundary_lines_land.shp


#clean up
echo "cleaning up..."
Expand Down
4 changes: 2 additions & 2 deletions project.mml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"id": "world",
"class": "",
"Datasource": {
"file": "data/shoreline_300/shoreline_300.shp",
"file": "data/simplified-land-polygons-complete-3857/simplified_land_polygons.shp",
"type": "shape"
},
"srs-name": "900913",
Expand All @@ -65,7 +65,7 @@
"id": "coast-poly",
"class": "",
"Datasource": {
"file": "data/processed_p/processed_p.shp",
"file": "data/land-polygons-split-3857/land_polygons.shp",
"type": "shape"
},
"srs-name": "900913",
Expand Down

0 comments on commit a0c8099

Please sign in to comment.