protected Envelope computeEnvelopeInternal() { return shell.getEnvelopeInternal(); }
public void add(LinearRing ring) { rings.add(ring); totalEnv.expandToInclude(ring.getEnvelopeInternal()); }
public void add(LinearRing ring) { rings.add(ring); totalEnv.expandToInclude(ring.getEnvelopeInternal()); }
private void buildQuadtree() { quadtree = new Quadtree(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); quadtree.insert(env, ring); } } }
private void buildIndex() { index = new STRtree(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); index.insert(env, ring); } } }
private void buildIndex() { sweepLine = new SweepLineIndex(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); SweepLineInterval sweepInt = new SweepLineInterval(env.getMinX(), env.getMaxX(), ring); sweepLine.add(sweepInt); } }
private int locateInPolygonRing(Coordinate p, LinearRing ring) { // bounding-box check if (! ring.getEnvelopeInternal().intersects(p)) return Location.EXTERIOR; return CGAlgorithms.locatePointInRing(p, ring.getCoordinates()); }
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; }
Coordinate[] innerRingPts = innerRing.getCoordinates(); List results = quadtree.query(innerRing.getEnvelopeInternal()); continue; if (! innerRing.getEnvelopeInternal().intersects(searchRing.getEnvelopeInternal())) continue;
/** * 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; }
Coordinate[] innerRingPts = innerRing.getCoordinates(); List results = index.query(innerRing.getEnvelopeInternal()); continue; if (! innerRing.getEnvelopeInternal().intersects(searchRing.getEnvelopeInternal())) continue;
/** * 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()); }
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; }
Envelope testEnv = testRing.getEnvelopeInternal(); Coordinate testPt = testRing.getCoordinateN(0); EdgeRing tryShell = (EdgeRing) it.next(); LinearRing tryRing = tryShell.getLinearRing(); Envelope tryEnv = tryRing.getEnvelopeInternal(); if (minShell != null) minEnv = minShell.getLinearRing().getEnvelopeInternal(); boolean isContained = false; if (tryEnv.contains(testEnv)
Envelope env = ring.getEnvelopeInternal(); double envMinDimension = Math.min(env.getHeight(), env.getWidth()); if (bufferDistance < 0.0
Envelope testEnv = testRing.getEnvelopeInternal(); Coordinate testPt = testRing.getCoordinateN(0); EdgeRing tryShell = (EdgeRing) it.next(); LinearRing tryShellRing = tryShell.getRing(); Envelope tryShellEnv = tryShellRing.getEnvelopeInternal(); || minShellEnv.contains(tryShellEnv)) { minShell = tryShell; minShellEnv = minShell.getRing().getEnvelopeInternal();
public void add(LinearRing ring) { rings.add(ring); totalEnv.expandToInclude(ring.getEnvelopeInternal()); }
private void buildQuadtree() { quadtree = new Quadtree(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); quadtree.insert(env, ring); } } }
private void buildIndex() { index = new STRtree(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); index.insert(env, ring); } } }
private void buildIndex() { sweepLine = new SweepLineIndex(); for (int i = 0; i < rings.size(); i++) { LinearRing ring = (LinearRing) rings.get(i); Envelope env = ring.getEnvelopeInternal(); SweepLineInterval sweepInt = new SweepLineInterval(env.getMinX(), env.getMaxX(), ring); sweepLine.add(sweepInt); } }