Repository navigation
Conversation
Bloaty Results 🐋Compared to main Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4426-compared-to-main.txtCompared to d387090 (legacy) Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/bloaty-results/pr-4426-compared-to-legacy.txt |
|
Benchmark Results ⚡ Full report: https://maplibre-native.s3.eu-central-1.amazonaws.com/benchmark-results/pr-4426-compared-to-main.txt |
|
@copilot The test is failing. Debug it. |
The mapnik/polylabel fork added an early-out: when min(width,height) <= precision, it returns envelope.min instead of computing the true pole of inaccessibility. With the default precision of 1.0 degree, a 1x1 degree polygon triggered this early-out, returning (100,0) instead of (100.5,0.5). Fix by passing precision=1e-4 (approximately 10m) in MLNPolygon.mm, which is appropriate for geographic coordinates. Also removes the unused <mapbox/polylabel.hpp> include from MLNPolyline.mm. Co-authored-by: louwers <649392+louwers@users.noreply.github.com>
The failing tests were Root cause: the mapnik/polylabel fork added an early-out for "sub-precision polygons" — when Fix (committed in the latest push):
|
|
@copilot Please fix ios-build CI |
…ement The new mapnik/polylabel correctly computes the pole of inaccessibility for polygons with holes, placing it in a corner rather than at the centre (which lies inside the hole). The old test put a polygon-with-hole first in the MLNMultiPolygon, so MLNMultiPolygon.coordinate was taken from a polygon whose true pole is NOT the square's centre. Fix: swap the polygon order so the hole-free innerPolygonSquare is first. Its pole of inaccessibility is exactly (100.5, 0.5) — the centre of the 0.3×0.3 square — which matches the existing assertion. Co-authored-by: louwers <649392+louwers@users.noreply.github.com>
Fixed. The remaining failure was in Fix: swap the polygon order so the hole-free |
mapbox/polylabeldeleted its C++ implementation in mapbox/polylabel#124.mapnik/polylabelis the maintained fork that restores and improves the C++ port (v2.1.0 algorithmic improvements: clamped cell sizes, flattened coordinate buffers, block-based bbox skipping, aggressive queue pruning).Changes
.gitmodules— point submodule URL tohttps://github.com/mapnik/polylabel.gitvendor/polylabel— update submodule ref from6ed5f1a(mapbox 1.1.0) to1edc167(mapnik latest)vendor/polylabel.cmake— updateINTERFACE_MAPLIBRE_URLandINTERFACE_MAPLIBRE_AUTHORto reflect the new forkNo source changes needed — the fork preserves the same include path (
<mapbox/polylabel.hpp>), namespace (mapbox::polylabel), and function signature, adding only an optionaldistanceoutput parameter.