I wish to construct a pipleline that takes GeoJSON through to self-hosted MapBox vector tiles specification.
My plan is:
- Tippecanoe converts geojson to .mbt
- mbutil converts mbt to tiles
- tileserver-php exposes endpoint for tiles.
This seems to be possible, given the docs. I have put it all together. No errors are thrown by any process and tileserver is showing that my tileset exists. However, there is an empty preview of the data and HTTP GET requests to the Z/X/Y endpoint return an HTML page (Welcome to Maps hosted with TileServer-php v2.0
). (Perhaps I need to curl with specific headers in order to test if it's working?)
My GeoJSON is an array of linestrings & is structured like this:
{
"type": "FeatureCollection",
"bbox": [-119.437,33.298,-116.724,34.583],
"features": [
{
"type": "Feature",
"geometry": {
"type": "LineString",
"coordinates": [
[-117.9756412,33.803147],
[-117.9775983,33.8031329]
]
},
"properties": {
...
}
}, ...
Using tippecanoe - appears to be OK:
$ tippecanoe -o out.mbt in.json
For layer 0, using name "my_layer"
99641 features, 2896256 bytes of geometry, 2482729 bytes of metadata, 1532578 bytes of string pool
tile 5/5/12 size is 674507 with detail 12, >500000
tile 6/10/25 size is 537511 with detail 12, >500000
tile 6/11/25 size is 608121 with detail 12, >500000
tile 7/21/51 size is 665802 with detail 12, >500000
tile 7/22/51 size is 685644 with detail 12, >500000
tile 7/22/51 size is 538985 with detail 11, >500000
tile 8/44/102 size is 754537 with detail 12, >500000
tile 8/43/102 size is 750288 with detail 12, >500000
tile 8/44/102 size is 652762 with detail 11, >500000
tile 8/43/102 size is 633573 with detail 11, >500000
tile 8/44/102 size is 513572 with detail 10, >500000
tile 9/88/204 size is 518065 with detail 12, >500000
tile 9/87/204 size is 765483 with detail 12, >500000
tile 9/87/204 size is 697630 with detail 11, >500000
tile 9/87/204 size is 583396 with detail 10, >500000
100.2% 14/2773/6531
Tileserver docs say it works better if I run mbutil over the mbt file first. I do this with the command mb-util out.mbt tiles
. There's a lot of output in the format similar to:
flipping
INFO:mbutil.util:3774 / 3774 tiles exported
Afterwards, the directory tiles
has a 3-levels deep nested structure with lots of files ending with png
. Despite the extension, the OS cannot render these as raster images. But given what they're intended to do I assume they're not PNGs as I'm used to and that this is expected.
Finally, I push the tiles along with the Tileserver code onto a PHP-enabled host in ElasticBeanstalk. The app runs and presents me with my tileset, rendered as a completely empty (black) MapboxGL view.
Here, let me show you.
So it seems nothing threw any errors, but I don't have any data. How can I find where this all went wrong?