Skip to content

Latest commit

 

History

History
100 lines (70 loc) · 2.37 KB

README.md

File metadata and controls

100 lines (70 loc) · 2.37 KB

Repository with different mbtiles stuff

Docker in dev

docker run \
  --rm \
  -p 3000:3000 \
  -v "$(pwd)/data-mbtiles":/data-mbtiles \
  ghcr.io/maplibre/martin /data-mbtiles

Running docker in prod

bash ./run_martin.sh

Nginx config

sudo vim /etc/nginx/sites-enabled/default

https://maplibre.org/martin/run-with-nginx.html#rewriting-urls

PBF files are cached for 1h

location ~ /mbtiles/v2/(?<fwd_path>.*) {
    proxy_set_header  X-Rewrite-URL $uri;
    proxy_set_header  X-Forwarded-Host $host:$server_port;
    proxy_set_header  X-Forwarded-Proto $scheme;
    proxy_redirect    off;

    proxy_pass        http://127.0.0.1:3000/$fwd_path$is_args$args;
}

location ~ /mbtiles/v2/(?<fwd_path>.pbf) {
    proxy_set_header  X-Rewrite-URL $uri;
    proxy_set_header  X-Forwarded-Host $host:$server_port;
    proxy_set_header  X-Forwarded-Proto $scheme;
    proxy_redirect    off;
    add_header Cache-Control "public, max-age=3600";

    proxy_pass        http://127.0.0.1:3000/$fwd_path$is_args$args;
}
sudo systemctl restart nginx

Data

  • Poland booking.com hotels

    • data exported from booking.com
    • converted to mbtiles using tippecanoe
  • Zanocuj w lesie

    npm run zanocuj-w-lese:geojson

  - convert to mbtiles using tippecanoe

  ```bash
  npm run zanocuj-w-lese:mbtiles
  • Poland parks
    • velomapa.pl/mapy/parki
    • data extracted from osm
    • converted to geojson with travelermap.net scripts
    • converted to mbtiles using tippecanoe

Tippecanoe

https://github.com/felt/tippecanoe

tippecanoe -o data-mbtiles/zanocuj-w-lesie.mbtiles data-geojson/zanocuj-w-lesie.geojson --force

poland_bookingcom_hotels

https://github.com/felt/tippecanoe?tab=readme-ov-file#clustered-points-world-cities-summing-the-clustered-population-visible-at-all-zoom-levels](https://github.com/felt/tippecanoe?tab=readme-ov-file#clustered-points-world-cities-summing-the-clustered-population-visible-at-all-zoom-levels)

tippecanoe -z14 -o data-mbtiles/poland_bookingcom_hotels.mbtiles -r1 --cluster-distance=20 --cluster-maxzoom=13 data-geojson/poland_bookingcom_hotels.geojson --force