public ReferencedEnvelope getBounds(Query query) throws IOException { return delegate.getBounds(query); }
public ReferencedEnvelope getBounds() throws IOException { return delegate.getBounds(); }
/** * Retreives the bounds for a feature source. * * <p>If the feautre source can calculate the bounds directly, those bounds are returned. * Otherwise, the underlying feature collection is retreived and asked to calculate bounds. If * that fails, an empty envelope is returned. * * @param fs The feature source. * @return The bounds. * @throws IOException Execption calculating bounds on feature source. */ public static ReferencedEnvelope getBoundingBoxEnvelope( FeatureSource<? extends FeatureType, ? extends Feature> fs) throws IOException { ReferencedEnvelope ev = fs.getBounds(); if ((ev == null) || ev.isNull()) { try { ev = fs.getFeatures().getBounds(); } catch (Throwable t) { LOGGER.log( Level.FINE, "Could not compute the data bounding box. Returning an empty envelope", t); ev = new ReferencedEnvelope(fs.getSchema().getCoordinateReferenceSystem()); } } return ev; } }
public FeatureSourceWrappingFeatureTypeInfoImpl(FeatureSource featureSource) throws IOException, TransformException, FactoryException { super(); this.featureSource = featureSource; setName(featureSource.getName().getLocalPart()); setEnabled(true); setLatLonBoundingBox( featureSource.getBounds().transform(DefaultGeographicCRS.WGS84, true)); }
public void setNativeBox(Catalog catalog, String name) throws Exception { FeatureTypeInfo fti = catalog.getFeatureTypeByName(name); fti.setNativeBoundingBox(fti.getFeatureSource(null, null).getBounds()); fti.setLatLonBoundingBox( new ReferencedEnvelope(fti.getNativeBoundingBox(), DefaultGeographicCRS.WGS84)); catalog.save(fti); }
@Override public ReferencedEnvelope getBounds() { try { return fs.getBounds(); } catch (IOException e) { return null; } }
public ReferencedEnvelope getBounds(Query query) throws IOException { return delegate.getBounds(query); }
public ReferencedEnvelope getBounds() throws IOException { return delegate.getBounds(); }
@Override public ReferencedEnvelope getBounds(Query query) throws IOException { return dataAccess.getFeatureSource(typeName).getBounds(query); }
@Override public ReferencedEnvelope getBounds() throws IOException { return dataAccess.getFeatureSource(typeName).getBounds(); }
/** * Computes the bounds of the features for the specified feature type that satisfy the query * provided that there is a fast way to get that result. * * <p>Will return null if there is not fast way to compute the bounds. Since it's based on some * kind of header/cached information, it's not guaranteed to be real bound of the features * * @param query * @return the bounds, or null if too expensive * @throws SchemaNotFoundException * @throws IOException */ protected ReferencedEnvelope getBounds(Query query) throws IOException { FeatureTypeMapping mapping = getMappingByNameOrElement(getName(query)); Query unmappedQuery = unrollQuery(query, mapping); return mapping.getSource().getBounds(unmappedQuery); }
public void testBounds() throws Exception { FeatureSource fsView = dataStore.getFeatureSource("riverReduced"); ReferencedEnvelope env = fsView.getBounds(); assertNotNull(env); // perform the same tests with the place holder for the where clause fsView = dataStore.getFeatureSource("riverFullPlaceHolder"); env = fsView.getBounds(); assertNotNull(env); }
@Override public ReferencedEnvelope getBounds() { try { return fs.getBounds(); } catch (IOException e) { return null; } }
public ReferencedEnvelope getBounds () throws IOException { return source.getBounds(); }
BufferedImage render(FeatureSource[] sources, Style[] styles) throws Exception { DefaultMapContext map = new DefaultMapContext(); ReferencedEnvelope env = sources[0].getBounds(); for (int i = 1; i < sources.length; i++) { env.expandToInclude(sources[i].getBounds()); } map.setAreaOfInterest(env); map.setCoordinateReferenceSystem(env.getCoordinateReferenceSystem()); for (int i = 0; i < sources.length; i++) { if (styles[i] != null) { map.addLayer(sources[i], styles[i]); } } try { StreamingRenderer r = new StreamingRenderer(); r.setJava2DHints(new RenderingHints(KEY_ANTIALIASING, VALUE_ANTIALIAS_ON)); r.setContext(map); return RendererBaseTest.showRender("testPointLabeling", r, 5000, env); } finally { map.dispose(); } }
public void testFeatureSource() throws Exception { FeatureSource fs = dataStore.getFeatureSource(tname("empty")); assertNotNull(fs); ReferencedEnvelope bounds = fs.getBounds(); assertTrue(bounds.isNull()); int count = fs.getCount(Query.ALL); assertEquals(0, count); }
query = new Query(schema.getName().getLocalPart()); query.setProperties(attributes); Envelope bounds = source.getBounds(); if (bounds != null && envelope.intersects(bounds)) { LOGGER.log(
@Override public ReferencedEnvelope getBounds(Query query) throws IOException { return dataAccess.getFeatureSource(typeName).getBounds(query); }