Repository navigation
fix: cap index cells and make transform work without an index - #25
Merged
Merged
Conversation
countIndexCells counts the cells an index would hold without building it. The tests fail until addIndexedTin and transform use it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Crafted data with triangles spanning the whole extent made building the grid index quadratic in the triangle count. Skip the index when the cell count exceeds 36 per triangle on average; real maps stay near 9. transform() threw a TypeError whenever no index existed, which also hit every map of four triangles or fewer. It now falls back to the linear search that transformArr already has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
kochizufan
marked this pull request as ready for review
October 30, 2026 19:26
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.
変更
addIndexedTin: 索引のセル数が三角形 1 つあたり平均 36 を超えるデータは索引を作らない。全体を覆う三角形ばかりの細工されたデータでも、索引づくりが三角形の数の 2 乗にならないtransform: 索引が無いときにTypeErrorで落ちていたのを直し、全三角形の線形探索へ進むようにした。三角形が 4 つ以下の地図もこの道を通るcountIndexCellsとMAX_INDEX_CELLS_PER_TRIANGLEをsrc/geometry.tsに追加(パッケージの公開 API には足していない)影響
Compiled・CompiledLegacyの形は変えていない確かめたこと
tests/indexed-tin-limit.test.ts: 修正前の commit で 7 件が失敗し、修正後に全件が通るvitest run3882 件・typecheck・eslint が通る🤖 Generated with Claude Code