public class HilbertSFC extends Object implements SpaceFillingCurve
Modifier and Type | Field and Description |
---|---|
protected com.google.uzaygezen.core.CompactHilbertCurve |
compactHilbertCurve |
protected HilbertSFCOperations |
decomposeQueryOperations |
protected SFCDimensionDefinition[] |
dimensionDefinitions |
protected HilbertSFCOperations |
getIdOperations |
protected int |
totalPrecision |
Constructor and Description |
---|
HilbertSFC() |
HilbertSFC(SFCDimensionDefinition[] dimensionDefs)
Use the SFCFactory.createSpaceFillingCurve method - don't call this constructor directly
|
Modifier and Type | Method and Description |
---|---|
RangeDecomposition |
decomposeRange(MultiDimensionalNumericData query,
boolean overInclusiveOnEdge,
int maxFilteredIndexedRanges)
* Returns a collection of ranges on the 1-d space filling curve that correspond to the
n-dimensional range described in the query parameter.
|
RangeDecomposition |
decomposeRangeFully(MultiDimensionalNumericData query)
* Returns a collection of ranges on the 1-d space filling curve that correspond to the
n-dimensional range described in the query parameter.
|
boolean |
equals(Object obj) |
protected static byte[] |
fitExpectedByteCount(int expectedByteCount,
byte[] bytes) |
void |
fromBinary(byte[] bytes)
Convert a stream of binary bytes to fields and data within an object.
|
long[] |
getCoordinates(byte[] id)
* Gets n-dimensional coordinates from a single dimension
|
BigInteger |
getEstimatedIdCount(MultiDimensionalNumericData data)
* Determines the estimated number of rows a multi-dimensional range will span within this space
filling curve
|
byte[] |
getId(Double[] values)
* Maps a n-dimensional value to a single dimension, i.e.
|
double[] |
getInsertionIdRangePerDimension()
* Get the range/size of a single insertion ID for each dimension
|
MultiDimensionalNumericData |
getRanges(byte[] id)
* Gets n-dimensional ranges from a single dimension, i.e.
|
int |
hashCode() |
protected void |
init(SFCDimensionDefinition[] dimensionDefs) |
long[] |
normalizeRange(double minValue,
double maxValue,
int dimension)
* Determines the coordinates within this space filling curve for a dimension given a range
|
protected void |
setOptimalOperations(int totalPrecision,
List<Integer> bitsPerDimension,
SFCDimensionDefinition[] dimensionDefs) |
byte[] |
toBinary()
Convert fields and data within an object to binary form for transmission or storage.
|
protected com.google.uzaygezen.core.CompactHilbertCurve compactHilbertCurve
protected SFCDimensionDefinition[] dimensionDefinitions
protected int totalPrecision
protected HilbertSFCOperations getIdOperations
protected HilbertSFCOperations decomposeQueryOperations
public HilbertSFC()
public HilbertSFC(SFCDimensionDefinition[] dimensionDefs)
protected void init(SFCDimensionDefinition[] dimensionDefs)
protected void setOptimalOperations(int totalPrecision, List<Integer> bitsPerDimension, SFCDimensionDefinition[] dimensionDefs)
public byte[] getId(Double[] values)
getId
in interface SpaceFillingCurve
values
- n-dimensional value to be encoded in the SFC. The size of value corresponds to
the number of dimensionspublic RangeDecomposition decomposeRangeFully(MultiDimensionalNumericData query)
This method will decompose the range all the way down to the unit interval of 1.
decomposeRangeFully
in interface SpaceFillingCurve
query
- describes the n-dimensional query window that will be decomposedpublic RangeDecomposition decomposeRange(MultiDimensionalNumericData query, boolean overInclusiveOnEdge, int maxFilteredIndexedRanges)
This method will roll up the ranges based on the maxRanges parameter. Ranges will be "connected" based on the minimization of distance between the end of one range and the start of the next.
decomposeRange
in interface SpaceFillingCurve
query
- describes the n-dimensional query window that will be decomposedprotected static byte[] fitExpectedByteCount(int expectedByteCount, byte[] bytes)
public byte[] toBinary()
Persistable
toBinary
in interface Persistable
public void fromBinary(byte[] bytes)
Persistable
fromBinary
in interface Persistable
public BigInteger getEstimatedIdCount(MultiDimensionalNumericData data)
SpaceFillingCurve
getEstimatedIdCount
in interface SpaceFillingCurve
data
- describes the n-dimensional range to estimate the row count forpublic MultiDimensionalNumericData getRanges(byte[] id)
SpaceFillingCurve
getRanges
in interface SpaceFillingCurve
id
- the SFC ID to calculate the ranges of values represented.public long[] normalizeRange(double minValue, double maxValue, int dimension)
SpaceFillingCurve
normalizeRange
in interface SpaceFillingCurve
minValue
- describes the minimum of a range in a single dimension used to determine the
SFC coordinate rangemaxValue
- describes the maximum of a range in a single dimension used to determine the
SFC coordinate rangedimension
- the dimensionpublic long[] getCoordinates(byte[] id)
SpaceFillingCurve
getCoordinates
in interface SpaceFillingCurve
id
- the SFC ID to calculate the coordinates for each dimension.public double[] getInsertionIdRangePerDimension()
SpaceFillingCurve
getInsertionIdRangePerDimension
in interface SpaceFillingCurve
Copyright © 2013–2022. All rights reserved.