use of org.locationtech.geowave.core.index.CoordinateRange in project geowave by locationtech.
the class BinnedSFCUtils method getCoordinateRanges.
public static MultiDimensionalCoordinateRanges getCoordinateRanges(final BinRange[][] binRangesPerDimension, final SpaceFillingCurve sfc, final int numDimensions, final Byte tier) {
final CoordinateRange[][] coordinateRangesPerDimension = new CoordinateRange[numDimensions][];
for (int d = 0; d < coordinateRangesPerDimension.length; d++) {
coordinateRangesPerDimension[d] = new CoordinateRange[binRangesPerDimension[d].length];
for (int i = 0; i < binRangesPerDimension[d].length; i++) {
final long[] range = sfc.normalizeRange(binRangesPerDimension[d][i].getNormalizedMin(), binRangesPerDimension[d][i].getNormalizedMax(), d);
coordinateRangesPerDimension[d][i] = new CoordinateRange(range[0], range[1], binRangesPerDimension[d][i].getBinId());
}
}
if (tier == null) {
return new MultiDimensionalCoordinateRanges(new byte[0], coordinateRangesPerDimension);
}
return new MultiDimensionalCoordinateRanges(new byte[] { tier }, coordinateRangesPerDimension);
}
Aggregations