public Set getSupportedHints() { return source.getSupportedHints(); }
public Set<Key> getSupportedHints() { return delegate.getSupportedHints(); }
public Set getSupportedHints() { return wrapped.getSupportedHints(); }
public Set getSupportedHints() { return source.getSupportedHints(); }
public Set<Key> getSupportedHints() { return fsource.getSupportedHints(); }
public Set getSupportedHints() { HashSet hints = new HashSet(wrapped.getSupportedHints()); hints.remove(Hints.FEATURE_DETACHED); return hints; }
@Override public Set<Key> getSupportedHints() { // set up hints Set<Key> hints = new HashSet<Key>(); hints.addAll(source.getSupportedHints()); hints.add(Hints.FEATURE_DETACHED); return hints; }
public Set<Key> getSupportedHints() { if (supportedHints != null) return supportedHints; Set<Key> hints = new HashSet<Key>(); // calculate the supported hints, which is the intersection of supported Hints for all // feature sources try { hints.addAll(getBaseFeatureSource().getSupportedHints()); // start with base feature // source for (Generalization di : info.getGeneralizations()) { SimpleFeatureSource fs = getFeatureSourceFor(di); hints.retainAll(fs.getSupportedHints()); } } catch (IOException ex) { throw new RuntimeException(ex); } hints.add(Hints.GEOMETRY_DISTANCE); // always supported supportedHints = Collections.unmodifiableSet(hints); return supportedHints; }
public Set<Key> getSupportedHints() { return fsource.getSupportedHints(); }
public Set getSupportedHints() { return source.getSupportedHints(); }
public Set getSupportedHints() { HashSet hints = new HashSet(wrapped.getSupportedHints()); hints.remove(Hints.FEATURE_DETACHED); return hints; }
expect(fs.getFeatures((Query) anyObject())).andReturn(fc); expect(fs.getSchema()).andReturn(testLineFeatureType).anyTimes(); expect(fs.getSupportedHints()).andReturn(new HashSet()).anyTimes(); replay(fs);
@Override public Set<Key> getSupportedHints() { // set up hints Set<Key> hints = new HashSet<Key>(); hints.addAll(source.getSupportedHints()); hints.add(Hints.FEATURE_DETACHED); return hints; }
@Override public Set<Key> getSupportedHints() { try { return getDelegateCollectionSource().getSupportedHints(); } catch (RuntimeException ex) { throw ex; } catch (Exception ex) { throw new RuntimeException(ex); } }
public void testGeometryFactoryHintsGF() throws IOException { SimpleFeatureSource fs = dataStore.getFeatureSource(tname("road")); assertTrue(fs.getSupportedHints().contains(Hints.JTS_GEOMETRY_FACTORY)); Query q = new Query(tname("road")); GeometryFactory gf = new GeometryFactory(new LiteCoordinateSequenceFactory()); Hints hints = new Hints(Hints.JTS_GEOMETRY_FACTORY, gf); q.setHints(hints); try (SimpleFeatureIterator it = fs.getFeatures(q).features()) { it.hasNext(); SimpleFeature f = (SimpleFeature) it.next(); LineString ls = (LineString) f.getDefaultGeometry(); assertTrue(ls.getCoordinateSequence() instanceof LiteCoordinateSequence); } }
public void testGeometryFactoryHintsCS() throws IOException { SimpleFeatureSource fs = dataStore.getFeatureSource(tname("road")); assertTrue(fs.getSupportedHints().contains(Hints.JTS_COORDINATE_SEQUENCE_FACTORY)); Query q = new Query(tname("road")); Hints hints = new Hints( Hints.JTS_COORDINATE_SEQUENCE_FACTORY, new LiteCoordinateSequenceFactory()); q.setHints(hints); try (SimpleFeatureIterator it = fs.getFeatures(q).features()) { it.hasNext(); SimpleFeature f = (SimpleFeature) it.next(); LineString ls = (LineString) f.getDefaultGeometry(); assertTrue(ls.getCoordinateSequence() instanceof LiteCoordinateSequence); } }
public Set<Key> getSupportedHints() { if (supportedHints != null) return supportedHints; Set<Key> hints = new HashSet<Key>(); // calculate the supported hints, which is the intersection of supported Hints for all // feature sources try { hints.addAll(getBaseFeatureSource().getSupportedHints()); // start with base feature // source for (Generalization di : info.getGeneralizations()) { SimpleFeatureSource fs = getFeatureSourceFor(di); hints.retainAll(fs.getSupportedHints()); } } catch (IOException ex) { throw new RuntimeException(ex); } ; hints.add(Hints.GEOMETRY_DISTANCE); // always supported supportedHints = Collections.unmodifiableSet(hints); return supportedHints; }
public void testSimplification() throws Exception { SimpleFeatureSource fs = dataStore.getFeatureSource(tname("road")); if (fs.getSupportedHints().contains(Hints.GEOMETRY_SIMPLIFICATION) == false) return; SimpleFeatureCollection fColl = fs.getFeatures(); Geometry original = null; try (SimpleFeatureIterator iterator = fColl.features()) { if (iterator.hasNext()) { original = (Geometry) iterator.next().getDefaultGeometry(); } } double width = original.getEnvelope().getEnvelopeInternal().getWidth(); Query query = new Query(); Hints hints = new Hints(Hints.GEOMETRY_SIMPLIFICATION, width / 2); query.setHints(hints); Geometry simplified = null; fColl = fs.getFeatures(query); try (SimpleFeatureIterator iterator = fColl.features()) { if (iterator.hasNext()) simplified = (Geometry) iterator.next().getDefaultGeometry(); } assertTrue(original.getNumPoints() >= simplified.getNumPoints()); }
public void testGeneralization() throws Exception { SimpleFeatureSource fs = dataStore.getFeatureSource(tname("lake")); if (fs.getSupportedHints().contains(Hints.GEOMETRY_GENERALIZATION) == false) return; SimpleFeatureCollection fColl = fs.getFeatures(); Geometry original = null; try (SimpleFeatureIterator iterator = fColl.features()) { if (iterator.hasNext()) { original = (Geometry) iterator.next().getDefaultGeometry(); } } double width = original.getEnvelope().getEnvelopeInternal().getWidth(); Query query = new Query(); Hints hints = new Hints(Hints.GEOMETRY_GENERALIZATION, width / 2); query.setHints(hints); Geometry generalized = null; fColl = fs.getFeatures(query); try (SimpleFeatureIterator iterator = fColl.features()) { if (iterator.hasNext()) { generalized = (Geometry) iterator.next().getDefaultGeometry(); } } assertTrue(original.getNumPoints() >= generalized.getNumPoints()); }