Package mil.nga.giat.geowave.index.sfc.data

Examples of mil.nga.giat.geowave.index.sfc.data.NumericRange


      final String classNameStr = StringUtils.stringFromBinary(className);
      try {
        final Class<? extends NumericDimensionDefinition> cls = (Class<? extends NumericDimensionDefinition>) Class.forName(classNameStr);
        constraintsPerTypeOfDimensionDefinition.put(
            cls,
            new NumericRange(
                min,
                max));
      }
      catch (final ClassNotFoundException e) {
        LOGGER.warn(
View Full Code Here


        fieldId);
  }

  @Override
  public NumericData getFullRange() {   
    return new NumericRange(0, System.currentTimeMillis()+1);
  }
View Full Code Here

      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);
  }
View Full Code Here

      final Geometry queryGeometry ) {
    final Constraints constraints = GeometryUtils.basicConstraintsFromGeometry(queryGeometry);
    for (final TemporalRange range : temporalConstraints.constraints) {
      constraints.constraintsPerTypeOfDimensionDefinition.put(
          TimeDefinition.class,
          new NumericRange(
              range.getStartTime().getTime(),
              range.getEndTime().getTime()));
    }

    return constraints;
View Full Code Here

      final Date endTime,
      final Geometry queryGeometry ) {
    final Constraints constraints = GeometryUtils.basicConstraintsFromGeometry(queryGeometry);
    constraints.constraintsPerTypeOfDimensionDefinition.put(
        TimeDefinition.class,
        new NumericRange(
            startTime.getTime(),
            endTime.getTime()));
    return constraints;
  }
View Full Code Here

      this.visibility = visibility;
    }

    @Override
    public NumericData toNumericData() {
      return new NumericRange(
          startTime,
          endTime);
    }
View Full Code Here

    final int numDimensions = buf.getInt();
    dimensionFields = new DimensionField<?>[numDimensions];
    final NumericData[] data = new NumericData[numDimensions];
    for (int d = 0; d < numDimensions; d++) {
      final byte[] field = new byte[buf.getInt()];
      data[d] = new NumericRange(
          buf.getDouble(),
          buf.getDouble());
      buf.get(field);
      dimensionFields[d] = PersistenceUtils.fromBinary(
          field,
View Full Code Here

    TemporalRange range = new TemporalRange(new Date(100), new Date(1000));
    assertFalse(range.isWithin(new Date(10)));
    assertFalse(range.isWithin(new Date(100000)));
    assertTrue(range.isWithin(new Date(800)));

    assertFalse(range.isWithin(new NumericRange(20, 99)));
    assertFalse(range.isWithin(new NumericRange(1001, 9900)));
    assertTrue(range.isWithin(new NumericRange(998, 9900)));
    assertTrue(range.isWithin(new NumericRange(20, 199)));
    assertTrue(range.isWithin(new NumericRange(150, 199)));
  }
View Full Code Here

    binStrategy.setToEpoch(startCal);
    binStrategy.setToEpoch(endCal);
    endCal.add(
        unit.toCalendarEnum(),
        binCount);
    return binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        (double) endCal.getTimeInMillis() - 1));
  }
View Full Code Here

    // full extent and the middle one being full extent
    endCal.setTimeInMillis(time + (TemporalBinningStrategy.MILLIS_PER_DAY * 2));
    final TemporalBinningStrategy binStrategy = new TemporalBinningStrategy(
        Unit.DAY);

    BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        endCal.getTimeInMillis()));
    Assert.assertEquals(
        3,
        ranges.length);

    Assert.assertTrue(!ranges[0].isFullExtent());

    Assert.assertTrue(ranges[1].isFullExtent());

    Assert.assertTrue(!ranges[2].isFullExtent());

    final Calendar startCalOnEpoch = Calendar.getInstance();

    startCalOnEpoch.setTimeInMillis(time);
    binStrategy.setToEpoch(startCalOnEpoch);

    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCalOnEpoch.getTimeInMillis(),
        endCal.getTimeInMillis()));
    Assert.assertEquals(
        3,
        ranges.length);
    // now the first element should be full extent
    Assert.assertTrue(ranges[0].isFullExtent());

    Assert.assertTrue(ranges[1].isFullExtent());

    Assert.assertTrue(!ranges[2].isFullExtent());

    final Calendar endCalOnMax = Calendar.getInstance();
    // theoretically should get 3 bins back the first and last not having
    // full extent and the middle one being full extent
    endCalOnMax.setTimeInMillis(time + (TemporalBinningStrategy.MILLIS_PER_DAY * 3));
    binStrategy.setToEpoch(endCalOnMax);
    endCalOnMax.add(
        Calendar.MILLISECOND,
        -1);
    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        endCalOnMax.getTimeInMillis()));
    Assert.assertEquals(
        3,
        ranges.length);
View Full Code Here

TOP

Related Classes of mil.nga.giat.geowave.index.sfc.data.NumericRange

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.