Add Burning Man native offline map pack#6330
Conversation
|
Warning Review limit reached
Next review available in: 30 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (15)
📝 WalkthroughWalkthroughAdds automatic Burning Man offline pack management, PMTiles downloading and validation, local vector-tile rendering for Google Maps and OSMdroid, and camera-aware map-layer switching with coverage-based offline precedence. ChangesBurning Man offline map
Estimated code review effort: 5 (Critical) | ~120 minutes Sequence Diagram(s)Pack installation and map renderingsequenceDiagram
participant MainActivity
participant BurningManPackRuntime
participant BurningManPackCoordinator
participant ProtomapsRegionDownloader
participant MapView
participant BurningManTileProvider
MainActivity->>BurningManPackRuntime: reconcile current time and location
BurningManPackRuntime->>BurningManPackCoordinator: reconcile pack state
BurningManPackCoordinator->>ProtomapsRegionDownloader: download region when policy selects Install
ProtomapsRegionDownloader-->>BurningManPackCoordinator: validated PMTiles file
BurningManPackCoordinator-->>MapView: selected pack state
MapView->>BurningManTileProvider: request covered camera tiles
BurningManTileProvider-->>MapView: rendered local tiles
🚥 Pre-merge checks | ✅ 4✅ Passed checks (4 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
@coderabbitai review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 3
🧹 Nitpick comments (2)
feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloader.kt (1)
289-295: 🚀 Performance & Scalability | 🔵 Trivial | ⚖️ Poor tradeoffReader loads the entire archive to inspect only the header + metadata.
FileInputStream(file).use { it.readBytes() }pulls the full multi-MB PMTiles pack into memory, yetinitonly needs the 127-byte header and the metadata slice. SincevalidatedSelection,install, anddownloadeach construct a reader, a z15 pack is fully re-read several times per reconcile. Consider reading just the header and the[metadataOffset, metadataOffset+metadataLength)window (e.g. viaRandomAccessFile).🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloader.kt` around lines 289 - 295, Update the reader initialization around parseHeader and parseMetadata to avoid loading the entire archive: read only the fixed PMTiles header bytes, parse it, then seek to header.metadataOffset and read header.metadataLength bytes for metadata. Preserve the existing header and metadata-range validation, and use bounded file access so repeated ProtomapsReader construction does not reread the full archive.androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt (1)
149-183: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy liftExtract the duplicated PMTiles/MVT stack into shared
src/main. Both providers carry a verbatim copy ofLocalPmtiles, the header/directory parsers,WireReader/VarintReader, thedecode*vector-tile functions, the geometry types, and thedrawAreaLayer/drawRoad/drawLine/fillCirclehelpers — only the provider class andrasterize's return type differ. This flavor-independent code (it depends only onandroid.graphics, not on osmdroid or Google Maps) will drift out of sync. Move it to a sharedandroidApp/src/mainlocation (internal), leaving each flavor with just its provider wrapper.
androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt#L149-L183: remove the local parser/decoder block and depend on the shared implementation.androidApp/src/google/kotlin/org/meshtastic/app/map/offline/BurningManGoogleTileProvider.kt#L131-L156: remove the mirrored parser/decoder block and depend on the shared implementation.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt` around lines 149 - 183, Extract the duplicated flavor-independent PMTiles/MVT implementation—including LocalPmtiles, parsers, readers, decode functions, geometry types, and drawing helpers—into shared internal code under androidApp/src/main, then update both provider wrappers to use it. Remove the duplicated implementation from androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt lines 149-183 and androidApp/src/google/kotlin/org/meshtastic/app/map/offline/BurningManGoogleTileProvider.kt lines 131-156; preserve each provider’s platform-specific wrapper and rasterize return type.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In
`@androidApp/src/google/kotlin/org/meshtastic/app/map/GoogleMapTileLayerSelection.kt`:
- Around line 19-35: Run ./gradlew spotlessApply and apply the resulting
formatting changes without altering behavior: reformat
GoogleMapTileLayerSelection.kt lines 19-35, the dense apply/expression bodies in
BurningManGoogleTileProvider.kt lines 64-69, and the long writeBytes call in
BurningManGoogleTileProviderTest.kt lines 84-85, then ensure spotlessKotlinCheck
passes.
In
`@feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/BurningManPackCoordinator.kt`:
- Around line 54-64: Run ./gradlew spotlessApply to format
BurningManPackCoordinator.kt, including load, install, validatedSelection, and
asManifest bodies. Restore the complete canonical license header in
BurningManPackRuntimeTest.kt. Also apply Spotless to BurningManPackPolicy.kt,
BurningManPackPolicyTest.kt, ProtomapsRegionDownloader.kt,
ProtomapsRegionDownloaderTest.kt, and BurningManPackCoordinatorTest.kt, then
ensure spotlessKotlinCheck passes.
In
`@feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloader.kt`:
- Around line 270-282: Configure explicit connect and read timeouts on the
HttpURLConnection created in fetch before requesting the response or reading its
stream. Use the existing project timeout constants or configuration if
available, and preserve the current range request, response handling, and
disconnect behavior.
---
Nitpick comments:
In
`@androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt`:
- Around line 149-183: Extract the duplicated flavor-independent PMTiles/MVT
implementation—including LocalPmtiles, parsers, readers, decode functions,
geometry types, and drawing helpers—into shared internal code under
androidApp/src/main, then update both provider wrappers to use it. Remove the
duplicated implementation from
androidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.kt
lines 149-183 and
androidApp/src/google/kotlin/org/meshtastic/app/map/offline/BurningManGoogleTileProvider.kt
lines 131-156; preserve each provider’s platform-specific wrapper and rasterize
return type.
In
`@feature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloader.kt`:
- Around line 289-295: Update the reader initialization around parseHeader and
parseMetadata to avoid loading the entire archive: read only the fixed PMTiles
header bytes, parse it, then seek to header.metadataOffset and read
header.metadataLength bytes for metadata. Preserve the existing header and
metadata-range validation, and use bounded file access so repeated
ProtomapsReader construction does not reread the full archive.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Pro Plus
Run ID: a12956b2-cbcf-4e0d-9e31-20a560469bb6
📒 Files selected for processing (18)
androidApp/src/fdroid/kotlin/org/meshtastic/app/map/MapView.ktandroidApp/src/fdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProvider.ktandroidApp/src/google/kotlin/org/meshtastic/app/map/GoogleMapTileLayerSelection.ktandroidApp/src/google/kotlin/org/meshtastic/app/map/MapView.ktandroidApp/src/google/kotlin/org/meshtastic/app/map/MapViewModel.ktandroidApp/src/google/kotlin/org/meshtastic/app/map/offline/BurningManGoogleTileProvider.ktandroidApp/src/main/kotlin/org/meshtastic/app/MainActivity.ktandroidApp/src/testFdroid/kotlin/org/meshtastic/app/map/offline/BurningManOsmDroidTileProviderTest.ktandroidApp/src/testGoogle/kotlin/org/meshtastic/app/map/GoogleMapTileLayerSelectionTest.ktandroidApp/src/testGoogle/kotlin/org/meshtastic/app/map/offline/BurningManGoogleTileProviderTest.ktfeature/map/src/androidHostTest/kotlin/org/meshtastic/feature/map/offline/BurningManPackCoordinatorTest.ktfeature/map/src/androidHostTest/kotlin/org/meshtastic/feature/map/offline/BurningManPackRuntimeTest.ktfeature/map/src/androidHostTest/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloaderTest.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/BurningManPackCoordinator.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/BurningManPackRuntime.ktfeature/map/src/androidMain/kotlin/org/meshtastic/feature/map/offline/ProtomapsRegionDownloader.ktfeature/map/src/commonMain/kotlin/org/meshtastic/feature/map/offline/BurningManPackPolicy.ktfeature/map/src/commonTest/kotlin/org/meshtastic/feature/map/offline/BurningManPackPolicyTest.kt
|
@coderabbitai review |
✅ Action performedReview finished.
|
|
We can't do this without THOROUGH understanding of licensing. |
|
@jamesarich Its just using OSM tiles. We just need to follow OSM license |
Summary
Adds the 2026 Burning Man system offline region from current Protomaps OSM-derived PMTiles, with separate native Google Maps and F-Droid/osmdroid renderers.
Root cause
The BRC OSM streets are highway=pedestrian, represented by Protomaps as roads kind=path, kind_detail=pedestrian. The renderer needed an explicit rule for this road type and an actual z15 pack validation path.
Data evidence
Validation
Visual evidence
Apple simulator BRC rendering is documented in the companion Apple PR. Android emulator captures are retained locally; GitHub CLI cannot upload binary image attachments, so native PR attachment is pending.
Notes
No dedicated Burning Man map issue exists; design#120 supplies event metadata.
Summary by CodeRabbit