Repository navigation
Interpolate the closing edge of polygons, geodesic or not - #14
Merged
Merged
Conversation
The geodesic ring was densified with createInterpolatePoints, which only interpolates between neighbouring points, so the closing edge (last vertex -> first) of a geodesic polygon was a straight chord in both fill and outline. Use android-sdk-core's densifyGeodesicRing. geodesic=false is unchanged. Requires the android-sdk-core release that adds densifyGeodesicRing.
A geodesic=false polygon passed its raw vertices to TomTom, so every edge was a straight Web Mercator segment, unlike polylines with geodesic=false (linear lat/lng interpolation) and the other providers. Use android-sdk-core's densifyPolygonRing for both modes; it closes the ring before densifying, so the closing edge (last vertex -> first) matches the others (it replaces the unreleased densifyGeodesicRing). The linear case uses 200 km segments rather than the core's 10 km: raw vertices were used because a world-mask ring densified every 10 km made TomTom fail to draw it. A lat/lng line still bends smoothly at 200 km. Requires the android-sdk-core release that adds densifyPolygonRing.
This was referenced Nov 8, 2026
Merged
Merged
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.
なぜ
ポリゴンの点は開いたリング(末尾 ≠ 先頭)で渡されます。
WGS84Geodesic.createInterpolatePointsもPlanar.createInterpolatePointsも隣り合う点の間しか補間しないので、そのまま渡すと閉じる辺(末尾 → 先頭)だけが補間されず、描画側で閉じたときに 1 本の直線(弦)になっていました。一方、輪郭はリングを閉じてからポリラインとして密度化するので、閉じる辺も他の辺と同じ形になります。Boston (42.36N, 71.06W) → London (51.5N, 0.12W) → Iceland (64.1N, 21.9W) の三角形(閉じる辺は Iceland → Boston)での数値:
どの補間を正とするか(geodesic=false)
ポリラインの geodesic=false(全プロバイダで緯度経度の線形補間)と、既に閉じてから密度化している web の ArcGIS に合わせ、閉じる辺も含めて緯度経度で線形補間する方に統一しました。「密度化しない(メルカトルの直線)」に寄せると、ポリラインの false と形が変わり、ArcGIS・Cesium のように辺を測地線でつなぐ SDK では直線を表せないためです。
何を変えたか
densifyPolygonRingで閉じる辺まで密度化します。関連 PR(同じ修正の一式)
fix/geodesic-polygon-fillは次の 16 リポジトリにまたがります。1. core(3 本は互いに独立。先にマージ・公開してください)
core だけで直るプロバイダ(共通パイプライン
buildPolygonRings/buildUnwrappedPolygonRingsを使うもの)には PR がありません: Android の MapLibre / Mapbox / Mappls / MapTiler / Longdo / OpenMobileMaps、iOS の MapLibre / Mapbox / Mappls / MapTiler / OpenMobileMaps、web の MapLibre / Mapbox / Mappls / MapTiler / TomTom / Longdo / Leaflet / OpenLayers / Azure Maps / deck.gl / MapKit JS / ArcGIS。2. Android プロバイダ(android-sdk-core の公開後。
densifyPolygonRingを使うのでそれまでビルドできません。ArcGIS だけは core に依存しません)3. iOS プロバイダ(ios-sdk-core の公開後。ArcGIS だけは core に依存しません)
4. web プロバイダ(js-sdk-core の新しい版を npm に公開し、依存(今は
^0.3.1)を引き上げてから。npm の公開はまだ行いません)マージの順番: core 3 本 → core の公開 → Android / iOS プロバイダ → js-sdk-core の npm 公開と依存の引き上げ → web プロバイダ。
見た目が変わるもの: ArcGIS(Android / iOS)の geodesic=false の閉じる辺は、以前は補間されず ArcGIS が測地線として描いていましたが、他の辺と同じ緯度経度の線形補間になります(web の react-for-arcgis と同じ形で、3 プラットフォームがそろう方向。承認済み)。ほかのプロバイダも geodesic=false の閉じる辺がわずかに曲がるようになります。
検証
apiCheck通過。確認できていないもの
他の PR との関係
git merge-treeで衝突なし。