public class QuadTreeRTPartitioner extends QuadTreePartitioner
It uses the Quad-tree partitioning strategy to create balanced partitions This partitioning is essential for efficiently executing kNN joins. The process involves the following steps:
1. **Quad-tree Partitioning**: - Data is partitioned into partitions using the Quad-tree data structure. - This ensures balanced partitions and spatial locality preservation.
2. **Global R-Tree Index Construction**: - A set of random samples S' from the dataset S is taken. - An R-tree T is built over S' in the master node (driver program).
3. **Distance Bound Calculation**: - For each partition Ri, the distance ui from the furthest point in Ri to the centroid cri is calculated. - k-nearest neighbors of each centroid cri are found using the R-tree T. - A distance bound γi is derived for each Ri, defined as γi = 2ui + |cri, sk|, where sk is the k-th nearest neighbor of cri.
4. **Partitioning Neighbors**: - For each partition Ri, a subset Si ⊂ S is identified such that for any r ∈ Ri, knn(r, S) = knn(r, Si) using a circle range query centered at cri with radius γi. - This guarantees that the k-nearest neighbors of any point in Ri can be found within the subset Si.
5. **Parallel Local kNN Joins**: - Each combined partition (Ri, Si) is processed in parallel. - An R-tree is built over Si, and a local kNN join is performed for each record in Ri. - The results from all partitions are combined to produce the final kNN join results.
Reference: Xie, Dong, et al. "Simba: Efficient in-memory spatial analytics." In Proceedings of the 2016 ACM SIGMOD International Conference on Management of Data (SIGMOD '16), 2016, DOI: 10.1145/2882903.2915237.
grids, gridType
Constructor and Description |
---|
QuadTreeRTPartitioner(ExtendedQuadTree<?> extendedQuadTree) |
Modifier and Type | Method and Description |
---|---|
org.locationtech.jts.geom.Envelope |
getBoundary() |
DedupParams |
getDedupParams() |
List<org.locationtech.jts.geom.Envelope> |
getGrids() |
Map<Integer,List<org.locationtech.jts.geom.Envelope>> |
getOverlappedGrids() |
STRtree |
getSTRForOverlappedGrids() |
QuadTreeRTPartitioner |
nonOverlappedPartitioner() |
int |
numPartitions() |
Iterator<scala.Tuple2<Integer,org.locationtech.jts.geom.Geometry>> |
placeObject(org.locationtech.jts.geom.Geometry spatialObject)
Depending on overlappedPartitioner, return the expanded boundaries or the original boundaries.
|
equals
getGridType, getPartition
public QuadTreeRTPartitioner(ExtendedQuadTree<?> extendedQuadTree)
public QuadTreeRTPartitioner nonOverlappedPartitioner()
public org.locationtech.jts.geom.Envelope getBoundary()
public Iterator<scala.Tuple2<Integer,org.locationtech.jts.geom.Geometry>> placeObject(org.locationtech.jts.geom.Geometry spatialObject) throws Exception
placeObject
in class QuadTreePartitioner
spatialObject
- the spatial objectException
public DedupParams getDedupParams()
getDedupParams
in class QuadTreePartitioner
public List<org.locationtech.jts.geom.Envelope> getGrids()
getGrids
in class SpatialPartitioner
public int numPartitions()
numPartitions
in class QuadTreePartitioner
public Map<Integer,List<org.locationtech.jts.geom.Envelope>> getOverlappedGrids()
public STRtree getSTRForOverlappedGrids()
Copyright © 2025 The Apache Software Foundation. All rights reserved.