/** * Returns {@code true} if the provided bounds are contained by this bounding box. * * @since 2.4 */ public boolean contains(final BoundingBox bbox) { ensureCompatibleReferenceSystem(bbox); return super.contains(getJTSEnvelope(bbox)); }
boolean isSubQuery(Query query) { // no cached data? if (cachedQuery == null) return false; // do we miss some properties? String[] cachedPropNames = cachedQuery.getPropertyNames(); String[] propNames = query.getPropertyNames(); if (cachedPropNames != Query.ALL_NAMES && (propNames == Query.ALL_NAMES || !Arrays.asList(cachedPropNames).containsAll(Arrays.asList(propNames)))) return false; Filter[] filters = splitFilters(query); Filter[] cachedFilters = splitFilters(cachedQuery); if (!filters[0].equals(cachedFilters[0])) return false; Envelope envelope = getEnvelope(filters[1]); return cachedBounds.contains(envelope); }
@Override protected boolean basicEvaluate(Geometry left, Geometry right) { Envelope envLeft = left.getEnvelopeInternal(); Envelope envRight = right.getEnvelopeInternal(); if (envRight.contains(envLeft)) return left.within(right); else return false; } }
/** * Returns {@code true} if the provided location is contained by this bounding box. * * @since 2.4 */ public boolean contains(DirectPosition pos) { ensureCompatibleReferenceSystem(pos); return super.contains(pos.getOrdinate(0), pos.getOrdinate(1)); }
@Override protected boolean basicEvaluate(Geometry left, Geometry right) { Envelope envLeft = left.getEnvelopeInternal(); Envelope envRight = right.getEnvelopeInternal(); if (envLeft.contains(envRight)) return left.contains(right); return false; }
private Geometry clipToWorldFeatureTypeGeometry(Geometry geom) { // Oracle cannot deal with filters using geometries that span beyond the whole world if (isFeatureTypeGeometryGeodetic() && !WORLD.contains(geom.getEnvelopeInternal())) { Geometry result = geom.intersection(JTS.toGeometry(WORLD)); if (result != null && !result.isEmpty()) { if (result instanceof GeometryCollection) { result = distillSameTypeGeometries((GeometryCollection) result, geom); } return result; } } return geom; }
if (displayGeomEnv.contains(poly.getEnvelopeInternal())) {
SimpleFeature line = fLine.next(); Geometry lineGeom = (Geometry) line.getDefaultGeometry(); if (envelope.contains(lineGeom.getEnvelopeInternal())) {
Expression clipToWorld(BinarySpatialOperator filter, Expression e) { if (e instanceof Literal) { Geometry eval = e.evaluate(filter, Geometry.class); // Oracle cannot deal with filters using geometries that span beyond the whole world // in case the if (dialect != null && isCurrentGeometryGeodetic() && !WORLD.contains(eval.getEnvelopeInternal())) { Geometry result = eval.intersection(JTS.toGeometry(WORLD)); if (result != null && !result.isEmpty()) { if (result instanceof GeometryCollection) { result = distillSameTypeGeometries((GeometryCollection) result, eval); } FilterFactory2 ff = CommonFactoryFinder.getFilterFactory2(); e = ff.literal(result); } } } return e; }
Envelope env = g.getEnvelopeInternal(); if (!WORLD.contains(env)) { g = sanitizePolygons(g.intersection(JTS.toGeometry(WORLD)));
@Test public void testUTMDatelineWrapping() throws Exception { CoordinateReferenceSystem crs = CRS.decode("EPSG:32601", true); ReferencedEnvelope re = new ReferencedEnvelope(300000, 409800, 5890200, 6000000, crs); MathTransform mt = CRS.findMathTransform(crs, WGS84); Geometry geom = JTS.toGeometry(re); ReferencedEnvelope targetReferenceEnvelope = new ReferencedEnvelope(-180, 180, -90, 90, WGS84); ProjectionHandler ph = ProjectionHandlerFinder.getHandler(targetReferenceEnvelope, crs, true); Geometry preProcessed = ph.preProcess(geom); Geometry transformed = JTS.transform(preProcessed, mt); Geometry postProcessed = ph.postProcess(mt.inverse(), transformed); // sits across the dateline and it's "small" (used to cover the entire planet) Envelope ppEnvelope = postProcessed.getGeometryN(0).getEnvelopeInternal(); assertTrue(ppEnvelope.contains(180, 54)); // the original width is 109km, at this latitude one degree of longitude is only 65km assertEquals(1.7, ppEnvelope.getWidth(), 0.1); }
if (clipper.getBounds().contains(line.getEnvelopeInternal())) {
if (((Envelope) gridBounds).contains(el.getBounds())) { if (gridFeatureBuilder.getCreateFeature(el)) { Map<String, Object> attrMap = new HashMap<String, Object>();
return null; if (bounds.contains(geomEnvelope)) { return g; } else if (!bounds.intersects(geomEnvelope)) {