Replace offline basemap pipeline with Planetiler, unify online/offline styling
Offline tiles were built from Protomaps' own basemap schema, needing a completely separate hand-tuned theme (protomaps-themes-base + OFFLINE_THEME) from the online Liberty style's ONLINE_STYLE_PATCH — the two could never be made to match exactly no matter how much either side got tuned (today's session found and fixed several mismatches: building opacity, park boundaries, road casings, road widths). Offline.pmtiles is now built with Planetiler's default OpenMapTiles profile against Geofabrik per-country OSM extracts (osmium-merged when more than one country is selected), the same vector schema Liberty already expects. offlineStyle() now clones the same Liberty JSON (vendored as a local snapshot for reliability with no internet) and applies the identical ONLINE_STYLE_PATCH, just repointed at local PMTiles/glyphs/sprite — one palette instead of two, correct on both sides by construction. Also vendors Liberty's icon sprite for the first time (offline had none before), adds Java/osmium-tool/planetiler.jar to the Docker image, and removes the now-unused protomaps-themes-base dependency and the theme-comparison debug page that found today's bugs.
This commit is contained in:
1 parent
0874e8f8ed
commit
d08ed41185
21 files changed
+4286
-512
No files matched your search
+17
-3
@@ -3,9 +3,14 @@ FROM ruby:4.0.6-slim-bookworm
|
||||
# build-essential: puma has a native (C) extension; harmless if the
|
||||
# platform-specific gem in Gemfile.lock already has a precompiled binary
|
||||
# matching this base image, but keeps the build working if it doesn't.
|
||||
# ca-certificates/curl: needed for the go-pmtiles download below (also
|
||||
# handy for anyone debugging inside a running container).
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y build-essential ca-certificates curl \
|
||||
# ca-certificates/curl: needed for the go-pmtiles/planetiler.jar downloads
|
||||
# below (also handy for anyone debugging inside a running container).
|
||||
# default-jre-headless: Planetiler is a JVM tool (see PLANETILER_VERSION
|
||||
# below) — headless since this never touches a display.
|
||||
# osmium-tool: merges multiple countries' OSM extracts into one file before
|
||||
# handing them to Planetiler (lib/maptool/pmtiles_builder.rb) — a normal
|
||||
# Debian package, no separate download/pinning needed like the other two.
|
||||
RUN apt-get update && apt-get install --no-install-recommends -y build-essential ca-certificates curl default-jre-headless osmium-tool \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# The `pmtiles` CLI (lib/maptool/pmtiles_builder.rb's "Regenerate for
|
||||
@@ -26,6 +31,15 @@ RUN set -eux; \
|
||||
curl -fsSL "https://github.com/protomaps/go-pmtiles/releases/download/v${PMTILES_VERSION}/go-pmtiles_${PMTILES_VERSION}_Linux_${pmtiles_arch}.tar.gz" \
|
||||
| tar xz -C /usr/local/bin pmtiles
|
||||
|
||||
# Planetiler (lib/maptool/pmtiles_builder.rb's offline.pmtiles build,
|
||||
# replacing an earlier Protomaps-CDN-based pipeline — see
|
||||
# docs/development.adoc) — a single JVM fat jar, no per-arch variant needed
|
||||
# unlike go-pmtiles above. Default PLANETILER_JAR path (pmtiles_builder.rb)
|
||||
# expects it here.
|
||||
ARG PLANETILER_VERSION=0.10.2
|
||||
RUN curl -fsSL "https://github.com/onthegomap/planetiler/releases/download/v${PLANETILER_VERSION}/planetiler.jar" \
|
||||
-o /usr/local/lib/planetiler.jar
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
COPY Gemfile Gemfile.lock ./
|
||||
|
||||
Reference in new issue
Block a user