Repository navigation
Conversation
Band rectangles now extend half a cell beyond their outermost sample centers, and iteration and merging include every row and column. A regression test checks that a uniform 2×2 grid merges into one closed rectangle with the expected half-cell bounds. Fixes meshtastic#7752
Walkthrough
Priority: Severity of issue fixed: Medium Merge Risk:
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: meshtastic/Meshtastic-Android
- Branch: main
- File: .coderabbit.yaml
- Commit: 48cd688
- Layers: Repository YAML
- Review profile: CHILL
- Plan: Advanced
- Run ID:
43897621-5f2e-4a76-a4a4-dffe7d4c7f05
Files selected for processing: 2-
feature/coverage/src/commonMain/kotlin/org/meshtastic/feature/coverage/CoverageContours.ktfeature/coverage/src/commonTest/kotlin/org/meshtastic/feature/coverage/CoverageContoursTest.kt
Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 3 remain after this review.
-
| lonAt(runEnd + 1.0) to latAt(runBottom + 1.0), | ||
| lonAt(x.toDouble()) to latAt(runBottom + 1.0), | ||
| lonAt(x.toDouble()) to latAt(y.toDouble()), | ||
| lonAt(x - HALF_CELL) to latAt(y - HALF_CELL), |
There was a problem hiding this comment.
Reject one-row and one-column grids before generating rings.
A CoverageGrid with width = 1 or height = 1 passes its constructor check. The new full-grid scan now reaches this coordinate conversion. lonAt() or latAt() then divides by zero, and toGeoJson() emits invalid, non-finite coordinates. Require both dimensions to be at least two in CoverageGrid, or handle degenerate grids before building rings. (github.com)
|
Picked up in #7758 with the rest of the coverage stack - your commit is cherry-picked there as-is. |
Thank you for sending in a pull request. Some tips to get started
Coverage bands appear half a grid cell southeast of the terrain that shaped the estimate. Samples in the last row and column are omitted from the overlay. CoverageGrid.bands treated each sample as the northwest corner of its rectangle instead of its center. Its iteration and merging bounds also excluded the final row and column.
Band rectangles now extend half a cell beyond their outermost sample centers, and iteration and merging include every row and column. A regression test checks that a uniform 2×2 grid merges into one closed rectangle with the expected half-cell bounds.
Ran
./gradlew testlocally on macOS for the Meshtastic-Android change; it passed../gradlew testcompleted successfully; the transcript does not show whether the new coverage regression test ran.Fixes #7752
AI was used for assistance.
Summary by CodeRabbit