requestedGridGeometry = (GridGeometry2D) value.getValue(); ReferencedEnvelope requestedEnvelope = ReferencedEnvelope.reference(requestedGridGeometry.getEnvelope()); ReferencedEnvelope dataEnvelope = ReferencedEnvelope.reference(handler.getOriginalEnvelope()); if (CRS.equalsIgnoreMetadata(requestedEnvelope, dataEnvelope)) { if (!requestedEnvelope.intersects((BoundingBox) dataEnvelope)) {
protected GMLFeatureCollection(String id, Envelope b) { super(id, null); bounds = ReferencedEnvelope.reference(b); } /* (non-Javadoc)
/** * Utility method to ensure that an BoundingBox in a ReferencedEnvelope. * * <p>This method first checks if <tt>e</tt> is an instanceof {@link ReferencedEnvelope}, if it * is, itself is returned. If not <code>new ReferencedEnvelpe(e)</code> is returned. * * @param e The envelope. * @return */ public static ReferencedEnvelope reference(ReferencedEnvelope e) { return reference((org.opengis.geometry.Envelope) e); }
/** @see org.geotools.data.FeatureResults#getBounds() */ public ReferencedEnvelope getBounds() { return ReferencedEnvelope.reference(bounds); }
/** @param feature */ public CoverageSlice(final SimpleFeature feature) { this.granuleBBOX = ReferencedEnvelope.reference(feature.getBounds()); this.originator = feature; }
/** * This method is responsible for initializing the bbox for the mosaic produced by this * response. */ private void initBBOX() { // ok we got something to return, let's load records from the index final BoundingBox cropBBOX = request.spatialRequestHelper.getCropBBox(); if (cropBBOX != null) { targetBBox = ReferencedEnvelope.reference(cropBBOX); } else { targetBBox = new ReferencedEnvelope(coverageEnvelope); } }
/** * This method is responsible for initializing the bbox for the mosaic produced by this * response. */ private void initBBOX() { // ok we got something to return, let's load records from the index final BoundingBox cropBBOX = request.spatialRequestHelper.getComputedBBox(); if (cropBBOX != null) { mosaicBBox = ReferencedEnvelope.reference(cropBBOX); } else { mosaicBBox = new ReferencedEnvelope(coverageEnvelope); } }
public boolean add(SimpleFeature feature) { ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); index.insert(bounds, feature); return false; }
public boolean addAll(Collection<? extends SimpleFeature> collection) { for (SimpleFeature feature : collection) { try { ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); index.insert(bounds, feature); } catch (Throwable t) { } } return false; }
@SuppressWarnings("unchecked") public List<GranuleDescriptor> getGranules(final BoundingBox envelope) throws IOException { Utilities.ensureNonNull("envelope", envelope); final Lock lock = rwLock.readLock(); try { lock.lock(); checkStore(); checkIndex(lock); return index.query(ReferencedEnvelope.reference(envelope)); } finally { lock.unlock(); } }
public void fireFeatureRemoved(FeatureSource<?, ?> source, Feature feature) { if (listeners.isEmpty() && tx != Transaction.AUTO_COMMIT) return; Filter filter = idFilter(feature); ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); FeatureEvent event = new FeatureEvent(source, Type.REMOVED, bounds, filter); fireFeatureEvent(event); }
@Override public Object visit(BBOX filter, Object data) { final ReferencedEnvelope bbox = ReferencedEnvelope.reference(filter.getBounds()); if (this.bbox != null) { this.bbox = (ReferencedEnvelope) this.bbox.intersection(bbox); } else { this.bbox = bbox; } return super.visit(filter, data); } }
private ReferencedEnvelope extractAndCombineBBox(Filter filter) { final Utils.BBOXFilterExtractor bboxExtractor = new Utils.BBOXFilterExtractor(); filter.accept(bboxExtractor, null); BoundingBox bbox = wrappedCatalogue.getBounds(typeName); return ReferencedEnvelope.reference(bbox); }
/** * Used to issue a Type.ADDED FeatureEvent indicating a new feature being created * * @param source * @param feature */ public final void fireFeatureAdded(FeatureSource<?, ?> source, Feature feature) { if (listeners.isEmpty() && tx != Transaction.AUTO_COMMIT) return; Filter filter = idFilter(feature); ReferencedEnvelope bounds = ReferencedEnvelope.reference(feature.getBounds()); FeatureEvent event = new FeatureEvent(source, Type.ADDED, bounds, filter); fireFeatureEvent(event); }
/** * Include the provided bounding box, expanding as necessary. * * @since 2.4 */ public void include(final BoundingBox bbox) { if (crs == null) { this.crs = bbox.getCoordinateReferenceSystem(); } else { ensureCompatibleReferenceSystem(bbox); } expandToInclude(ReferencedEnvelope.reference(bbox)); } /**
protected void addToSpatialIndex(SimpleFeature f) { if (f.getDefaultGeometry() != null) { BoundingBox bounds = f.getBounds(); if (!bounds.isEmpty()) spatialIndex.insert(ReferencedEnvelope.reference(bounds), f); } }
/** @see org.geotools.data.FeatureWriter#remove() */ public void remove() throws IOException { if (live != null) { // mark live as removed diff.remove(live.getID()); fireNotification( FeatureEvent.FEATURES_REMOVED, ReferencedEnvelope.reference(live.getBounds())); live = null; current = null; } else if (current != null) { // cancel additional content current = null; } }
private void fireAdded(final SimpleFeature addedFeature) { final String typeName = featureType.getTypeName(); final BoundingBox bounds = addedFeature.getBounds(); ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds); String fid = addedFeature.getID(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); Filter filter = ff.id(Collections.singleton(ff.featureId(fid))); doFireFeaturesAdded(typeName, referencedEnvelope, filter); }
private void fireRemoved(final SimpleFeature removedFeature) { String typeName = featureType.getTypeName(); BoundingBox bounds = removedFeature.getBounds(); ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds); String fid = removedFeature.getID(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); Filter filter = ff.id(Collections.singleton(ff.featureId(fid))); doFireFeaturesRemoved(typeName, referencedEnvelope, filter); }
private void fireChanged(final SimpleFeature changedFeature) { final String typeName = featureType.getTypeName(); final BoundingBox bounds = changedFeature.getBounds(); ReferencedEnvelope referencedEnvelope = ReferencedEnvelope.reference(bounds); String fid = changedFeature.getID(); FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(null); Filter filter = ff.id(Collections.singleton(ff.featureId(fid))); doFireFeaturesChanged(typeName, referencedEnvelope, filter); }