DRAFT: Construct a spatialpandas.spatialindex.HilbertRtree for fast bounding box queries #1215
DRAFT: Construct a spatialpandas.spatialindex.HilbertRtree for fast bounding box queries #1215philipc2 wants to merge 8 commits into
spatialpandas.spatialindex.HilbertRtree for fast bounding box queries #1215Conversation
|
@fluidnumerics-joe I wonder if this would be of any use for your applications, since this should allow for similar functionality to the In addition to point containment tests, this would allow us to determine the intersections between two bounds, which is especially usefull if you want to quickly determine candidate faces between a source and destination grid. Since this is written with Numba, we should be able to integrate this into your Point in Polygon functionality to significantly improve performance. |
spatialpandas.spatialindex.HilbertRtree for bounding box queries spatialpandas.spatialindex.HilbertRtree for fast bounding box queries
Awesome! I will check out the branch and see if I can integrate it with my function. This looks really helpful tho! |
|
How quickly can this be built on a larger file? I know that KDTree is slow, so I am interested to know how quick this one is compared to our other methods. Mind if I add a benchmark to the already created tree construction benchmarks, just to compare? |
| else: | ||
| setattr(self, var_name, grid_var.chunk()) | ||
|
|
||
| def get_rtree(self, p: int = 10, page_size: int = 512, reconstruct: bool = False): |
There was a problem hiding this comment.
Should we name this get_r_tree just to be consistent with how we name our other tree functions?
This is a good idea! It takes about 400ms to construct it for a 30km MPAS grid (655,362 faces) The kd-tree takes 170ms |
I added some benchmarks:) Interesting results, I noticed the same, that the construction of the KDTree takes less time. However, the query time is faster for the RTree by a little bit compared to the other trees. |
ASV BenchmarkingBenchmark Comparison ResultsBenchmarks that have improved:
Benchmarks that have stayed the same:
|
|
Closing this as not planned for now |
Closes #XXX
Overview
spatialpandas.spatialindex.HilbertRTreefor doing spatial queries on the bounds of each face.