public class XZOrderSFC extends Object implements SpaceFillingCurve
Constructor and Description |
---|
XZOrderSFC() |
XZOrderSFC(SFCDimensionDefinition[] dimensionDefs) |
Modifier and Type | Method and Description |
---|---|
RangeDecomposition |
decomposeRange(MultiDimensionalNumericData query,
boolean overInclusiveOnEdge,
int maxRanges)
* 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.
|
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.
|
long[] |
normalizeRange(double minValue,
double maxValue,
int dimension)
* Determines the coordinates within this space filling curve for a dimension given a range
|
byte[] |
toBinary()
Convert fields and data within an object to binary form for transmission or storage.
|
public XZOrderSFC()
public XZOrderSFC(SFCDimensionDefinition[] dimensionDefs)
public byte[] getId(Double[] values)
SpaceFillingCurve
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)
SpaceFillingCurve
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 maxRanges)
SpaceFillingCurve
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 decomposedpublic byte[] toBinary()
Persistable
toBinary
in interface Persistable
public void fromBinary(byte[] bytes)
Persistable
fromBinary
in interface Persistable
public double[] getInsertionIdRangePerDimension()
SpaceFillingCurve
getInsertionIdRangePerDimension
in interface SpaceFillingCurve
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[] getCoordinates(byte[] id)
SpaceFillingCurve
getCoordinates
in interface SpaceFillingCurve
id
- the SFC ID to calculate the coordinates for each dimension.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 dimensionCopyright © 2013–2022. All rights reserved.