@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); } } }
@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 (pg.contains(tileBBox)) // geometry fully covers the tile?
@Override public boolean compare( final Geometry dataGeometry, final PreparedGeometry constraintGeometry) { return constraintGeometry.contains(dataGeometry); }
if (representativeGeom.contains(pp)) { count++;
public static boolean preparedContains(Geometry g1, Geometry g2) { return createPG(g1).contains(g2); }
public static boolean contains(Geometry g1, Geometry g2) { PreparedGeometry prepGeom = PreparedGeometryFactory.prepare(g1); return prepGeom.contains(g2); } public static boolean containsProperly(Geometry g1, Geometry g2)
if (validaAreaTester.contains(JTS.toGeometry(geWGS84))) { return geometry;
/** * 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); }
/** * 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); }
/** * 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); }
private void checkContains(PreparedGeometry pg, Geometry g2) { boolean pgResult = pg.contains(g2); boolean expected = pg.getGeometry().contains(g2); if (pgResult != expected) throw new IllegalStateException("PreparedGeometry.contains result does not match expected"); // System.out.println("Results match!"); }
public static boolean contains(Geometry g1, Geometry g2) { PreparedGeometryFactory pgFact = new PreparedGeometryFactory(); PreparedGeometry prepGeom = pgFact.create(g1); return prepGeom.contains(g2); } public static boolean covers(Geometry g1, Geometry g2)
public static boolean covers(Geometry g1, Geometry g2) { PreparedGeometryFactory pgFact = new PreparedGeometryFactory(); PreparedGeometry prepGeom = pgFact.create(g1); return prepGeom.contains(g2); } }
/** * 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.setOrdinate(0, 0, x); testPointCS.setOrdinate(0, 1, y); testPoint.geometryChanged(); return theGeom.contains(testPoint); }
/** * 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); testPointCS.setY(0, y); testPoint.geometryChanged(); return theGeom.contains(testPoint); }
/** * 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.setOrdinate(0, 0, x); testPointCS.setOrdinate(0, 1, y); testPoint.geometryChanged(); return theGeom.contains(testPoint); }
public boolean checkContains(Geometry target, Geometry test) { boolean expectedResult = target.contains(test); PreparedGeometryFactory pgFact = new PreparedGeometryFactory(); PreparedGeometry prepGeom = pgFact.create(target); boolean prepResult = prepGeom.contains(test); if (prepResult != expectedResult) { return false; } return true; }