@Test public void testTimeCriterion() throws Exception { MAConfig config = new MAConfig(); config.setMacroPixelSize(1); config.setMaxTimeDifference(null); RecordSource input = new DefaultRecordSource(new DefaultHeader(true, true, "latitude", "longitude", "time"), RecordUtils.create(new GeoPos(0, 0), date("07-MAY-2010 11:25:00")), RecordUtils.create(new GeoPos(0, 1 - EPS), date("07-MAY-2010 10:25:00")), RecordUtils.create(new GeoPos(1, 0), date("07-MAY-2010 10:59:00")), RecordUtils.create(new GeoPos(1, 1 - EPS), date("07-MAY-2010 09:25:00"))); ProductRecordSource output = createProductRecordSource(2, 3, input, config); List<Record> records = getRecords(output); assertEquals(4, records.size()); config = new MAConfig(); config.setMacroPixelSize(1); config.setMaxTimeDifference("0.25"); input = new DefaultRecordSource(new DefaultHeader(true, true, "latitude", "longitude", "time"), RecordUtils.create(new GeoPos(0.5F, 0.5F), date("07-MAY-2010 11:26:00")), RecordUtils.create(new GeoPos(0.5F, 0.5F), date("07-JUN-2010 13:25:00")), RecordUtils.create(new GeoPos(0.5F, 0.5F), date("07-MAY-2010 10:59:00")), RecordUtils.create(new GeoPos(0.5F, 0.5F), date("07-MAY-2010 08:10:00"))); output = createProductRecordSource(2, 3, input, config); records = getRecords(output); assertEquals(1, records.size()); }
@Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); @Override Header getHeader(); @Override Iterable<Record> getRecords(); @Override String getTimeAndLocationColumnDescription(); }
ProductRecordSource implements RecordSource { @Override public Iterable<Record> getRecords() throws Exception { return new Iterable<Record>() { @Override public Iterator<Record> iterator() { return new PixelPosRecordGenerator(pixelPosRecords.iterator()); } }; } ProductRecordSource(Product product,
                               Header referenceRecordHeader,
                               Iterable<PixelPosProvider.PixelPosRecord> pixelPosRecords,
                               MAConfig config,
                               AffineTransform transform); @Override Header getHeader(); @Override Iterable<Record> getRecords(); @Override String getTimeAndLocationColumnDescription(); static final String SOURCE_NAME_ATT_NAME; static final String PIXEL_X_ATT_NAME; static final String PIXEL_Y_ATT_NAME; static final String PIXEL_LAT_ATT_NAME; static final String PIXEL_LON_ATT_NAME; static final String PIXEL_TIME_ATT_NAME; static final String PIXEL_MASK_ATT_NAME; }