use of org.locationtech.geowave.core.index.MultiDimensionalCoordinateRanges in project geowave by locationtech.
the class BaseConstraintsQuery method getCoordinateRanges.
@Override
public List<MultiDimensionalCoordinateRangesArray> getCoordinateRanges() {
if ((constraints == null) || constraints.isEmpty()) {
return new ArrayList<>();
} else {
final NumericIndexStrategy indexStrategy = index.getIndexStrategy();
final List<MultiDimensionalCoordinateRangesArray> ranges = new ArrayList<>();
for (final MultiDimensionalNumericData nd : constraints) {
final MultiDimensionalCoordinateRanges[] indexStrategyCoordRanges = indexStrategy.getCoordinateRangesPerDimension(nd, indexMetaData);
if (indexStrategyCoordRanges != null) {
ranges.add(new MultiDimensionalCoordinateRangesArray(indexStrategyCoordRanges));
}
}
return ranges;
}
}
use of org.locationtech.geowave.core.index.MultiDimensionalCoordinateRanges 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