versatiles-org / versatiles-rs

VersaTiles - A toolbox for converting, checking and serving map tiles in various formats.
https://versatiles.org
MIT License
57 stars 2 forks source link

How can you use `versatiles serve` as your own step? #51

Closed githubtilemaker closed 11 months ago

githubtilemaker commented 11 months ago

I would like to test this stack locally. I do not know Rust. I have experience with MapLibre, Tilemaker and mbtiles.

What I did I up to know

  1. I have created the fileoutput.versatiles, which contains a German federal state.
$ versatiles probe output.versatiles 
probe "output.versatiles"
TileReader:VersaTiles {
    parameters:  {
        bbox_pyramid: [
            0: [0,0,0,0] (1),
            1: [1,0,1,0] (1),
            2: [2,1,2,1] (1),
            3: [4,2,4,2] (1),
            4: [8,5,8,5] (1),
            5: [16,10,16,10] (1),
            6: [33,21,33,21] (1),
            7: [66,42,67,43] (4),
            8: [132,85,134,87] (9),
            9: [264,171,268,175] (25),
            10: [529,343,536,351] (72),
            11: [1058,686,1072,703] (270),
            12: [2117,1372,2144,1407] (1008),
            13: [4235,2744,4289,2814] (3905),
            14: [8470,5489,8579,5629] (15510),
        ],
        decompressor: UnGzip,
        flip_y: false,
        swap_xy: false,
        tile_compression: Gzip,
        tile_format: PBF,
    },
}
  1. Download the optional frontend I fetched the frontend via curl -Lo frontend.br.tar "https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend.br.tar" like explained here.

What I did expect

I expected the command versatiles serve -s ~/versatilesTest/frontend.br.tar ~/versatilesTest/output.versatiles to show me the frontend with tiles. Unfortunately, the tiles are not found.

$ versatiles serve -s ~/versatilesTest/frontend.br.tar ~/versatilesTest/output.versatiles
   /tiles/output/*                 <-  /home/myuser/versatilesTest/output.versatiles
server starts listening on 127.0.0.1:8080

browser

I am working with Ubuntu 22.04. and would appreciate help.

MichaelKreil commented 11 months ago

As far as I can see versatiles responded correctly: Your tiles cover only Germany. So on zoom level 1 only the "north east" tile /tiles/output/1/1/0 is defined. The other 3 tiles return a 404. That shouldn't be a problem since MapLibre knows to handle 404 responses.

githubtilemaker commented 11 months ago

Thank you very much for your very quick reply. You are right. The first time I tried it, I didn't even notice that the existing tile wasn't complaint.

And when I now enter http://localhost:8080/tiles/output/1/1/0 as the address in the browser, a pbf file is downloaded.

So far, everything is fine.

But the tile is not displayed. What could be the reason for this? Do you have an idea?

MichaelKreil commented 11 months ago

Our frontend currently supports only vector tiles in shortbread scheme. We are still behind some basic features, e.g. for debugging vector tiles. :/ I would recommend using https://github.com/acalcutt/maplibre-gl-inspect ... maybe I can add it to the frontend right now ... might take a few minutes ...

MichaelKreil commented 11 months ago

Ok, we have a new frontend (1.1.0) that includes MapLibre Inspect. You can use that tool to inspect your vector tiles.

githubtilemaker commented 11 months ago

Thank you. I found the small area with the inspector. That was indeed the problem.