zskarte / zskarte-client

Zivilschutz-Karte allows to draw situation maps for disaster management
https://www.zskarte.ch/
MIT License
13 stars 7 forks source link

Improve local map handling #422

Closed jon4hz closed 1 month ago

jon4hz commented 6 months ago

Hi,

This PR improves how the zskarte handles local map data:

In 87c0ec40561a5d07754707f587ff3c0ace7ff925 I've added the devcontainer.json which I used so I can work using github codespaces. If you don't want this in your codebase, let me know and I'll remove it.

swerder commented 6 months ago

I like this change, something I do not have to implement for my own. ;-)

General information for the ones they want to use the upload function. The "local" tiles used here are from swisstopo: https://api3.geo.admin.ch/services/sdiservices.html#gettilesets https://www.geo.admin.ch/en/vector-tiles-service-available-services-and-data The variant ch.swisstopo.leichte-basiskarte.vt.mbtiles is used.

The tiles from swisstopo are in mbtiles format (an SQLite db file). To get "own" corresponding pmtiles file you need to download and convert it:

PS: it would also be possible to limit the range converted if file size is an issue for you, see pmtiles documentation https://github.com/protomaps/go-pmtiles/

jon4hz commented 6 months ago

Thanks a lot for the instructions on how to build the .pmtiles, I was already wondering how you got them :)

In case anyone wants to test this without building the pmtiles themselves, they can download the file here: https://zskarte.blob.core.windows.net/etienne/ch.swisstopo.pmtiles

That's the url hardcoded in the source code here.