Class HilbertPartitioning

java.lang.Object
org.apache.sedona.core.spatialPartitioning.HilbertPartitioning
All Implemented Interfaces:
Serializable

public class HilbertPartitioning extends Object implements Serializable
See Also:
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    protected int[]
    The splits.
  • Constructor Summary

    Constructors
    Constructor
    Description
    HilbertPartitioning(List<org.locationtech.jts.geom.Envelope> samples, org.locationtech.jts.geom.Envelope boundary, int partitions)
    Instantiates a new hilbert partitioning.
  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    computeHValue(int n, int x, int y)
    Compute H value.
    protected void
    createFromHValues(int[] hValues, int partitions)
    Creates the from H values.
    List<org.locationtech.jts.geom.Envelope>
    Gets the grids.
    int[]
    Gets the partition bounds.
    static int
    gridID(org.locationtech.jts.geom.Envelope boundary, org.locationtech.jts.geom.Envelope spatialObject, int[] partitionBounds)
    Grid ID.
    static int
    locationMapping(double axisMin, double axisLocation, double axisMax)
    Location mapping.
    static org.locationtech.jts.geom.Envelope
    updateEnvelope(org.locationtech.jts.geom.Envelope envelope, org.locationtech.jts.geom.Envelope spatialObject)
    Update envelope.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • splits

      protected int[] splits
      The splits.
  • Constructor Details

    • HilbertPartitioning

      public HilbertPartitioning(List<org.locationtech.jts.geom.Envelope> samples, org.locationtech.jts.geom.Envelope boundary, int partitions) throws Exception
      Instantiates a new hilbert partitioning.
      Parameters:
      samples - the sample list
      boundary - the boundary
      partitions - the partitions
      Throws:
      Exception - the exception
  • Method Details

    • computeHValue

      public static int computeHValue(int n, int x, int y)
      Compute H value.
      Parameters:
      n - the n
      x - the x
      y - the y
      Returns:
      the int
    • locationMapping

      public static int locationMapping(double axisMin, double axisLocation, double axisMax)
      Location mapping.
      Parameters:
      axisMin - the axis min
      axisLocation - the axis location
      axisMax - the axis max
      Returns:
      the int
    • gridID

      public static int gridID(org.locationtech.jts.geom.Envelope boundary, org.locationtech.jts.geom.Envelope spatialObject, int[] partitionBounds) throws Exception
      Grid ID.
      Parameters:
      boundary - the boundary
      spatialObject - the spatial object
      partitionBounds - the partition bounds
      Returns:
      the int
      Throws:
      Exception - the exception
    • updateEnvelope

      public static org.locationtech.jts.geom.Envelope updateEnvelope(org.locationtech.jts.geom.Envelope envelope, org.locationtech.jts.geom.Envelope spatialObject) throws Exception
      Update envelope.
      Parameters:
      envelope - the envelope
      spatialObject - the spatial object
      Returns:
      the envelope
      Throws:
      Exception - the exception
    • createFromHValues

      protected void createFromHValues(int[] hValues, int partitions)
      Creates the from H values.
      Parameters:
      hValues - the h values
      partitions - the partitions
    • getPartitionBounds

      public int[] getPartitionBounds()
      Gets the partition bounds.
      Returns:
      the partition bounds
    • getGrids

      public List<org.locationtech.jts.geom.Envelope> getGrids()
      Gets the grids.
      Returns:
      the grids