Skip to content

Draw large polygon sets as raster tiles (PolygonTiler) - #15

Merged
wf9a5m75 merged 3 commits into
developfrom
feat/polygon-tiling
Nov 9, 2026
Merged

wf9a5m75 merged 3 commits into
developfrom
feat/polygon-tiling

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

何をするか

多数のポリゴン(既定: 2,000 個以上または頂点 50,000 以上)を、ネイティブの図形ではなくラスタータイルとして描きます(PolygonTilingOptions / PolygonTiler)。web・Android・iOS で同じ設計です。

  • タイルは SDK のタイルサーバー(web はサービスワーカー、ネイティブは LocalTileServer)で描きます。ズームごとに画素格子へ丸めて簡略化し、外周と穴の巻きを逆にそろえて nonzero で塗ります。
  • タップ判定は従来どおり PolygonManager が元の形で行います(InfoBubble などは今までどおり)。
  • タイルにできなくなった変更(geodesic にする、経度幅 180° 以上、3 点未満)が入ったポリゴンは、その場でネイティブ描画へ戻ります。
  • ボストン全域の区画(98,815 件・穴あり)と建物(105,599 件)で確認しています。

このリポジトリで変えたこと

  • ポリゴンタイル用に層の索引の区間(900〜999、GroundImage と塗りの間)を作りました。塗りの描き直しは develop の zIndex 順と、タイルで描くポリゴンを除く処理を両方入れました。

develop の取り込み

このブランチは push 済みだったので、rebase せず origin/develop を merge commit で取り込みました。

  • 親 android-sdk(feat/polygon-tiling)で core / compose / kml / geojson / icons と各プロバイダの testDebugUnitTest: core 350 件ほか全部 pass(OMM は develop から引き継いだ 1 件の失敗のみ。android.util.Log.isLoggable がテストでモックされていない)。apiCheck: 全モジュール ok(増えた API はベースラインに追加)。
  • タブレット実機(MapLibre / Google / Mapbox)でボストンの区画 98,815 件: タイルで描かれ、街区(穴)が正しく、タップで InfoBubble。重なり順は GroundImage < ポリゴンタイル < サークル < ポリライン < マーカー(MapLibre / Google)。MapLibre で頂点ドラッグの追従。Google ↔ MapLibre の切り替え 10 往復で Native Heap が頭打ち(89〜96 MB。スクラッチ Bitmap のプール化の前は 156 MB まで増え続けた)。

マージの順番

この機能は複数のリポジトリにまたがります。android-sdk-core → android-sdk-compose(feat/polygons)→ 各 android-for- → android-sdk(親)* の順にマージが要ります。

この PR は大きな機能なので、マージするかはレビューのうえで判断してください。

The polygon controller gets a PolygonTiler, whose tiles are shown through
the raster layer path the marker tiles use (upsert / removeById, outside
the app's RasterLayer composition). Tiled polygons stay registered for taps
and give the map SDK nothing.

The polygon renderer skips tiled entities, which have no native polygon.
The polygon fill redraw keeps develop's zIndex order and leaves out tiled
polygons. The polygon tiles get a layer index band of their own, between the
ground images and the polygon fill.
Additions only: the polygon tiles' stacking key, and declarations develop
added without running apiDump (TILE_REFRESH_COALESCE, and on ArcGIS the
marker controller's constructor that takes a boolean).
@wf9a5m75
wf9a5m75 merged commit 436c300 into develop Nov 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant