public static boolean contains(GeometryFactory gf, Collection<PreparedGeometry> geometries, double lat, double lon) { Point point = gf.createPoint(new Coordinate(lon, lat)); for (PreparedGeometry g : geometries) { if (g.contains(point)) return true; } return false; } }
geoCoding.getGeoPos(pixelPos, geoPos); Point point = geometryFactory.createPoint(new Coordinate(geoPos.lon, geoPos.lat)); if (preparedGeometry.contains(point)) { matches++;
private boolean acceptGeoPos(GeoPos geoPos) { return region == null || region.contains(geometryFactory.createPoint(new Coordinate(geoPos.lon, geoPos.lat))); }
public boolean containsCoordinates(double x, double y) { checkPreparedShape(); return preparedShape == null ? value.contains(gFactory.createPoint(new Coordinate(x, y))) : preparedShape.contains(gFactory.createPoint(new Coordinate(x, y))); }
/** * Tests if this ROI contains the given rectangle. * * @param x rectangle origin X ordinate * @param y rectangle origin Y ordinate * @param w rectangle width * @param h rectangle height * * @return {@code true} if the rectangle is within this ROI; * {@code false} otherwise */ @Override public boolean contains(double x, double y, double w, double h) { setTestRect(x, y, w, h); return theGeom.contains(testRect); }
@Override public boolean evaluateInternal(Geometry left, Geometry right) { switch (literals) { case BOTH: return cacheValue; case RIGHT: { // since it is left contains right there is no // benefit of having a prepared geometry for the right side return basicEvaluate(left, right); } case LEFT: { return leftPreppedGeom.contains(right); } default: { return basicEvaluate(left, right); } } }
public static Point getRandomPointInGeometry(final PreparedGeometry geometry) { return getRandomPointInEnvelope(p -> geometry.contains(p), geometry.getGeometry().getEnvelopeInternal()); }
/** * Tests if this ROI contains the given image location. * * @param x location X ordinate * @param y location Y ordinate * * @return {@code true} if the location is within this ROI; * {@code false} otherwise */ @Override public boolean contains(double x, double y) { testPointCS.setX(0, x + delta); testPointCS.setY(0, y + delta); testPoint.geometryChanged(); return theGeom.contains(testPoint); }
if (geom.contains(testRect)) { return getSolidTile(); } else if (geom.disjoint(testRect)) {
@Override public boolean evaluateInternal(Geometry left, Geometry right) { switch (literals) { case BOTH: return cacheValue; case RIGHT: { // if the right contains left then left is within right return rightPreppedGeom.contains(left); } case LEFT: { // since within does not have an optimization with prepared geometries // there is nothing to be gained in this case so use the normal check return basicEvaluate(leftPreppedGeom.getGeometry(), right); } default: { return basicEvaluate(left, right); } } }
if (representativeGeom.contains(pp)) { count++;
if (!boundsGeometry.contains(cellGeom)) { xpos += width; continue;
} else if (!praparedGeom.contains(voronoiPolygon)) { finalVoronoi = voronoiPolygon.intersection(clipPolygon); if (finalVoronoi == null || finalVoronoi.isEmpty()) {