Skip to content

Instantly share code, notes, and snippets.

@ThomasG77
Last active March 30, 2023 21:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ThomasG77/7d99b7d79138bda9a2dfb092728da54c to your computer and use it in GitHub Desktop.
Save ThomasG77/7d99b7d79138bda9a2dfb092728da54c to your computer and use it in GitHub Desktop.

Issue related to releases files from announcement https://blog.geofabrik.de/?p=589

The recipe

sudo update
sudo apt-get -q install -y build-essential git wget unzip tmux htop aria2 sysstat brotli cmake ifstat libsqlite3-dev openssl libssl-dev pkg-config curl gnupg2 ca-certificates lsb-release nginx

# install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
source "$HOME/.cargo/env"

# install versatiles
cargo install versatiles # 0.2.14 by default

wget https://download.geofabrik.de/europe/france/pays-de-la-loire-shortbread-1.0.tar.gz
gzip -d pays-de-la-loire-shortbread-1.0.tar.gz >| pays-de-la-loire-shortbread-1.0.tar
versatiles convert pays-de-la-loire-shortbread-1.0.tar pays-de-la-loire-shortbread.versatiles
versatiles probe pays-de-la-loire-shortbread.versatiles
## Return the following
# TileReader:VersaTiles {
#     parameters: TileReaderParameters {
#         tile_format: PBF,
#         tile_precompression: Uncompressed,
#         bbox_pyramide: [
#             "0: TileBBox [0,0,0,0] = 1",
#             "1: TileBBox [0,0,0,1] = 2",
#             "2: TileBBox [1,1,1,2] = 2",
#             "3: TileBBox [2,3,2,4] = 2",
#             "4: TileBBox [5,7,5,8] = 2",
#             "5: TileBBox [11,15,11,16] = 2",
#             "6: TileBBox [22,31,22,32] = 2",
#             "7: TileBBox [44,63,45,64] = 4",
#             "8: TileBBox [88,126,90,128] = 9",
#             "9: TileBBox [176,252,181,257] = 36",
#             "10: TileBBox [353,504,363,514] = 121",
#             "11: TileBBox [707,1008,726,1029] = 440",
#             "12: TileBBox [1414,2017,1453,2058] = 1680",
#             "13: TileBBox [2828,4035,2907,4116] = 6560",
#             "14: TileBBox [5656,8070,5814,8233] = 26076",
#         ],
#         decompressor: DataConverter {
#             pipeline: [],
#         },
#         flip_vertically: false,
#     },
# }

curl -L "https://github.com/versatiles-org/versatiles-frontend/releases/latest/download/frontend.br.tar" > ./frontend.br.tar

versatiles serve -s ./frontend.br.tar -p 8080 "pays-de-la-loire-shortbread.versatiles"

The error

When going to http://localhost:8080/map.html?url=/tiles/pays-de-la-loire-shortbread/#13/47.2383/-1.5603 (Nantes, in the middle of the tiles data area), I got some 404 for all tiles.

Trying to sort out things, on OpenStreetMap.org, I get https://tile.openstreetmap.org/13/4058/2873.png for the area pays de la loire, so I expect http://localhost:8080/tiles/pays-de-la-loire-shortbread/13/4058/2873 to work but got a "Not Found"

Whereas if I try the opposite e.g http://localhost:8080/tiles/pays-de-la-loire-shortbread/13/2873/4058, it works but it's not the pattern I expect and I know now why I got these 404 errors.

Any obvious idea about how to solve the issue?

Issue below solved by using more older version with cargo install --version 0.2.13 versatiles instead of the current 0.2.14 because of fix on server side e.g https://github.com/versatiles-org/versatiles/commit/bba05ade7be1fb6a1f989229a947857b7921ddd1

Unfortunately, then, got another issue with error on client due to gzip with error {message: 'Unimplemented type: 3'}.

The other issue: whereas versatiles probe pays-de-la-loire-shortbread.versatiles was mentioning tile_precompression: Uncompressed but if doing

curl "http://localhost:8080/tiles/pays-de-la-loire-shortbread/14/8121/5749" | file -

it returns /dev/stdin: gzip compressed data, from Unix a compressed tiled "uncompressed"...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment