You are not logged in.

#1 2020-01-11 18:21:46

siloam
Member
Registered: 2019-11-29
Posts: 4

Problems with serving vector tiles (Mapbox)

Hello everyone,

I am working on my own tile server. I have weird problems with displaying tiles in the correct order. Tiles were created using OSM data.
When I use tileserver-gl-light as a tiles server everything seems to be ok, but when I try to serve tiles by my own server they do not appear in correct order after zooming. I use the same page to render the map so I think the problem is connected with server.
The tiles look like this (Zoom 1):
zXvaA2H.png

I appreciate any help.
Best regards,
Marek

Last edited by siloam (2020-01-11 18:23:05)

Offline

#2 2020-01-11 21:37:34

siloam
Member
Registered: 2019-11-29
Posts: 4

Re: Problems with serving vector tiles (Mapbox)

I don't know the reason why but there was a need for correction y axis value before fetching data from mbtiles database.

If your tiles url looks like:

http://host:port/data/{z}/{x}/{y}

you need to recalculate y value before fetching tile data in pbf format from database:

 y = pow(2, z) - 1 - y

There is no mention about this in mbtiles specification but I found the solution in Tileserver-PHP source code:

https://github.com/maptiler/tileserver- … server.php

Offline

#3 2020-01-12 22:31:59

Richard
Member
From: Charlbury, UK
Registered: 2007-04-24
Posts: 376
Website

Re: Problems with serving vector tiles (Mapbox)

https://github.com/mapbox/mbtiles-spec/ … .3/spec.md says

"Note that in the TMS tiling scheme, the Y axis is reversed from the "XYZ" coordinate system commonly used in the URLs to request individual tiles, so the tile commonly referred to as 11/327/791 is inserted as zoom_level 11, tile_column 327, and tile_row 1256, since 1256 is 2^11 - 1 - 791."

Offline

Board footer

Powered by FluxBB