Repository navigation
Build PROJ into the static render; version 0.300.0 - #3
Merged
Merged
Conversation
Adds reprojection: a Map can now use any EPSG code or proj string, e.g. a Minnesota map in UTM 15N or a US map in Albers instead of plain lon/lat. PROJ 9.9.0 is built from source on every platform, with libtiff and libcurl off: Alpine's and Homebrew's builds pull both in (plus OpenSSL behind curl) only to read and download datum-shift grids. Without grids a transformation that wants one uses PROJ's ballpark fallback, about a metre between WGS84 and NAD83. A static PROJ embeds proj.db in the library, and USE_ONLY_EMBEDDED_RESOURCE_FILES keeps it from reading one off disk, so there is no data directory to ship. With PROJ linked, mapnik classifies '+proj=longlat' exactly as the dynamic build does, so the projection.cpp patch that faked that is gone. Existing lon/lat styles are unchanged: scale_denominator 1.92857 and md5 d48d0556925e17e872d0ac25229319d2, same as v0.1.0, on both platforms. Build notes: PROJ needs C enabled; mapnik wraps PROJ_INCLUDE_DIRS in $<BUILD_INTERFACE:>, so the config shim passes a single path (a list splits the genex and leaks a source path into mapnik's export). New test render_relations_projected draws the fixture in EPSG:28992 and fails on a blank image (a misprojection still exits 0). The release smoke test runs it on a bare alpine image with no proj.db anywhere. Verified: linux-musl and macOS produce byte-identical projected output (md5 6889ae8e478fcbf382bcbca4068c2a14), and with 0 proj.db files on disk. Size: linux 16.5 -> 31.5 MB (tarball 10.4 -> 14.6), macOS 44 -> 58 MB (21 -> 25). NOTICE now lists PROJ (MIT), SQLite (public domain) and nlohmann/json (MIT). Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Matches the osmflat-rs versioning. release.yml requires the tag to equal project(... VERSION), so this release is tagged v0.300.0. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
A Docker Hub connection reset while pulling alpine:3.22 failed the
x86_64 static-render job before any build ran ('read: connection reset
by peer'). Pull up front with backoff (5 attempts, 10-50s) so a flaky
registry doesn't fail a job; the build and smoke-test docker runs then
use the local image. Same step in release.yml, where a flake would
otherwise fail a tagged release.
Also fixes release.yml's header, which still said linux/musl only.
Co-Authored-By: Claude Opus 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.
Adds reprojection to the static
render: a Map can now use any EPSG code or proj string — a Minnesota map in UTM 15N, a US map in Albers — instead of only plain lon/lat.How
PROJ 9.9.0 is built from source on every platform with libtiff and libcurl off. Alpine's and Homebrew's PROJ both pull those in (and OpenSSL behind curl) purely to read and download datum-shift grids. Without grids, a transformation that wants one uses PROJ's ballpark fallback — about a metre between WGS84 and NAD83, invisible at map scale.
A static PROJ embeds
proj.dbin the library (EMBED_RESOURCE_FILES, default ON for static builds), andUSE_ONLY_EMBEDDED_RESOURCE_FILESstops it reading one off disk. So there's no data directory to ship, and behavior doesn't depend on the host.With PROJ linked, mapnik classifies
+proj=longlatexactly as the dynamic build does — so theprojection.cpppatch is gone, one fewer edit to mapnik.Verified locally (aarch64 linux-musl in podman, arm64 macOS)
render_relations_projected(new) draws the fixture in EPSG:28992 and fails on a blank image, since a misprojected render still exits 0. Passes on both platforms.alpine:3.22with zeroproj.dbfiles on disk, the unpacked archive renders the projected style correctly — the EPSG lookup can only have come from the embedded database. macOS also renders it with an empty environment.6889ae8e478fcbf382bcbca4068c2a14), and visually correct: the same Baarle boundaries in true proportions rather than lon/lat's east–west stretch.scale_denominator=1.92857and md5d48d0556925e17e872d0ac25229319d2on both platforms, identical to v0.1.0.Costs
Plus PROJ's ~250 TUs on a cold build; the CI cache covers repeat runs. The cache key includes
cmake/**, so this PR starts a fresh (cold) cache lineage.Licensing
PROJ (MIT), SQLite (public domain) and nlohmann/json (MIT, bundled by PROJ) — all compatible.
NOTICEupdated.Build notes
PROJ_INCLUDE_DIRSin$<BUILD_INTERFACE:...>; a list splits the genex and leaks a source path into mapnik'sinstall(EXPORT), so the config shim passes a single path.proj.db.Version
Bumps the project to 0.300.0 (from 0.1.0), matching the osmflat-rs versioning.
release.ymlrequires the tag to equalproject(... VERSION), so this release isv0.300.0.Regex needed no work: Boost.Regex with ICU was already in, and
.match()/.replace()filters work in v0.1.0.🤖 Generated with Claude Code