Skip to content

fix(tiling): fall back to a smaller margin instead of dropping tiles#61

Open
EliHei2 wants to merge 1 commit into
mainfrom
bugfix/tiling-margin-fallback
Open

fix(tiling): fall back to a smaller margin instead of dropping tiles#61
EliHei2 wants to merge 1 commit into
mainfrom
bugfix/tiling-margin-fallback

Conversation

@EliHei2
Copy link
Copy Markdown
Collaborator

@EliHei2 EliHei2 commented Jun 1, 2026

When the inner-tile negative buffer uses too large a margin, small tiles shrink to empty. Previously those tiles were removed from the spatial query, silently dropping every geometry they contained (a frequent cause of large numbers of unassigned transcripts on dense/small-tile datasets).

Instead, progressively halve the margin (down to 0) until every tile survives the buffer, emitting a warning with the reduced value. No behavior change when the requested margin already leaves all tiles non-empty.

What to review:

  • src/segger/data/tiling.py: the buffer/fallback loop in the query method.
  • The loop is bounded (margin strictly halves; terminates at 0 = unbuffered tiles, which can never be empty), so it cannot spin.
  • Trade-off: a reduced margin means slightly less inner/outer separation for the affected tiles, which is strictly better than dropping their geometries.

When the inner-tile negative buffer uses too large a margin, small tiles shrink
to empty. Previously those tiles were removed from the spatial query, silently
dropping every geometry they contained (a frequent cause of large numbers of
unassigned transcripts on dense/small-tile datasets).

Instead, progressively halve the margin (down to 0) until every tile survives
the buffer, emitting a warning with the reduced value. No behavior change when
the requested margin already leaves all tiles non-empty.

What to review:
- src/segger/data/tiling.py: the buffer/fallback loop in the query method.
- The loop is bounded (margin strictly halves; terminates at 0 = unbuffered
  tiles, which can never be empty), so it cannot spin.
- Trade-off: a reduced margin means slightly less inner/outer separation for the
  affected tiles, which is strictly better than dropping their geometries.
@EliHei2 EliHei2 requested a review from Tobiaspk June 1, 2026 13:08
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