mapbox / osm-bright

A Carto template for OpenStreetMap data
BSD 3-Clause "New" or "Revised" License
698 stars 225 forks source link

Adding additional shp files? #127

Open exlibris opened 6 years ago

exlibris commented 6 years ago

I have an OSM server setup using osm-bring and it is successfully rendering tiles for an extract of North America. I would like to add additional Natural Earth shp layers (lakes and administrative boundaries) to the whole planet, to better provide orientation for users when they scale out. I followed the pattern used for simplified-land-polygons-complete-3857 and land-polygons-split-3857 but can't get (for example) ne_10m_lakes to show. I am hoping somebody can let me know what critical step I missed out of this workflow:

1) I downloaded ne_10m_lakes, ne_10m_admin_0_boundary_lines_land and ne_10m_admin_1_states_provinces from Natural earth 2) I updated the osm-bright.osm2pgsql.mml to include the new shapefiles. For example: { "Datasource": { "file": "/usr/local/share/maps/style/osm-bright-master/shp/ne_10m_lakes/ne_10m_lakes.shp", "type": "shape" }, "class": "shp", "geometry": "polygon", "id": "ne_10m_lakes", "name": "ne_10m_lakes", "srs": "+proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0.0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs +over", "srs-name": "900913", "status": "on" },

3) I edited configure.py to have an entry for each new layer: config["ne_10m_lakes"] = path.join(getcwd(),"shp/ne_10m_lakes/ne_10m_lakes.shp")

4) I recompiled the stylesheet, wiped out my old tile cache, and then rerenderd the tiles.

However, no lakes show…

What am I missing? Do I need to create or update a .mss file to include directives on what color to render the lakes (and boundaries)?

Many thanks for helping a newcomer to the OSM world.

ajashton commented 6 years ago

Do I need to create or update a .mss file to include directives on what color to render the lakes (and boundaries)?

Yes, this sounds like the issue. Something like: #ne_10m_lakes { polygon-fill: @water; }