@Test @Ignore public void testExecute() throws IOException, Exception { String attributeName = "huc8"; String variableName = "et"; URI uri = new URI("http: TimeseriesDataset dataset = new TimeseriesDataset(uri, variableName, new DateTime("2004-01-01"), new DateTime("2007-01-01")); List<StationTimeseriesVisitor> additionalVisitors = new LinkedList<>(); Writer writer = new StringWriter(); Delimiter delimiter = Delimiter.COMMA; FeatureTimeseriesStatistics.execute(featureCollection, attributeName, dataset, additionalVisitors, writer, delimiter); String output = writer.toString(); dataset.close(); assertThat(output.contains("04150405"), is(true)); }
public static void execute( FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, String attributeName, TimeseriesDataset timeseriesDataset, List<StationTimeseriesVisitor> additionalVisitors, Writer writer, Delimiter delimiter) { List<Object> featureNames = gatherFeatureAttributes(featureCollection, attributeName); if (featureNames == null || featureNames.isEmpty()) { throw new RuntimeException("No features specified"); } timeseriesDataset.populateMetadata(featureNames.get(0).toString()); String units = timeseriesDataset.getUnits(); Statistics1DWriter statisticWriter = new Statistics1DWriter( featureNames, timeseriesDataset.getObservedProperty(), units, Lists.newArrayList(VALUE), false, delimiter.delimiter, null, false, false, writer); List<StationTimeseriesVisitor> visitors = new LinkedList<>(); FeatureTimeseriesStatiticsVisitor ftsVisitor = new FeatureTimeseriesStatiticsVisitor(featureNames, statisticWriter); visitors.add(ftsVisitor); visitors.addAll(additionalVisitors); TimeseriesTraverser traverser = new TimeseriesTraverser(timeseriesDataset); traverser.traverse(visitors); }
FeatureTimeseriesStatistics { public static void execute( FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, String attributeName, TimeseriesDataset timeseriesDataset, List<StationTimeseriesVisitor> additionalVisitors, Writer writer, Delimiter delimiter) { List<Object> featureNames = gatherFeatureAttributes(featureCollection, attributeName); if (featureNames == null || featureNames.isEmpty()) { throw new RuntimeException("No features specified"); } timeseriesDataset.populateMetadata(featureNames.get(0).toString()); String units = timeseriesDataset.getUnits(); Statistics1DWriter statisticWriter = new Statistics1DWriter( featureNames, timeseriesDataset.getObservedProperty(), units, Lists.newArrayList(VALUE), false, delimiter.delimiter, null, false, false, writer); List<StationTimeseriesVisitor> visitors = new LinkedList<>(); FeatureTimeseriesStatiticsVisitor ftsVisitor = new FeatureTimeseriesStatiticsVisitor(featureNames, statisticWriter); visitors.add(ftsVisitor); visitors.addAll(additionalVisitors); TimeseriesTraverser traverser = new TimeseriesTraverser(timeseriesDataset); traverser.traverse(visitors); } }
FeatureTimeseriesStatistics { public static void execute( FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, String attributeName, TimeseriesDataset timeseriesDataset, List<StationTimeseriesVisitor> additionalVisitors, Writer writer, Delimiter delimiter) { List<Object> featureNames = gatherFeatureAttributes(featureCollection, attributeName); if (featureNames == null || featureNames.isEmpty()) { throw new RuntimeException("No features specified"); } timeseriesDataset.populateMetadata(featureNames.get(0).toString()); String units = timeseriesDataset.getUnits(); Statistics1DWriter statisticWriter = new Statistics1DWriter( featureNames, timeseriesDataset.getObservedProperty(), units, Lists.newArrayList(VALUE), false, delimiter.delimiter, null, false, false, writer); List<StationTimeseriesVisitor> visitors = new LinkedList<>(); FeatureTimeseriesStatiticsVisitor ftsVisitor = new FeatureTimeseriesStatiticsVisitor(featureNames, statisticWriter); visitors.add(ftsVisitor); visitors.addAll(additionalVisitors); TimeseriesTraverser traverser = new TimeseriesTraverser(timeseriesDataset); traverser.traverse(visitors); }  }
FeatureTimeseriesStatistics { public static void execute( FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, String attributeName, TimeseriesDataset timeseriesDataset, List<StationTimeseriesVisitor> additionalVisitors, Writer writer, Delimiter delimiter) { List<Object> featureNames = gatherFeatureAttributes(featureCollection, attributeName); if (featureNames == null || featureNames.isEmpty()) { throw new RuntimeException("No features specified"); } timeseriesDataset.populateMetadata(featureNames.get(0).toString()); String units = timeseriesDataset.getUnits(); Statistics1DWriter statisticWriter = new Statistics1DWriter( featureNames, timeseriesDataset.getObservedProperty(), units, Lists.newArrayList(VALUE), false, delimiter.delimiter, null, false, false, writer); List<StationTimeseriesVisitor> visitors = new LinkedList<>(); FeatureTimeseriesStatiticsVisitor ftsVisitor = new FeatureTimeseriesStatiticsVisitor(featureNames, statisticWriter); visitors.add(ftsVisitor); visitors.addAll(additionalVisitors); TimeseriesTraverser traverser = new TimeseriesTraverser(timeseriesDataset); traverser.traverse(visitors); }  static void execute(
			FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection,
			String attributeName,
			TimeseriesDataset timeseriesDataset,
			List<StationTimeseriesVisitor> additionalVisitors,
			Writer writer,
			Delimiter delimiter); }
FeatureTimeseriesStatistics { public static void execute( FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection, String attributeName, TimeseriesDataset timeseriesDataset, List<StationTimeseriesVisitor> additionalVisitors, Writer writer, Delimiter delimiter) { List<Object> featureNames = gatherFeatureAttributes(featureCollection, attributeName); if (featureNames == null || featureNames.isEmpty()) { throw new RuntimeException("No features specified"); } timeseriesDataset.populateMetadata(featureNames.get(0).toString()); String units = timeseriesDataset.getUnits(); Statistics1DWriter statisticWriter = new Statistics1DWriter( featureNames, timeseriesDataset.getObservedProperty(), units, Lists.newArrayList(VALUE), false, delimiter.delimiter, null, false, false, writer); List<StationTimeseriesVisitor> visitors = new LinkedList<>(); FeatureTimeseriesStatiticsVisitor ftsVisitor = new FeatureTimeseriesStatiticsVisitor(featureNames, statisticWriter); visitors.add(ftsVisitor); visitors.addAll(additionalVisitors); TimeseriesTraverser traverser = new TimeseriesTraverser(timeseriesDataset); traverser.traverse(visitors); }  static void execute(
			FeatureCollection<SimpleFeatureType, SimpleFeature> featureCollection,
			String attributeName,
			TimeseriesDataset timeseriesDataset,
			List<StationTimeseriesVisitor> additionalVisitors,
			Writer writer,
			Delimiter delimiter);  }