public static Geometry envelope(Geometry arg0) { if (arg0 == null) return null; Geometry _this = arg0; return _this.getEnvelope(); }
public ClippingFeatureIterator( SimpleFeatureIterator delegate, Geometry clip, SimpleFeatureType schema, boolean preserveZ) { this.delegate = delegate; // can we use the fast clipper? if (clip.getEnvelope().equals(clip)) { this.clipper = new GeometryClipper(clip.getEnvelopeInternal()); } else { this.clip = clip; } fb = new SimpleFeatureBuilder(schema); this.preserveZ = preserveZ; }
return toSDOGeom((LineString) geometry, srid); } else if (Polygon.class.isAssignableFrom(geometry.getClass())) { if (geometry.equalsTopo(geometry.getEnvelope())) { return toSDOGeom(geometry.getEnvelopeInternal(), srid); } else {
public Geometry getEnvelope() { return geometry.getEnvelope(); }
@Override public ROI intersect(ROI roi) { final Geometry geom = getGeometry(roi); // is it a rectangle? if (geom != null && geom.equalsExact(geom.getEnvelope())) { GeometryClipper clipper = new GeometryClipper(geom.getEnvelopeInternal()); Geometry intersect = clipper.clip(getAsGeometry(), true); return new ROIGeometry(intersect); } else { return super.intersect(roi); } }
Coordinate[] coords = geometry.getEnvelope().getCoordinates();
@Override public ROI intersect(ROI roi) { final Geometry geom = getGeometry(roi); // is it a rectangle? if (geom != null && geom.equalsExact(geom.getEnvelope())) { GeometryClipper clipper = new GeometryClipper(geom.getEnvelopeInternal()); Geometry intersect = clipper.clip(getAsGeometry(), true); return new ROIGeometry(intersect, hints); } else { return super.intersect(roi); } }
@DescribeProcess( title = "Envelope", description = "Returns the smallest bounding box polygon that contains a geometry. For a point geometry, returns the same point." ) @DescribeResult(description = "Envelope of the input geometry") public static Geometry envelope( @DescribeParameter(name = "geom", description = "Input geometry") Geometry geom) { return geom.getEnvelope(); }
final Envelope envelope = granuleFootprint.getEnvelope().getEnvelopeInternal(); double deltaMinX = Math.abs(envelope.getMinX() - granuleBBOX.getMinX()); double deltaMinY = Math.abs(envelope.getMinY() - granuleBBOX.getMinY());
/** * @param geometry Geometry instance * @return Geometry envelope */ public static Geometry getEnvelope(Geometry geometry) { if(geometry==null) { return null; } return geometry.getEnvelope(); } }
filterBBox( ReferencedEnvelope.reference( g1.getEnvelope().getEnvelopeInternal()), ft);
@Override protected Geometry getGeometryResult() { if (result != null) { return result.getEnvelope(); } return null; }
filterBBox( ReferencedEnvelope.reference( g1.getEnvelope().getEnvelopeInternal()), ft);
if (maskingBuffer > 0) { Geometry mappedMaskBox = mappedMask.getEnvelope();
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()); }
.encode(elems[0], lf.getExpression2(), output, hints); // prop name Geometry g = ((Geometry) ((Literal) lf.getExpression1()).getValue()).getEnvelope(); elems[1].getType().encode(elems[1], g, output, hints); // geom } else { ((Geometry) ((Literal) lf.getExpression2()).getValue()).getEnvelope(); elems[1].getType().encode(elems[1], g, output, hints); // geom } else {
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()); }
@Override protected void add(Geometry geometry) { if (result == null) { result = geometry; } else { if (geometry != null) { result = result.union(geometry.getEnvelope()); } } }
@Override protected void add(Geometry geometry) { if (result == null) { result = geometry; } else { if (geometry != null) { result = result.union(geometry.getEnvelope()); } } }
SimpleFeature second = iterator.next(); if (currentGeom .getEnvelope() .intersects(((Geometry) second.getDefaultGeometry()))) {