Class HilbertPartitioning
- java.lang.Object
-
- org.apache.sedona.core.spatialPartitioning.HilbertPartitioning
-
- All Implemented Interfaces:
Serializable
public class HilbertPartitioning extends Object implements Serializable
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected int[]
splits
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
All Methods Static Methods Instance Methods Concrete Methods 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>
getGrids()
Gets the grids.int[]
getPartitionBounds()
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.
-
-
-
Constructor Detail
-
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 Detail
-
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
public List<org.locationtech.jts.geom.Envelope> getGrids()
Gets the grids.- Returns:
- the grids
-
-