Class SpatialPartitioner

java.lang.Object
org.apache.spark.Partitioner
org.apache.sedona.core.spatialPartitioning.SpatialPartitioner
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
BroadcastedSpatialPartitioner, FlatGridPartitioner, GenericUniquePartitioner, KDBTreePartitioner, QuadTreePartitioner

public abstract class SpatialPartitioner extends org.apache.spark.Partitioner implements Serializable
See Also:
  • Field Details

    • gridType

      protected final GridType gridType
    • grids

      protected final List<org.locationtech.jts.geom.Envelope> grids
  • Constructor Details

    • SpatialPartitioner

      protected SpatialPartitioner()
    • SpatialPartitioner

      protected SpatialPartitioner(GridType gridType, List<org.locationtech.jts.geom.Envelope> grids)
  • Method Details

    • placeObject

      public abstract <T extends org.locationtech.jts.geom.Geometry> Iterator<scala.Tuple2<Integer,T>> placeObject(T spatialObject) throws Exception
      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.

      Throws:
      Exception
    • getDedupParams

      @Nullable public abstract DedupParams getDedupParams()
    • getGridType

      public GridType getGridType()
    • getGrids

      public List<org.locationtech.jts.geom.Envelope> getGrids()
    • getPartition

      public int getPartition(Object key)
      Specified by:
      getPartition in class org.apache.spark.Partitioner