Skip to content

Commit

Permalink
rework documentation and default config to use pre-downloaded local s…
Browse files Browse the repository at this point in the history
…hapefiles - closes mapbox#53
  • Loading branch information
Dane Springmeyer committed Nov 20, 2013
1 parent 5eaee56 commit ef424ff
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 7 deletions.
13 changes: 12 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@ implementation.
Setup Instructions
------------------

### 1. Set up PostgreSQL & PostGIS ###
### 1. Download shapefiles

OSM Bright depends on several large shapefiles. You should start downloading these
now so that they are ready later when you need them for rendering.

Download them to the `osm-bright` directory. You can do this with `wget` like:

wget http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip
wget http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip
wget http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.3.0/physical/10m-land.zip

### 2. Set up PostgreSQL & PostGIS ###

If you don't already, you need to have [PostgreSQL][] installed & running with
a [PostGIS][] database setup within it. See the [PostGIS documentation][1] for
Expand Down
17 changes: 11 additions & 6 deletions configure.py.sample
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python

from os import path
from os import path, getcwd
from collections import defaultdict
config = defaultdict(defaultdict)

Expand Down Expand Up @@ -28,14 +28,19 @@ config["postgis"]["password"] = ""
# in the same units as the database (probably spherical mercator meters). The
# whole world is "-20037508.34 -20037508.34 20037508.34 20037508.34".
# Leave blank to let Mapnik estimate.
config["postgis"]["extent"] = "-20037508.34 -20037508.34 20037508.34 20037508.34"
config["postgis"]["extent"] = "-20037508.34,-20037508.34,20037508.34,20037508.34"

# Land shapefiles required for the style. If you have already downloaded
# these or wish to use different versions, specify their paths here.
# OSM land shapefiles from MapBox are indexed for Mapnik and have blatant
# errors corrected (eg triangles along the 180 E/W line), but are updated
# infrequently. The latest versions can be downloaded from osm.org:
# errors corrected (eg triangles along the 180 E/W line). They can be download
# from:
# - http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip
# - http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip
# But, they are updated infrequently. The latest versions can be downloaded from osm.org:
# - http://tile.openstreetmap.org/processed_p.tar.bz2
# - http://tile.openstreetmap.org/shoreline_300.tar.bz2
config["processed_p"] = "http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip"
config["shoreline_300"] = "http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip"
config["processed_p"] = path.join(getcwd(),"coastline-good.zip")
config["shoreline_300"] = path.join(getcwd(),"shoreline_300.zip")
# http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.3.0/physical/10m-land.zip
config["land"] = path.join(getcwd(),"10m-land.zip")
3 changes: 3 additions & 0 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,8 @@ def build():
layer["Datasource"]["file"] = config["shoreline_300"]
elif layer["id"] in ("processed_p", "processed_p_outline"):
layer["Datasource"]["file"] = config["processed_p"]
elif layer["id"] in ("land"):
layer["Datasource"]["file"] = config["land"]
else:
# Assume all other layers are PostGIS layers
for opt, val in config["postgis"].iteritems():
Expand Down Expand Up @@ -87,6 +89,7 @@ def pull():
defaultconfig["name"] = "OSM Bright"
defaultconfig["processed_p"] = "http://tilemill-data.s3.amazonaws.com/osm/coastline-good.zip"
defaultconfig["shoreline_300"] = "http://tilemill-data.s3.amazonaws.com/osm/shoreline_300.zip"
defaultconfig["land"] = "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.3.0/physical/10m-land.zip"

project["name"] = defaultconfig["name"]
for layer in project["Layer"]:
Expand Down

0 comments on commit ef424ff

Please sign in to comment.