Class FlatGridPartitioner
- java.lang.Object
-
- org.apache.spark.Partitioner
-
- org.apache.sedona.core.spatialPartitioning.SpatialPartitioner
-
- org.apache.sedona.core.spatialPartitioning.FlatGridPartitioner
-
- All Implemented Interfaces:
Serializable
,scala.Serializable
- Direct Known Subclasses:
IndexedGridPartitioner
public class FlatGridPartitioner extends SpatialPartitioner
The FlatGridPartitioner is used when there is already a set of grids which the data should be partitioned into. It iterates through all the grids to find the grids to place a geometry into. Unless you have very few objects to place, it may make more sense to use the IndexedGridPartitioner. If you do not have a strict requirement to use a specific set of grids, it may make more sense to use another partitioner that generates its own grids from a space-partitioning tree, e.g. the KDBTreePartitioner or the QuadTreePartitioner.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected Boolean
preserveUncontainedGeometries
-
Fields inherited from class org.apache.sedona.core.spatialPartitioning.SpatialPartitioner
grids, gridType
-
-
Constructor Summary
Constructors Constructor Description FlatGridPartitioner(List<org.locationtech.jts.geom.Envelope> grids)
FlatGridPartitioner(List<org.locationtech.jts.geom.Envelope> grids, Boolean preserveUncontainedGeometries)
FlatGridPartitioner(GridType gridType, List<org.locationtech.jts.geom.Envelope> grids)
FlatGridPartitioner(GridType gridType, List<org.locationtech.jts.geom.Envelope> grids, Boolean preserveUncontainedGeometries)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object o)
DedupParams
getDedupParams()
int
numPartitions()
Iterator<scala.Tuple2<Integer,org.locationtech.jts.geom.Geometry>>
placeObject(org.locationtech.jts.geom.Geometry spatialObject)
Given a geometry, returns a list of partitions it overlaps.-
Methods inherited from class org.apache.sedona.core.spatialPartitioning.SpatialPartitioner
getGrids, getGridType, getPartition
-
-
-
-
Field Detail
-
preserveUncontainedGeometries
protected final Boolean preserveUncontainedGeometries
-
-
Constructor Detail
-
FlatGridPartitioner
public FlatGridPartitioner(GridType gridType, List<org.locationtech.jts.geom.Envelope> grids, Boolean preserveUncontainedGeometries)
-
FlatGridPartitioner
public FlatGridPartitioner(GridType gridType, List<org.locationtech.jts.geom.Envelope> grids)
-
FlatGridPartitioner
public FlatGridPartitioner(List<org.locationtech.jts.geom.Envelope> grids, Boolean preserveUncontainedGeometries)
-
FlatGridPartitioner
public FlatGridPartitioner(List<org.locationtech.jts.geom.Envelope> grids)
-
-
Method Detail
-
placeObject
public Iterator<scala.Tuple2<Integer,org.locationtech.jts.geom.Geometry>> placeObject(org.locationtech.jts.geom.Geometry spatialObject) throws Exception
Description copied from class:SpatialPartitioner
Given a geometry, returns a list of partitions it overlaps.For points, returns exactly one partition as long as grid type is non-overlapping. For other geometry types or for overlapping grid types, may return multiple partitions.
- Specified by:
placeObject
in classSpatialPartitioner
- Throws:
Exception
-
getDedupParams
@Nullable public DedupParams getDedupParams()
- Specified by:
getDedupParams
in classSpatialPartitioner
-
numPartitions
public int numPartitions()
- Specified by:
numPartitions
in classorg.apache.spark.Partitioner
-
-