maptiler / tileserver-gl

Vector and raster maps with GL styles. Server side rendering by MapLibre GL Native. Map tile server for MapLibre GL JS, Android, iOS, Leaflet, OpenLayers, GIS via WMTS, etc.
https://tileserver.readthedocs.io/en/latest/
Other
2.19k stars 631 forks source link

Issues serving OS Zoomstack mbtiles locally #311

Open chiubaca opened 6 years ago

chiubaca commented 6 years ago

Hi there!

So I've got tilesever-gl working nicely via the docker image on Ubuntu 17.10.

I'm trying to plug in vector tiles from OS Zoomstack (a new UK data product from the Ordnance Survey) but the map is not getting rendered correctly at the large scales.

After running: sudo docker run --rm -it -v $(pwd):/data -p 80:80 klokantech/tileserver-gl --verbose --config zoomstack/configs/test.json I get the following logged repeatedly for what looks like hundreds of lines :

mbgl: { class: 'ParseStyle',
  severity: 'WARNING',
  text: 'value must be a number' }

Followed by:

Startup complete
mbgl: { class: 'Style',
  severity: 'ERROR',
  text: 'Failed to load source composite: 0 - The document is empty.' }

Here is what my config looks like, please let me know if I've done something stupid:

{
  "options": {
    "paths": {
      "root": "/data/zoomstack",
      "fonts": "fonts",
      "sprites":"sprites"
,      "styles": "styles",
      "mbtiles": ""
    }
  },
  "styles": {
    "light":{
    "style": "light_style.json"
    }
   },
  "data": {
    "OS-Open-Zoomstack": {
      "mbtiles": "OS-Open-Zoomstack.mbtiles"
    },
    "zurich": {
      "mbtiles": "zurich_switzerland.mbtiles"
    }
  }
}

Here's a link to my dev server here for your inspection - http://chiubuntu.westeurope.cloudapp.azure.com/styles/light/#5.23/54.08/-4.856

I've uploaded the same vector tiles to Mapbox along with the same stylesheet and it is all working as expected. So here is what it is supposed to look like - https://api.mapbox.com/styles/v1/chiubaca/cjluo2ov01m8f2snxgvkx2rcr.html?fresh=true&title=true&access_token=pk.eyJ1IjoiY2hpdWJhY2EiLCJhIjoiY2lrNWp6NzI2MDA0NmlmbTIxdGVybzF3YyJ9.rRBFEm_VY3yRzpMey8ufKA#15.6/50.870457/-1.402399

Here is my light_style.json stylesheet attached (changed to .txt so i can attach it). light_style.txt

Hope you can help!

petrsloup commented 6 years ago

The URLs in the style are incorrect -- the glyphs should probably link to "{fontstack}/{range}.pbf" and sprites are also incorrect (but this really depends on the names of your files -- maybe "sprite" would be the correct value?).

Linking from style to dataset by using the full URL is possible, but maybe the server is not able to link itself in such a way? It would be better to use symbolic "mbtiles://{OS-Open-Zoomstack}" instead.

chiubaca commented 6 years ago

Thanks for your response Petr. I'm still getting a similar issue after updating the glyphs and source as per your recommendation, please could you have another look over my stylesheet? light_style.txt

Im still unsure if the reference to my sprites folder is correct? The folder which contains the zoomstack sprites is called sprites so not a typo.

This is what my data/zoomstack directory looks like: . ├── OS-Open-Zoomstack.mbtiles ├── README.md ├── configs │   └── test.json ├── fonts │   ├── Open Sans Regular │   ├── Source Sans Pro Bold │ ├── Source San Pro Regular │ ├── Source Sans Pro SemiBold │   └── fonts.json ├── sprites │   ├── sprites.json │   ├── sprites.png │   ├── sprites@2x.json │   ├── sprites@2x.png │   ├── sprites@3x.json │   └── sprites@3x.png ├── styles │   └── light_style.json └── zurich_switzerland.mbtiles

mo-ian-watkins commented 5 years ago

Had this issue as well. Doesn’t work of tileserver-gl versions before 2.5. Running 2.5 or later and the styles OS provide work fine.