Search in sources :

Example 1 with MultiDimensionalCoordinateRanges

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;
    }
}
Also used : MultiDimensionalNumericData(org.locationtech.geowave.core.index.numeric.MultiDimensionalNumericData) MultiDimensionalCoordinateRanges(org.locationtech.geowave.core.index.MultiDimensionalCoordinateRanges) ArrayList(java.util.ArrayList) MultiDimensionalCoordinateRangesArray(org.locationtech.geowave.core.index.MultiDimensionalCoordinateRangesArray) NumericIndexStrategy(org.locationtech.geowave.core.index.NumericIndexStrategy)

Example 2 with MultiDimensionalCoordinateRanges

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);
}
Also used : MultiDimensionalCoordinateRanges(org.locationtech.geowave.core.index.MultiDimensionalCoordinateRanges) CoordinateRange(org.locationtech.geowave.core.index.CoordinateRange)

Aggregations

MultiDimensionalCoordinateRanges (org.locationtech.geowave.core.index.MultiDimensionalCoordinateRanges)2 ArrayList (java.util.ArrayList)1 CoordinateRange (org.locationtech.geowave.core.index.CoordinateRange)1 MultiDimensionalCoordinateRangesArray (org.locationtech.geowave.core.index.MultiDimensionalCoordinateRangesArray)1 NumericIndexStrategy (org.locationtech.geowave.core.index.NumericIndexStrategy)1 MultiDimensionalNumericData (org.locationtech.geowave.core.index.numeric.MultiDimensionalNumericData)1