@Override public NumericRange getBounds() { return new NumericRange(min, max); } }
@Override public NumericData toNumericData() { return new NumericRange(startTime, endTime); }
@Override public NumericData getFullRange() { return new NumericRange(min, max); }
@Override public NumericData getFullRange() { return new NumericRange(0, System.currentTimeMillis() + 1); } }
@Override public NumericData getFullRange() { return new NumericRange(0, System.currentTimeMillis() + 1); }
public static ConstraintSet createConstraints( final TemporalRange temporalRange, final boolean isDefault) { return new ConstraintSet( TimeDefinition.class, new ConstraintData( new NumericRange( temporalRange.getStartTime().getTime(), temporalRange.getEndTime().getTime()), isDefault)); }
public ConstraintSet getConstraints() { // Create a NumericRange object using the x axis final NumericRange rangeLongitude = new NumericRange(minX, maxX); // Create a NumericRange object using the y axis final NumericRange rangeLatitude = new NumericRange(minY, maxY); final Map<Class<? extends NumericDimensionDefinition>, ConstraintData> constraintsPerDimension = new HashMap<>(); // Create and return a new IndexRange array with an x and y axis // range constraintsPerDimension.put( LongitudeDefinition.class, new ConstraintData(rangeLongitude, true)); constraintsPerDimension.put(LatitudeDefinition.class, new ConstraintData(rangeLatitude, true)); return new ConstraintSet(constraintsPerDimension); }
@Override protected NumericRange getRange(final SimpleFeature entry) { final Object o = entry.getAttribute(getFieldName()); if (o == null) { return null; } final double num = ((Number) o).doubleValue(); return new NumericRange(num, num); }
@Override public NumericRange getDenormalizedRanges(BinRange binnedRange) { int bin = ByteBuffer.wrap(binnedRange.getBinId()).getInt(); double center = bin * interval; if (binnedRange.isFullExtent()) { return new NumericRange(center - halfInterval, center + halfInterval); } return new NumericRange( center + binnedRange.getNormalizedMin(), center + binnedRange.getNormalizedMax()); }
private static Constraints createTemporalConstraints( final TemporalConstraints temporalConstraints) { final List<ConstraintSet> constraints = new ArrayList<>(); for (final TemporalRange range : temporalConstraints.getRanges()) { constraints.add( new ConstraintSet( TimeDefinition.class, new ConstraintData( new NumericRange(range.getStartTime().getTime(), range.getEndTime().getTime()), false))); } return new Constraints(constraints); }
public static Constraints createConstraints(final Interval[] intervals, final boolean isDefault) { final List<ConstraintSet> constraints = new ArrayList<>(); for (final Interval range : intervals) { constraints.add( new ConstraintSet( TimeDefinition.class, new ConstraintData( new NumericRange( range.getStart().toEpochMilli(), // intervals are intended to be exclusive on the end so this adjusts for // exclusivity Math.max(range.getEnd().toEpochMilli() - 1, range.getStart().toEpochMilli())), isDefault))); } return new Constraints(constraints); }
public static Constraints createConstraints( final TemporalConstraints temporalConstraints, final boolean isDefault) { final List<ConstraintSet> constraints = new ArrayList<>(); for (final TemporalRange range : temporalConstraints.getRanges()) { constraints.add( new ConstraintSet( TimeDefinition.class, new ConstraintData( new NumericRange(range.getStartTime().getTime(), range.getEndTime().getTime()), isDefault))); } return new Constraints(constraints); }
@Override public NumericRange getDenormalizedRange(final BinRange range) { return new NumericRange(range.getNormalizedMin(), range.getNormalizedMax()); }
public ConstraintData merge(final ConstraintData cd) { if (range.equals(cd.range)) { return new ConstraintData(range, isDefault); } return new ConstraintData( new NumericRange( Math.min(cd.range.getMin(), range.getMin()), Math.max(cd.range.getMax(), range.getMax())), false); // TODO: ideally, this would be set // based on some // logic }
private static final BinRange[][] getBinsPerDimension( final NumericIndexStrategy indexStrategy, final double[] rangePerDimension) { final NumericDimensionDefinition dim[] = indexStrategy.getOrderedDimensionDefinitions(); final BinRange[][] result = new BinRange[rangePerDimension.length][]; for (int d = 0; d < rangePerDimension.length; d++) { final BinRange[] ranges = dim[d].getNormalizedRanges(new NumericRange(0, rangePerDimension[d])); result[d] = ranges; } return result; }
@Override public NumericRange getDenormalizedRange(final BinRange range) { return new NumericRange(range.getNormalizedMin(), range.getNormalizedMax()); }
/** * Generate a latitude range from a JTS geometry * * @param geometry The JTS geometry * @return The y range */ public static NumericData yRangeFromGeometry(final Geometry geometry) { if ((geometry == null) || geometry.isEmpty()) { return new NumericRange(0, 0); } // Get the envelope of the geometry being held final Envelope env = geometry.getEnvelopeInternal(); // Create a NumericRange object using the y axis return new NumericRange(env.getMinY(), env.getMaxY()); }
public static MultiDimensionalNumericData getBoundsFromEnvelope(final Envelope envelope) { final NumericRange[] boundsPerDimension = new NumericRange[2]; boundsPerDimension[0] = new NumericRange(envelope.getMinX(), envelope.getMaxX()); boundsPerDimension[1] = new NumericRange(envelope.getMinY(), envelope.getMaxY()); return new BasicNumericDataset(boundsPerDimension); }
@Override public NumericRange getDenormalizedRanges(final BinRange binnedRange) { final Calendar startofEpoch = getStartEpoch(binnedRange.getBinId()); final long startOfEpochMillis = startofEpoch.getTimeInMillis(); final long minMillis = startOfEpochMillis + (long) binnedRange.getNormalizedMin(); final long maxMillis = startOfEpochMillis + (long) binnedRange.getNormalizedMax(); return new NumericRange(minMillis, maxMillis); } }
@Override public NumericRange getDenormalizedRanges(final BinRange binnedRange) { final long startOfEpochMillis = getStartEpoch(binnedRange.getBinId()); final long minMillis = startOfEpochMillis + (long) binnedRange.getNormalizedMin(); final long maxMillis = startOfEpochMillis + (long) binnedRange.getNormalizedMax(); return new NumericRange(minMillis, maxMillis); }