Skip to content

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

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

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

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

  • 親(monorepo)の feat/polygon-tiling は、ポリゴンのサンプル(feat/polygons: Polygons ページ、ボストンの建物・区画)に develop を merge し、gitlink を js-sdk-core と各 react-for-* の feat/polygon-tiling に向けたものです(タイル化の無い submodule は develop の gitlink のまま)。
  • js-sdk-react はタイル化の変更が無いので develop のままです。

develop の取り込み

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

  • CI 相当(npm ci → core/react の build → npm test → npm run lint)を親 react-sdk の feat/polygon-tiling で実行: テスト 625 件 pass、lint ok。node scripts/api-surface.mjs check: ok(増えた公開 API はベースラインに追加。削除なし)。
  • Playwright(Chromium)でボストンの区画・建物を MapLibre / Google Maps / Mapbox / MapTiler / Leaflet で表示: タイルで描かれ、街区(穴)が正しく抜け、タップで InfoBubble が出ることを確認。Polygon ページの頂点ドラッグで MapLibre / Google / Mapbox のポリゴンが追従。

マージの順番

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

  • react-for-* は js-sdk-core の PolygonTiler / OverlayStacking を使うので、js-sdk-core が先です。
  • npm 版の react-for-* が動くには js-sdk-core の npm 公開が前提です。npm 公開はまだしていません。 親(monorepo)の中ではワークスペースで解決されるので、公開しなくても動きます。

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

先にマージが要る submodule の PR

688 building footprints of central Boston (about 0.8 x 1.1 km) from the
Overture Maps buildings theme (release 2026-10-21.0, ODbL), coloured by
height. The grid lays the block out 2 x 2 or 4 x 4 times (up to 11,008
polygons, 119,776 vertices) for load testing; ?camera= and ?grid= fix the
view for measurements.
… a tap hit

Replaces the tiled copies with the real Overture buildings of 0.8 x 1.1,
1.6 x 2.2 and 3.2 x 4.4 km around Downtown Crossing (605 / 2,827 / 9,467
polygons), so every polygon sits on the building it outlines. A tap
highlights the building and shows its name, height and id; a tap that
misses says so. ?area= replaces ?grid=.
The data files (public/boston/full/*.bin) are not committed; they are built
from Overture and Analyze Boston Parcels 2025.
Parcels are joined (99.6%) with the City of Boston FY2026 Property
Assessment on GIS_ID and coloured by its land use code, grouped into eight
classes with a legend; only the code is taken from the assessment. While a
dataset loads, an overlay over the map says how far it has got: the download
with a progress bar, then reading, preparing and drawing.
A parcel shows its id and land use, a building its name, height and Overture
id, both their vertex and hole counts. Tapping the map elsewhere closes it.
react-for-arcgis, -azuremaps, -cesium, -deckgl, -googlemaps, -here,
-leaflet, -mapkit and -openlayers draw large polygon sets as raster tiles
(PolygonTiler); arcgis, azuremaps, cesium, here and mapkit also show
marker tiles with upsert / removeById. The Boston pages already ran
against these commits, but the parent never recorded them.
Branched from feat/polygons (the Boston sample and the Polygons page). Points js-sdk-core and every react-for-* that tiles polygons at its feat/polygon-tiling, each with develop merged in (hole union, overlay stacking, clear order, geodesic fill, marker drag click fix).
@wf9a5m75
wf9a5m75 merged commit de88aab into develop Nov 9, 2026
3 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