maputnik / osm-liberty

A free Mapbox GL basemap style for everyone
Other
443 stars 100 forks source link

Vector natural earth tiles? #69

Open kylebarron opened 4 years ago

kylebarron commented 4 years ago

Has any thought been given to using the vector Natural Earth tiles? Currently osm-liberty only uses the natural_earth_shaded_relief raster tiles.

Take a look at this example map: http://naturalearthtiles.lukasmartinelli.ch/maps/natural_earth.vector.html image

Here's the style.json for that map. It looks like in that style.json the vector data is overlaid on top of the raster, so a PR to OSM-liberty would be adding the vector layers to the existing raster.

The current raster layer only shows shading, and doesn't include boundaries or labels. Presumably when OSM data has been generated for the entire world, the OSM labels show through at low zooms, but when you're generating tiles through OpenMapTiles for a specific part of the globe, labels are otherwise missing: image

Vector natural earth tiles are also available on Klokantech's repo: https://github.com/klokantech/naturalearthtiles/tree/gh-pages/tiles/natural_earth.vector

So if there was interest in adding this, I'd think we'd set Natural Earth vector to display at zooms 0-6(?) and then set most/all other OSM features/labels to only display from zoom 7 onwards

pathmapper commented 4 years ago

when you're generating tiles through OpenMapTiles for a specific part of the globe, labels are otherwise missing

@kylebarron I guess you are using quickstart.sh to generate these tiles, right?

kylebarron commented 4 years ago

Yes; specifically in the screenshot above, I've generated OpenMapTiles only for California, Oregon, Washington, and New Hampshire.

pathmapper commented 4 years ago

Thanks for confirming.

Some thoughts:

  1. This is specific for cases when there is only OpenMapTiles (OMT) vector data availalble for certain regions and not for the whole planet (e.g. using quickstart.sh for an extract).
  2. This issue doesn't exist when using the the Maptiler hosting and planet downloads from https://openmaptiles.com/downloads/planet/.
  3. What features are we talking about exactly? Some place names and boundaries?
  4. If we would add these features for the whole planet for low zooms (e.g. 0-6) while using OMT vector data only for certain regions, there will be areas with no data if you zoom in.
  5. This could confuse the user: At low zooms it looks like there is data available for the whole planet, but if you zoom in, this is not the case.
  6. Point 5 is also true for the current natural_earth_shaded_relief raster tiles. This could be solved using bounds for the raster source to limit the rendering: https://docs.mapbox.com/mapbox-gl-js/style-spec/#sources-raster-bounds
  7. It's possible to create a "nice world view for low zooms" also with OSM data, e.g. see https://github.com/openmaptiles/openmaptiles/issues/231#issuecomment-298683149 and https://github.com/openmaptiles/openmaptiles/issues/204#issuecomment-291794523
  8. Mixing NE and OSM data could lead to side effects, see e.g. : https://github.com/openmaptiles/openmaptiles/issues/549 and https://github.com/openmaptiles/openmaptiles/issues/586.
  9. It's not clear how this additional source would affect the performance

That said, because of 4/5 and maybe 8/9 I'm not sure if this is something we should implement as default (currently I'm inclined to leave it like it is now). Some users might want a complete/nice planet for low zooms while others might prefer limiting the shaded relief raster tiles to their custom extracts (point 6).

Using vector NE tiles could be an interesting alternative to point 7, because there is no need to import the whole planet when creating OMT tiles.

@kylebarron what do you think about the following:

  1. Try out what you've suggested

I'd think we'd set Natural Earth vector to display at zooms 0-6(?) and then set most/all other OSM features/labels to only display from zoom 7 onwards

  1. Evaluate and think about further if this would be a good default

  2. Document the several options (use bounds for raster tiles, use OSM planet for low zooms, use NE for low zooms) in the Readme adding a new section like "Use OSM Liberty style with custom OSM planet extracts".

markdavieswlt commented 3 months ago

@kylebarron did you get anywhere with this? I'd also like to do this instead of using the raster tiles I'm using full planet

kylebarron commented 3 months ago

I did not, and I'm not working with this anymore