Skip to content

Commit

Permalink
Merge pull request #92 from rnorris/ne_places-config
Browse files Browse the repository at this point in the history
Extend configuration options to include the layer 'ne_places' shapefile location
  • Loading branch information
tmcw committed Jul 25, 2016
2 parents b6c6df3 + a3e1435 commit c7aaacc
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@ Download them to the `shp` directory in the osm-bright folder. You can do this w
wget http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip
wget http://data.openstreetmapdata.com/land-polygons-split-3857.zip

If you are going to use the osm2pqsql style you will need another (but smaller shapefile)
wget http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-populated-places-simple.zip

Once downloaded, extract them from their zip files.

### 2. Run the shapefiles through shapeindex
Expand Down
6 changes: 6 additions & 0 deletions configure.py.sample
Original file line number Diff line number Diff line change
Expand Up @@ -41,3 +41,9 @@ config["postgis"]["extent"] = "-20037508.34,-20037508.34,20037508.34,20037508.34
config["land-high"] = path.join(getcwd(),"shp/land-polygons-split-3857/land_polygons.shp")
config["land-low"] = path.join(getcwd(),"shp/simplified-land-polygons-complete-3857/simplified_land_polygons.shp")

# Places shapefile required for the osm2pgsql style
# - http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-populated-places-simple.zip
# or
# - http://www.naturalearthdata.com/http//www.naturalearthdata.com/download/10m/cultural/ne_10m_populated_places.zip

config["ne_places"] = path.join(getcwd(),"shp/ne_10m_populated_places/ne_10m_populated_places.shp")
5 changes: 5 additions & 0 deletions make.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ def build():
layer["Datasource"]["file"] = config["land-low"]
elif layer["id"] == "land-high":
layer["Datasource"]["file"] = config["land-high"]
elif layer["id"] == "ne_places":
layer["Datasource"]["file"] = config["ne_places"]
else:
# Assume all other layers are PostGIS layers
for opt, val in config["postgis"].iteritems():
Expand Down Expand Up @@ -88,13 +90,16 @@ def pull():
defaultconfig["name"] = "OSM Bright"
defaultconfig["land-high"] = "http://data.openstreetmapdata.com/land-polygons-split-3857.zip"
defaultconfig["land-low"] = "http://data.openstreetmapdata.com/simplified-land-polygons-complete-3857.zip"
defaultconfig["ne_places"] = "http://mapbox-geodata.s3.amazonaws.com/natural-earth-1.4.0/cultural/10m-populated-places-simple.zip"

project["name"] = defaultconfig["name"]
for layer in project["Layer"]:
if layer["id"] == "land-low":
layer["Datasource"]["file"] = defaultconfig["land-low"]
elif layer["id"] == "land-high":
layer["Datasource"]["file"] = defaultconfig["land-high"]
elif layer["id"] == "ne_places":
layer["Datasource"]["file"] = defaultconfig["ne_places"]
else:
# Assume all other layers are PostGIS layers
for opt, val in defaultconfig["postgis"].iteritems():
Expand Down

0 comments on commit c7aaacc

Please sign in to comment.