feat(clustering): add AreaClusterProvider for on-demand spatial clustering and 2.72M buildings demo - #1811
Draft
dkhawk wants to merge 2 commits into
Draft
feat(clustering): add AreaClusterProvider for on-demand spatial clustering and 2.72M buildings demo#1811dkhawk wants to merge 2 commits into
dkhawk wants to merge 2 commits into
Conversation
…ering and 2.72M buildings demo - Add AreaClusterProvider functional interface and AreaCluster data model to decouple cluster delivery from upfront in-memory collections - Add AreaClusterProviderAlgorithm ScreenBasedAlgorithm implementation that queries spatial providers using visible camera bounds and zoom level - Add ClusterManager.setAreaClusterProvider convenience method and automatic viewport bounds propagation - Add tools/preprocess_buildings.py to build hierarchical multi-zoom spatial pyramids using greedy radius clustering with guaranteed badge separation - Add BinarySpatialPyramidStore memory-mapping .scbin spatial pyramids with zero-copy kernel page caching and sub-millisecond binary search queries - Add BuildingMegaClusterDemoActivity showcasing 2,719,379 building coordinates with Hansel & Gretel candy cottage leaf markers and Map/Satellite/Hybrid layers - Update clustering.api binary compatibility declarations
- Update BinarySpatialPyramidStore to only yield cluster records when size >= 2 - Omit isolated single buildings at low zoom levels (< minZoomForLeafMarkers) - Enforce shouldRenderAsCluster returns true only for size >= 2, ensuring clusters never display as '1' - Update bold candy cottage marker and add Map/Satellite/Hybrid layer switcher
Contributor
Code Coverage
Files
|
This branch has not been deployed
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.
Summary
Decouples cluster data delivery from upfront in-memory collections by introducing a reactive, area-based callback clustering architecture (
AreaClusterProvider). Demonstrates sub-millisecond querying and zero heap exhaustion on a real-world dataset of 2,719,379 building coordinates on Android.Key Changes
AreaClusterProvider<T>: Functional interface invoked byClusterManagerwith visible cameraLatLngBoundsand current zoom level.AreaCluster<T>: Lightweight, immutableClusterimplementation that models both composite clusters (size >= 2) and leaf markers (size == 1).AreaClusterProviderAlgorithm<T>:ScreenBasedAlgorithmthat bridges viewport camera bounds to the area provider.ClusterManager.setAreaClusterProvider(...): Convenience method to bind area providers with automatic main-thread projection viewport synchronization.tools/preprocess_buildings.py: Offline Python tool to generate non-overlapping multi-resolution spatial pyramids (.scbin) using greedy radius clustering with spatial hash acceleration.BinarySpatialPyramidStore: Zero-copy, memory-mapped spatial reader that queries latitude-sorted records using binary search in < 1ms.BuildingMegaClusterDemoActivity: Showcase activity with real-timeMap,Satellite, andHybridlayer toggling, custom Hansel & Gretel candy house markers, and clean cluster separation.