public ReferencedEnvelope getBounds() throws IOException { // not fully correct if we use this to shave attributes too, but this is // not in the scope now return wrapped.getBounds(); }
public ReferencedEnvelope getBounds(Query query) throws IOException { return delegate.getBounds(query); }
public ReferencedEnvelope getBounds() throws IOException { return delegate.getBounds(); }
public ReferencedEnvelope getBounds(Query query) throws IOException { // not fully correct if we use this to shave attributes too, but this is // not in the scope now return wrapped.getBounds(store.retypeQuery(query, typeMap)); }
/** * Retrive the extent of the Query. * * <p>This method provides access to an optimized getBounds opperation. If no optimized * opperation is available <code>null</code> will be returned. * * <p>You may still make use of getFeatures( Query ).getCount() which will return the correct * answer (even if it has to itterate through all the results to do so. * * @param query User's query * @return Extend of Query or <code>null</code> if no optimization is available * @throws IOException If a problem is encountered with source */ public ReferencedEnvelope getBounds(Query query) throws IOException { // since CRS is at most forced, we don't need to change this code try { query = makeDefinitionQuery(query, schema); } catch (IOException ex) { return null; } return source.getBounds(query); }
/** * Retrieves the total extent of this FeatureSource. * * <p>Please note this extent will reflect the provided definitionQuery. * * @return Extent of this FeatureSource, or <code>null</code> if no optimizations exist. * @throws IOException If bounds of definitionQuery */ public ReferencedEnvelope getBounds() throws IOException { // since CRS is at most forced, we don't need to change this code if (definitionQuery == Filter.INCLUDE) { return source.getBounds(); } else { Query query = new Query(getSchema().getTypeName(), definitionQuery); return source.getBounds(query); } }
public ReferencedEnvelope getBounds(Query query) throws IOException { return fsource.getBounds(query); }
public ReferencedEnvelope getBounds() throws IOException { return wrapped.getBounds(); }
public ReferencedEnvelope getBounds(Query query) throws IOException { return wrapped.getBounds(query); }
public CachingFeatureSource(SimpleFeatureSource original) throws IOException { this.wrapped = original; this.originalBounds = original.getBounds(); if (originalBounds == null) originalBounds = new Envelope( -Double.MAX_VALUE, Double.MAX_VALUE, -Double.MAX_VALUE, Double.MAX_VALUE); }
public ReferencedEnvelope getBounds(final String typeName) { final Lock lock = rwLock.readLock(); try { lock.lock(); checkStore(); return this.slicesIndexStore.getFeatureSource(typeName).getBounds(); } catch (IOException e) { LOGGER.log(Level.FINER, e.getMessage(), e); return null; } finally { lock.unlock(); } }
@Override public BoundingBox getBounds(final String typeName) { try { checkStore(); return this.getTileIndexStore().getFeatureSource(typeName).getBounds(); } catch (IOException e) { LOGGER.log(Level.FINER, e.getMessage(), e); } return null; }
public ReferencedEnvelope getBounds(Query query) throws IOException { // SimpleFeatureSource fs = getFeatureSourceFor(query); // Query newQuery=getProxyObject(query, fs); // return fs.getBounds(newQuery); Query newQuery = getProxyObject(query, getBaseFeatureSource()); return getBaseFeatureSource().getBounds(newQuery); }
@Before public void setUp() throws Exception { File property = new File(TestData.getResource(this, "line.properties").toURI()); PropertyDataStore ds = new PropertyDataStore(property.getParentFile()); fs = ds.getFeatureSource("line"); bounds = fs.getBounds(); bounds.expandBy(3, 3); bfs = ds.getFeatureSource("buildings"); bbounds = bfs.getBounds(); bbounds.expandBy(3, 3); // System.setProperty("org.geotools.test.interactive", "true"); }
@Before public void setUp() throws Exception { File property = new File(TestData.getResource(this, "square.properties").toURI()); PropertyDataStore ds = new PropertyDataStore(property.getParentFile()); fs = ds.getFeatureSource("square"); bfs = ds.getFeatureSource("bigsquare"); bounds = fs.getBounds(); bounds.expandBy(0.2, 0.2); // System.setProperty("org.geotools.test.interactive", "true"); }
@Before public void setUp() throws Exception { File property = new File(TestData.getResource(this, "squareUTM.properties").toURI()); PropertyDataStore ds = new PropertyDataStore(property.getParentFile()); fs = ds.getFeatureSource("square"); bounds = fs.getBounds(); bounds.expandBy(0.5); RendererBaseTest.setupVeraFonts(); }
@Before public void setUp() throws Exception { File property = new File(TestData.getResource(this, "zorder/zsquares.properties").toURI()); PropertyDataStore ds = new PropertyDataStore(property.getParentFile()); zsquares = ds.getFeatureSource("zsquares"); zroads = ds.getFeatureSource("zroads"); zbuildings = ds.getFeatureSource("zbuildings"); bounds = zsquares.getBounds(); bounds.expandBy(0.2, 0.2); // System.setProperty("org.geotools.test.interactive", "true"); }
@Test public void testBounds() throws Exception { ReferencedEnvelope bounds2d = point_test_2d.getBounds(); ReferencedEnvelope bounds3d = point_test.getBounds(); double aspect2d = bounds2d.getWidth() / bounds2d.getHeight(); double aspect3d = bounds3d.getWidth() / bounds3d.getHeight(); assertEquals(aspect2d, aspect3d, 0.0005); ReferencedEnvelope bbox2d = JTS.toGeographic(bounds2d); ReferencedEnvelope bbox3d = JTS.toGeographic(bounds3d); aspect2d = bbox2d.getWidth() / bbox2d.getHeight(); aspect3d = bbox3d.getWidth() / bbox3d.getHeight(); assertEquals(aspect2d, aspect3d, 0.000005); }
public void testGetBoundsSupportsFeaturesWithoutGeometry() throws Exception { SimpleFeatureBuilder featureBuilder = new SimpleFeatureBuilder(data.getSchema("road")); featureBuilder.init(roadFeatures[0]); featureBuilder.set("geom", null); SimpleFeature feature = featureBuilder.buildFeature("road.rd0"); data.addFeature(feature); SimpleFeatureSource road = data.getFeatureSource("road"); assertEquals(roadBounds, road.getBounds(Query.ALL)); }
public void testGetBoundsSupportsEmptyBounds() throws Exception { SimpleFeatureType type = DataUtilities.createType(getName() + ".test", "id:0,geom:LineString,name:String"); SimpleFeature[] features = new SimpleFeature[3]; features[0] = SimpleFeatureBuilder.build(type, new Object[] {1, null, "r1"}, "test.f1"); features[1] = SimpleFeatureBuilder.build(type, new Object[] {2, null, "r2"}, "test.f2"); features[2] = SimpleFeatureBuilder.build(type, new Object[] {3, null, "r3"}, "test.f3"); data.addFeatures(features); SimpleFeatureSource featureSource = data.getFeatureSource("test"); assertTrue(featureSource.getBounds(Query.ALL).isEmpty()); } }