Class HilbertPartitioning
java.lang.Object
org.apache.sedona.core.spatialPartitioning.HilbertPartitioning
- All Implemented Interfaces:
Serializable
- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionHilbertPartitioning(List<org.locationtech.jts.geom.Envelope> samples, org.locationtech.jts.geom.Envelope boundary, int partitions) Instantiates a new hilbert partitioning. -
Method Summary
Modifier and TypeMethodDescriptionstatic intcomputeHValue(int n, int x, int y) Compute H value.protected voidcreateFromHValues(int[] hValues, int partitions) Creates the from H values.List<org.locationtech.jts.geom.Envelope>getGrids()Gets the grids.int[]Gets the partition bounds.static intgridID(org.locationtech.jts.geom.Envelope boundary, org.locationtech.jts.geom.Envelope spatialObject, int[] partitionBounds) Grid ID.static intlocationMapping(double axisMin, double axisLocation, double axisMax) Location mapping.static org.locationtech.jts.geom.EnvelopeupdateEnvelope(org.locationtech.jts.geom.Envelope envelope, org.locationtech.jts.geom.Envelope spatialObject) Update envelope.
-
Field Details
-
splits
protected int[] splitsThe 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 listboundary- the boundarypartitions- 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 nx- the xy- the y- Returns:
- the int
-
locationMapping
public static int locationMapping(double axisMin, double axisLocation, double axisMax) Location mapping.- Parameters:
axisMin- the axis minaxisLocation- the axis locationaxisMax- 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 boundaryspatialObject- the spatial objectpartitionBounds- 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 envelopespatialObject- 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 valuespartitions- the partitions
-
getPartitionBounds
public int[] getPartitionBounds()Gets the partition bounds.- Returns:
- the partition bounds
-
getGrids
Gets the grids.- Returns:
- the grids
-