Repository navigation
Add vector tiles based map uploader (prototype) - #22
Merged
Merged
Conversation
The new command publishes a vector tiles based map into cinode: * index.html - MapLibre GL JS based viewer with rotate buttons, * style.json - OpenMapTiles schema style derived from OSM Bright with OSM Carto-like colors, road widths and house numbers, * tiles - pre-generated vector tiles (e.g. from Planetiler) taken from one or more directories, later directories override earlier ones so that detailed regions can be layered over a low-zoom world map, * optional assets directory (MapLibre build, fonts, sprites), fetched with toolbox/fetch-vector-assets.sh. Regions may have different max zoom levels: missing tiles are rendered by the viewer from the closest existing ancestor tile (overzoom.mjs), tiles/coverage.json lists per-zoom bounding rectangles of existing tiles so that non-existing ones are not probed. Like maps-tile-uploader it is configured through environment variables. The writer info can be kept in a file (CINODE_MAPTILES_WRITERINFO_FILE), a new link is created and saved there when the file doesn't exist, and the map entrypoint can be saved after the upload (CINODE_MAPTILES_ENTRYPOINT_FILE), so that consecutive runs update the same map without passing secrets around. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* maps-vector-uploader - the uploader with viewer assets bundled at
build time (CINODE_VECTOR_ASSETS_DIR points to them by default),
* maps-vector-generator - the whole vector map pipeline in one image:
Planetiler (the base image), osmium, the uploader with assets and
scripts run as a plain sequence of commands:
- prepare-osm-extract downloads extracts and polygons of regions (with
retries) and merges them with osmium, skipping the merge when
nothing has changed; tiles along borders of neighbouring regions
then contain data of all of them,
- generate-vector-tiles runs Planetiler for a local extract.
The generator is built for linux/amd64 and linux/arm64 only since those
are the only platforms of the Planetiler image.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
All current resources belong to the raster map pipeline and are only rendered with mapType=raster (the default, so existing deployments are not affected). PostgreSQL is now an optional dependency (postgres.enabled) since the vector map doesn't need it; the chart fails with a clear message if it's left enabled for the vector map. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With mapType=vector the chart runs a single CronJob whose container (maps-vector-generator image) runs the steps one after another: downloads and merges extracts of enabled regions (pbf + poly), generates low zoom world tiles and then tiles of all regions at once limited to their polygons, and uploads them with maps-vector-uploader. Downloaded data, generated tiles, the default local datastore and the map link live on a persistent data volume which is kept when the release is removed, so consecutive runs only fetch newer extracts and update the same map. The datastore and writer info can also be given as values or existing secrets like for the raster map. An optional viewer (cinode web proxy) serves the map from the datastore once the first upload is done, exposed with a service and optionally an ingress. The new image is included in the release script. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
minikube-test.sh takes a preset (raster, vector-luxembourg, vector-poland, vector-border), starts minikube when needed, builds images with the local docker and loads them into minikube (works with any minikube container runtime), deploys the chart and for vector maps starts the generation right away. minikube-view.sh follows the vector map generation and serves the map once the first upload is done, restarting port forwarding when it drops; ADDRESS=0.0.0.0 makes it reachable from other devices in the local network. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Prototype of a vector tiles based Cinode map, as an alternative to the PNG tiles pipeline:
maps-vector-uploader(cmd/maps-vector-uploader,pkg/vectormap) – publishes into cinode:index.html– MapLibre GL JS viewer,style.json– map style (OSM Bright, OpenMapTiles schema),tiles/{z}/{x}/{y}.pbf– pre-generated, uncompressed vector tiles (e.g. from Planetiler) from one or more directories; later directories override earlier ones, so detailed regions can be layered over a low-zoom world map,Configured through env variables like
maps-tile-uploader:CINODE_DATASTORE,CINODE_MAPTILES_WRITERINFO/CINODE_MAPTILES_NEW_WRITERINFO,CINODE_VECTOR_TILES_DIRS,CINODE_VECTOR_ASSETS_DIR,CINODE_VECTOR_PARALLELISM. Tiles are uploaded in parallel; the tiles directory is reset first so the result is a snapshot of the sources, unchanged tiles produce the same blobs.Client-side over-zoom +
tiles/coverage.json– regions can have different max zoom. Missing tiles are rendered from the closest existing ancestor (overzoom.mjs, a MapLibre protocol clipping and rescaling the ancestor tile).coverage.jsonholds per-zoom bounding rectangles of existing tiles (one per source directory) so the viewer doesn't probe for missing tiles; it stays small regardless of tile count.Docker image, assets script, docs –
Dockerfile.maps-vector-uploader+ images workflow entry,toolbox/fetch-vector-assets.sh, README section on generating tiles with Planetiler and uploading them.Why
PNG tiles are large, bake in the style and are limited in max zoom. Vector tiles are much smaller, styled on the client, and over-zoom well beyond the generated max zoom.
Testing
go mod tidy -diff, build, vet, tests (incl.-race) and golangci-lint (0 issues).web_proxy; viewer, style, tiles andcoverage.jsonserved with correct content types, z13 and over-zoomed z10 rendered correctly in Chrome.Notes for reviewers
maps-tile-uploader(cross-compiled locally forarm/v6andriscv64); the Docker build itself wasn't run locally.release-chart-version.shdon't use the new image yet.fetch-vector-assets.shwas only syntax-checked (no shellcheck available locally).🤖 Generated with Claude Code