Implement SpatialTreeInterface for packed R-tree#12
Draft
repro-code wants to merge 1 commit into
Draft
Conversation
Add PackedRTree and PackedRTreeNode types that provide a hierarchical view over the flat-packed R-tree array. This implements the SpatialTreeInterface from GeometryOps.jl, enabling generic spatial tree algorithms. Key changes: - New packedrtree.jl with PackedRTree wrapper types - Implements isspatialtree, isleaf, getchild, nchild, child_indices_extents, node_extent interface methods - Includes generic depth_first_search and query functions - Rewrite filter!/search to use the new interface - Backwards-compatible legacy search function preserved The interface is designed to be generic over node element types, not just NodeItem, allowing reuse for other packed R-tree implementations. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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
PackedRTreeandPackedRTreeNodetypes that provide a hierarchical view over the flat-packed R-tree arrayfilter!/searchto use the new interface via depth-first searchsearchfunctionDetails
The implementation introduces:
New types in
packedrtree.jl:PackedRTree{T,V}- wrapper around the flat array with tree metadataPackedRTreeNode{T,V}- lightweight view into a single nodeSpatialTreeInterface methods:
isspatialtree- predicate for spatial tree typesisleaf- check if node is a leafgetchild/nchild- access childrenchild_indices_extents- iterator over (index, extent) for leavesnode_extent- bounding box of a nodeGeneric algorithms:
depth_first_search(f, predicate, tree)- DFS with predicate filteringquery(tree, predicate)- returns matching feature offsetsThe interface is designed to be generic over node element types (not just
NodeItem), allowing reuse for other packed R-tree implementations.Test plan
🤖 Generated with Claude Code