public void accepts( org.opengis.feature.FeatureVisitor visitor, org.opengis.util.ProgressListener progress) throws IOException { if (canDelegate(visitor)) { delegate.accepts(visitor, progress); } else { super.accepts(visitor, progress); } }
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException { collection.accepts(visitor, progress); }
/** * Copies the feature ids from each and every feature into a set. * * <p>This method can be slurp an in memory record of the contents of a * * @param featureCollection * @return */ public static Set<String> fidSet(FeatureCollection<?, ?> featureCollection) { final HashSet<String> fids = new HashSet<String>(); try { featureCollection.accepts( new FeatureVisitor() { public void visit(Feature feature) { fids.add(feature.getIdentifier().getID()); } }, null); } catch (IOException ignore) { } return fids; } //
collection.accepts(visitor, null); TreeSet<Object> result = new TreeSet<>(visitor.getUnique()); return result;
public void accepts( org.opengis.feature.FeatureVisitor visitor, org.opengis.util.ProgressListener progress) throws IOException { if (canDelegate(visitor)) { results.accepts(visitor, progress); } else { super.accepts(visitor, progress); } }
public void accepts( org.opengis.feature.FeatureVisitor visitor, org.opengis.util.ProgressListener progress) throws IOException { if (canDelegate(visitor)) { results.accepts(visitor, progress); } else { super.accepts(visitor, progress); } }
/** * Calculate unique (using FeatureCalc) - only one parameter is used. * * @param collection collection to calculate the unique * @return An object containing the unique value of the attributes * @throws IllegalFilterException * @throws IOException */ static CalcResult calculateBounds( FeatureCollection<? extends FeatureType, ? extends Feature> collection) throws IllegalFilterException, IOException { BoundsVisitor boundsVisitor = new BoundsVisitor(); collection.accepts(boundsVisitor, null); return boundsVisitor.getResult(); }
/** * Calculate average (using FeatureCalc) - only one parameter is used. * * @param collection collection to calculate the average * @param expression Single Expression argument * @return An object containing the average value of the attributes * @throws IllegalFilterException * @throws IOException */ static CalcResult calculateAverage( FeatureCollection<? extends FeatureType, ? extends Feature> collection, Expression expression) throws IllegalFilterException, IOException { AverageVisitor averageVisitor = new AverageVisitor(expression); collection.accepts(averageVisitor, null); return averageVisitor.getResult(); }
/** * Calculate median (using FeatureCalc) - only one parameter is used. * * @param collection collection to calculate the median * @param expression Single Expression argument * @return An object containing the median value of the attributes * @throws IllegalFilterException * @throws IOException */ static CalcResult calculateMedian( FeatureCollection<? extends FeatureType, ? extends Feature> collection, Expression expression) throws IllegalFilterException, IOException { MedianVisitor medianVisitor = new MedianVisitor(expression); collection.accepts(medianVisitor, null); return medianVisitor.getResult(); }
private void initVisitor() { visitor = new UniqueVisitor(this.idFieldName); visitor.setStartIndex(currentVisitorStart); visitor.setMaxFeatures(STEP_LOAD); try { fc.accepts(visitor, new NullProgressListener()); visitorIterator = visitor.getUnique().iterator(); } catch (IOException e) { throw new RuntimeException(e); } }
featureCollection.accepts(uniqueVisit, new NullProgressListener()); List result = uniqueVisit.getResult().toList();
/** * Helper method that construct the group by visitor and visit the given feature collection. The * visitor result is also checked against the expected result. */ private GroupByVisitor executeVisitor( FeatureCollection featureCollection, String aggregateAttribute, String aggregateVisitor, String[] groupByAttributes) throws Exception { GroupByVisitor visitor = buildVisitor(aggregateAttribute, aggregateVisitor, groupByAttributes); featureCollection.accepts(visitor, new NullProgressListener()); return visitor; }
protected void delegateVisitor(FeatureVisitor visitor, ProgressListener progress) throws IOException { Name typeName = transformer.getSource().getName(); Query txQuery = transformer.transformQuery(query); source.getDataStore() .getFeatureSource(typeName) .getFeatures(txQuery) .accepts(visitor, progress); } }
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException { collection.accepts(visitor, progress); }
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException { delegate.accepts(visitor, progress); }
public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException { delegate.accepts( visitor, progress ); }
private List<String> collectElement(FeatureCollection records, final String property) throws IOException { final List<String> values = new ArrayList<String>(); records.accepts(new FeatureVisitor() { @Override public void visit(Feature feature) { ComplexAttribute ca = (ComplexAttribute) feature.getProperty(property); String value = (String) ca.getProperty("value").getValue(); values.add(value); } }, null); return values; }
@Override public void accepts(FeatureVisitor visitor, ProgressListener progress) throws IOException { timeoutVerifier.checkTimeout(); TimeoutFeatureVisitor timeoutVisitor = new TimeoutFeatureVisitor(timeoutVerifier, visitor); delegate.accepts(timeoutVisitor, progress); }
@Test public void testSentinel1Granules() throws Exception { FeatureSource<FeatureType, Feature> featureSource = osAccess.getFeatureSource(new NameImpl(TEST_NAMESPACE, "SENTINEL1")); assertEquals(0, featureSource.getCount(Query.ALL)); FeatureCollection<FeatureType, Feature> fc = featureSource.getFeatures(); assertEquals(0, fc.size()); fc.accepts( f -> {}, null); // just check trying to scroll over the feature does not make it blow }
@Test public void testCustomProductClassGranules() throws Exception { FeatureSource<FeatureType, Feature> featureSource = osAccess.getFeatureSource(new NameImpl(TEST_NAMESPACE, "GS_TEST")); assertEquals(0, featureSource.getCount(Query.ALL)); FeatureCollection<FeatureType, Feature> fc = featureSource.getFeatures(); assertGranulesViewSchema(fc.getSchema(), GS_PRODUCT); assertEquals(0, fc.size()); fc.accepts( f -> {}, null); // just check trying to scroll over the feature does not make it blow }