Skip to content

Draw large polygon sets as raster tiles, with the Boston sample - #118

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

wf9a5m75 merged 9 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 件)で確認しています。

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

  • 親の feat/polygon-tiling: ポリゴンのサンプル(Polygons ページ、ボストンの建物・区画)。develop を merge し、gitlink を core / compose(feat/polygons)/ 各プロバイダの新しい先頭に向けました(それまで gitlink は develop の commit のままでした)。

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 は大きな機能なので、マージするかはレビューのうえで判断してください。

先にマージが要る submodule の PR

A grid of hexagons registered with one Polygons(states) call, with buttons
to add and remove rows and to replace every state with a new fill.
The same Overture Maps extract as the React sample (central Boston, 688
buildings, ODbL), coloured by height, with 2 x 2 and 4 x 4 copies for load
testing. The camera and grid extras fix the view for measurements.
… a tap hit

Same data and behaviour as the React sample. Every tap is also logged under
BostonTap (seq, id, map-click position), which is how hit testing is checked
from outside. The area extra replaces grid.
About 100,000 polygons each, read from the app's external files directory
(too large for the APK; push them with adb, see BostonData.kt). Same binary
format as the React sample. `data` (downtown, buildings or parcels) joins
`camera` and `area` as an intent extra.
Same as the React sample: parcels coloured by land use with a legend (the
label is "<GIS_ID>|<land use>"), an overlay saying how far reading,
decoding, building the states and drawing have got, and the tapped
polygon's data in an InfoBubble at the tap, closed by tapping the map
elsewhere. The stats also give the time to the second frame after the list
reached Polygons().
Also points android-sdk-core, android-sdk-compose and the providers at
their feat/polygon-tiling (compose: feat/polygons), each with develop merged
in. Until now this branch's gitlinks still named develop's commits.
@wf9a5m75
wf9a5m75 merged commit 6a8bba1 into develop Nov 9, 2026
1 check passed
@wf9a5m75
wf9a5m75 deleted the feat/polygon-tiling branch November 9, 2026 16:52
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