/** * Get the total bounds of this feature which is calculated by doing a union of the bounds of * each geometry this feature is associated with. * * @return An Envelope containing the total bounds of this Feature. * @task REVISIT: what to return if there are no geometries in the feature? For now we'll return * a null envelope, make this part of interface? (IanS - by OGC standards, all Feature must * have geom) */ public BoundingBox getBounds() { ReferencedEnvelope bounds = new ReferencedEnvelope(getType().getCoordinateReferenceSystem()); for (Iterator itr = getValue().iterator(); itr.hasNext(); ) { Property property = (Property) itr.next(); if (property instanceof GeometryAttribute) { bounds.include(((GeometryAttribute) property).getBounds()); } } return bounds; }
/** * Get the total bounds of this feature which is calculated by doing a union * of the bounds of each geometry this feature is associated with. * * @return An Envelope containing the total bounds of this Feature. * * @task REVISIT: what to return if there are no geometries in the feature? * For now we'll return a null envelope, make this part of interface? * (IanS - by OGC standards, all Feature must have geom) */ public BoundingBox getBounds() { ReferencedEnvelope bounds = new ReferencedEnvelope(getType().getCoordinateReferenceSystem()); for (Iterator itr = getValue().iterator(); itr.hasNext();) { Property property = (Property) itr.next(); if (property instanceof GeometryAttribute) { bounds.include(((GeometryAttribute)property).getBounds()); } } return bounds; }
bbox.setBounds(indGeoAttr.getBounds()); BBOX filter = ff.bbox(ff.property(geometryPropertyName), bbox); FeatureCollection<?, ?> dissCollection = dissSource.getFeatures(filter);