Skip to content

Remove the unused KDTree and HexCellRegistry - #19

Merged
wf9a5m75 merged 1 commit into
developfrom
chore/remove-kdtree
Nov 5, 2026
Merged

wf9a5m75 merged 1 commit into
developfrom
chore/remove-kdtree

Conversation

@wf9a5m75

@wf9a5m75 wf9a5m75 commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

削除するもの

使われていない hex セル索引と K-D 木を android-sdk-core から削除します。公開 API の破壊的変更です(公開クラスと公開メソッドの削除)。

  • com.mapconductor.core.geocell.KDTree(と KDTreeStats)
  • com.mapconductor.core.geocell.HexCellRegistry(と RegistryStats)
  • com.mapconductor.core.geocell.HexCellWithDistance(上記 2 つの戻り値専用)
  • MarkerManager.findByIdPrefix(prefix)
  • MarkerManager 内の cellRegistry / ensureCellRegistry と、メモリ見積もりのうち hex 索引分
  • テスト HexCellRegistryRebuildTest / KDTreeRadiusTest、ドキュメント docs/geocell/HexCellRegistry.kt.md / docs/geocell/KDTree.kt.md

HexGeocell / HexCell / HexGeocellInterface は残します(MarkerManager などがコンストラクタで geocell を受け取るため)。docs/marker/MarkerManager.kt.md と MarkerGridIndex の KDoc は、削除したコードを説明しないように直しました。

同じ削除を ios-sdk-core と js-sdk-core でも行っています。

理由

928e7c3(Index markers on a flat grid, not hex cells and a kd-tree)で MarkerManager の空間検索は MarkerGridIndex に移りました。それ以降 HexCellRegistry を作るのは MarkerManager.findByIdPrefix だけで、その呼び出し元はどこにもありません(SDK の各モジュール、サンプル、ドキュメントすべてを確認済み)。KDTree は HexCellRegistry からしか使われていません。

確認

  • ./gradlew testDebugUnitTest: 286 件すべて成功(削除したテスト 6 件を除いた数)
  • apiCheck: 成功。api/android-sdk-core.api は親リポジトリの gradle/api-surface.gradle.kts と同じ手順で apiDump し直したもので、差分は上記クラスと findByIdPrefix の削除のみ(追加なし)
  • ktlint(runKtlintCheckOverMainSourceSet): 変更したファイルに新しい違反なし(MarkerManager.kt の 3 件は develop にもある既存のもの)
  • grep: /Users/masashi/mapconductor 全体(build / node_modules / .build / dist を除く)で KDTree / KDTreeStats / HexCellRegistry / RegistryStats / HexCellWithDistance / findByIdPrefix を検索し、android-sdk-core 以外(他の android-sdk モジュール、サンプル、ドキュメント)にヒットなし

928e7c3 moved MarkerManager's spatial search onto MarkerGridIndex. Since
then the hex-cell registry was only built on demand by findByIdPrefix,
which nothing calls: no SDK module, sample or doc uses it. KDTree existed
only to serve the registry, and HexCellWithDistance only to carry their
results.

Remove all of them, the lazy registry plumbing in MarkerManager, and the
registry's share of the memory estimate, along with the tests and doc
pages that covered them. HexGeocell and HexCell stay; MarkerManager still
takes a geocell.

This removes public classes and a public method, so the API dump shrinks
accordingly.
@wf9a5m75
wf9a5m75 merged commit c0d9f27 into develop Nov 5, 2026
2 checks passed
@wf9a5m75
wf9a5m75 deleted the chore/remove-kdtree branch November 5, 2026 09:14
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