public boolean isInside(Coordinate pt) { return CGAlgorithms.isPointInRing(pt, pts); } }
public boolean contains(Coordinate pt) { Coordinate[] ring = getCoordinates(); return CGAlgorithms.isPointInRing(pt, ring); }
/** * This method will cause the ring to be computed. * It will also check any holes, if they have been assigned. */ public boolean containsPoint(Coordinate p) { LinearRing shell = getLinearRing(); Envelope env = shell.getEnvelopeInternal(); if (! env.contains(p)) return false; if (! CGAlgorithms.isPointInRing(p, shell.getCoordinates()) ) return false; for (Iterator i = holes.iterator(); i.hasNext(); ) { EdgeRing hole = (EdgeRing) i.next(); if (hole.containsPoint(p) ) return false; } return true; }
/** * Determines whether a point lies in a LinearRing, * using the ring envelope to short-circuit if possible. * * @param p the point to test * @param ring a linear ring * @return true if the point lies inside the ring */ private static boolean isPointInRing(Coordinate p, LinearRing ring) { // short-circuit if point is not in ring envelope if (! ring.getEnvelopeInternal().intersects(p)) return false; return CGAlgorithms.isPointInRing(p, ring.getCoordinates()); }
if (! CGAlgorithms.isPointInRing(inputPts[i], polyPts)) { reducedSet.add(inputPts[i]);
boolean insideHole = CGAlgorithms.isPointInRing(shellPt, holePts); if (! insideHole) { return shellPt; boolean insideShell = CGAlgorithms.isPointInRing(holePt, shellPts); if (insideShell) { return holePt;
public boolean isNonNested() { for (int i = 0; i < rings.size(); i++) { LinearRing innerRing = (LinearRing) rings.get(i); Coordinate[] innerRingPts = innerRing.getCoordinates(); for (int j = 0; j < rings.size(); j++) { LinearRing searchRing = (LinearRing) rings.get(j); Coordinate[] searchRingPts = searchRing.getCoordinates(); if (innerRing == searchRing) continue; if (! innerRing.getEnvelopeInternal().intersects(searchRing.getEnvelopeInternal())) continue; Coordinate innerRingPt = IsValidOp.findPtNotNode(innerRingPts, searchRing, graph); Assert.isTrue(innerRingPt != null, "Unable to find a ring point not a node of the search ring"); //Coordinate innerRingPt = innerRingPts[0]; boolean isInside = CGAlgorithms.isPointInRing(innerRingPt, searchRingPts); if (isInside) { nestedPt = innerRingPt; return false; } } } return true; }
/** * Tests whether the point pt is contained in the triangle defined by 3 * {@link Vertex}es. * * @param tri * an array containing at least 3 Vertexes * @param pt * the point to test * @return true if the point is contained in the triangle */ public static boolean contains(Vertex[] tri, Coordinate pt) { Coordinate[] ring = new Coordinate[] { tri[0].getCoordinate(), tri[1].getCoordinate(), tri[2].getCoordinate(), tri[0].getCoordinate() }; return CGAlgorithms.isPointInRing(pt, ring); }
boolean isInside = CGAlgorithms.isPointInRing(innerRingPt, searchRingPts); if (isInside) { nestedPt = innerRingPt;
continue; boolean isInside = CGAlgorithms.isPointInRing(innerRingPt, searchRingPts); if (isInside) { nestedPt = innerRingPt;
private boolean isInside(LinearRing innerRing, LinearRing searchRing) { Coordinate[] innerRingPts = innerRing.getCoordinates(); Coordinate[] searchRingPts = searchRing.getCoordinates(); if (! innerRing.getEnvelopeInternal().intersects(searchRing.getEnvelopeInternal())) return false; Coordinate innerRingPt = IsValidOp.findPtNotNode(innerRingPts, searchRing, graph); Assert.isTrue(innerRingPt != null, "Unable to find a ring point not a node of the search ring"); boolean isInside = CGAlgorithms.isPointInRing(innerRingPt, searchRingPts); if (isInside) { nestedPt = innerRingPt; return true; } return false; }
boolean isContained = false; if (tryEnv.contains(testEnv) && CGAlgorithms.isPointInRing(testPt, tryRing.getCoordinates()) ) isContained = true;
public boolean isInside(Coordinate pt) { return CGAlgorithms.isPointInRing(pt, pts); } }
/** * Tests whether the point pt is contained in the triangle defined by 3 * {@link QuadEdge}es. * * @param tri * an array containing at least 3 QuadEdges * @param pt * the point to test * @return true if the point is contained in the triangle */ public static boolean contains(QuadEdge[] tri, Coordinate pt) { Coordinate[] ring = new Coordinate[] { tri[0].orig().getCoordinate(), tri[1].orig().getCoordinate(), tri[2].orig().getCoordinate(), tri[0].orig().getCoordinate() }; return CGAlgorithms.isPointInRing(pt, ring); }
private boolean triangleContainsPoint(Triangle tri, Coordinate pt) { return CGAlgorithms.isPointInRing(pt, new Coordinate[]{tri.p0, tri.p1, tri.p2, tri.p0}); }
if (CGAlgorithms.isPointInRing(testPt, tryShellRing.getCoordinates()) ) isContained = true;
boolean insidePolyShell = CGAlgorithms.isPointInRing(shellPt, polyPts); if (! insidePolyShell) return;
public boolean contains(Coordinate pt) { Coordinate[] ring = getCoordinates(); return CGAlgorithms.isPointInRing(pt, ring); }
private boolean isInside(LinearRing innerRing, LinearRing searchRing) { Coordinate[] innerRingPts = innerRing.getCoordinates(); Coordinate[] searchRingPts = searchRing.getCoordinates(); if (! innerRing.getEnvelopeInternal().intersects(searchRing.getEnvelopeInternal())) return false; Coordinate innerRingPt = IsValidOp.findPtNotNode(innerRingPts, searchRing, graph); Assert.isTrue(innerRingPt != null, "Unable to find a ring point not a node of the search ring"); boolean isInside = CGAlgorithms.isPointInRing(innerRingPt, searchRingPts); if (isInside) { nestedPt = innerRingPt; return true; } return false; }
/** * Tests whether the point pt is contained in the triangle defined by 3 * {@link QuadEdge}es. * * @param tri * an array containing at least 3 QuadEdges * @param pt * the point to test * @return true if the point is contained in the triangle */ public static boolean contains(QuadEdge[] tri, Coordinate pt) { Coordinate[] ring = new Coordinate[] { tri[0].orig().getCoordinate(), tri[1].orig().getCoordinate(), tri[2].orig().getCoordinate(), tri[0].orig().getCoordinate() }; return CGAlgorithms.isPointInRing(pt, ring); }