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

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


    endCal.setTimeInMillis(time);
    endCal.set(
        Calendar.MONTH,
        0);// make sure its a month after one with 31 days
    binStrategy.setToEpoch(endCal);
    final BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis() - 1,
        endCal.getTimeInMillis()));

    Assert.assertEquals(
        2,
View Full Code Here


  @Test
  public void testStartAndEndEqual() {
    final long time = 123987564019283L;
    final TemporalBinningStrategy binStrategy = new TemporalBinningStrategy(
        Unit.YEAR);
    final BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        time,
        time));

    Assert.assertEquals(
        1,
View Full Code Here

        1);
    // test the day boundaries first - going from feb28 to march 1 should
    // give 2 bins
    TemporalBinningStrategy binStrategy = new TemporalBinningStrategy(
        Unit.DAY);
    BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        endCal.getTimeInMillis()));

    Assert.assertEquals(
        2,
        ranges.length);

    // now test the month boundaries - adding a day to feb28 for the end
    // time should give 2 bins
    binStrategy = new TemporalBinningStrategy(
        Unit.MONTH);
    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY)));

    Assert.assertEquals(
        2,
View Full Code Here

        1);
    // test the day boundaries first - going from feb28 to march 1 should
    // give 3 bins
    TemporalBinningStrategy binStrategy = new TemporalBinningStrategy(
        Unit.DAY);
    BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        endCal.getTimeInMillis()));

    Assert.assertEquals(
        3,
        ranges.length);

    // now test the month boundaries - adding a day to feb28 for the end
    // time should give 1 bin, adding 2 days should give 2 bins
    binStrategy = new TemporalBinningStrategy(
        Unit.MONTH);
    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY)));

    Assert.assertEquals(
        1,
        ranges.length);
    // add 2 days and now we should end up with 2 bins
    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY * 2)));

    Assert.assertEquals(
        2,
 
View Full Code Here

    startCal.set(
        Calendar.YEAR,
        2015);
    binStrategy.setToEpoch(startCal);
    // if we add 365 days to this we should get 2 year bins
    final BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY * 365)));
    Assert.assertEquals(
        2,
        ranges.length);
 
View Full Code Here

    startCal.set(
        Calendar.YEAR,
        2016);
    binStrategy.setToEpoch(startCal);
    // if we add 365 days to this we should get 1 year bin
    BinRange[] ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY * 365)));
    Assert.assertEquals(
        1,
        ranges.length);
    // if we add 366 days to this we should get 2 year bins, and the second
    // bin should be the epoch
    ranges = binStrategy.getNormalizedRanges(new NumericRange(
        startCal.getTimeInMillis(),
        startCal.getTimeInMillis() + (TemporalBinningStrategy.MILLIS_PER_DAY * 366)));
    Assert.assertEquals(
        2,
        ranges.length);
 
View Full Code Here

        });

    GeometryWrapper wrapper = new GeometryWrapper(
        geo);

    NumericRange rangeData = new NumericRange(
        33.7442334433,
        33.75 + (1E-10d));
    assertTrue(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));
    rangeData = new NumericRange(
        33.7442334433,
        33.75 - (1E-13d));
    assertFalse(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));

    rangeData = new NumericRange(
        33.75 - (1E-10d),
        33.751);
    assertTrue(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));
    rangeData = new NumericRange(
        33.75 + (1E-10d),
        33.751);
    assertFalse(wrapper.overlaps(
        fields,
        new NumericData[] {
View Full Code Here

        });

    GeometryWrapper wrapper = new GeometryWrapper(
        geo);

    NumericRange rangeData = new NumericRange(
        -99.15 - (1E-10d),
        -99.140348473);
    assertTrue(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));
    rangeData = new NumericRange(
        -99.15 + (1E-10d),
        -99.140348473);
    assertFalse(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));

    rangeData = new NumericRange(
        -99.23,
        -99.22 + (1E-9d));
    assertTrue(wrapper.overlaps(
        fields,
        new NumericData[] {
          rangeData
        }));
    rangeData = new NumericRange(
        -99.23,
        -99.22 - (1E-10d));
    assertFalse(wrapper.overlaps(
        fields,
        new NumericData[] {
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.