/** * Returns the exterior ring of this Polygon. * @return OGCLinearRing instance. */ public OGCLineString exteriorRing() { if (polygon.isEmpty()) return new OGCLinearRing((Polygon) polygon.createInstance(), 0, esriSR, true); return new OGCLinearRing(polygon, 0, esriSR, true); }
/** * Returns the exterior ring of this Polygon. * @return OGCLinearRing instance. */ public OGCLineString exteriorRing() { if (polygon.isEmpty()) return new OGCLinearRing((Polygon) polygon.createInstance(), 0, esriSR, true); return new OGCLinearRing(polygon, 0, esriSR, true); }
private static boolean polygonContainsPolylineImpl_(Polygon polygon_a, Polyline polyline_b, double tolerance, ProgressTracker progress_tracker) { boolean[] b_result_known = new boolean[1]; b_result_known[0] = false; boolean res = polygonContainsMultiPath_(polygon_a, polyline_b, tolerance, b_result_known, progress_tracker); if (b_result_known[0]) return res; // We can clip polygon_a to the extent of polyline_b Envelope2D envBInflated = new Envelope2D(); polyline_b.queryEnvelope2D(envBInflated); envBInflated.inflate(1000.0 * tolerance, 1000.0 * tolerance); Polygon _polygonA = null; if (polygon_a.getPointCount() > 10) { _polygonA = (Polygon)Clipper.clip(polygon_a, envBInflated, tolerance, 0.0); if (_polygonA.isEmpty()) return false; } else { _polygonA = polygon_a; } boolean bContains = RelationalOperationsMatrix.polygonContainsPolyline_(_polygonA, polyline_b, tolerance, progress_tracker); return bContains; }
private static boolean polygonContainsPolygonImpl_(Polygon polygon_a, Polygon polygon_b, double tolerance, ProgressTracker progressTracker) { boolean[] b_result_known = new boolean[1]; b_result_known[0] = false; boolean res = polygonContainsMultiPath_(polygon_a, polygon_b, tolerance, b_result_known, progressTracker); if (b_result_known[0]) return res; // We can clip polygon_a to the extent of polyline_b Envelope2D envBInflated = new Envelope2D(); polygon_b.queryEnvelope2D(envBInflated); envBInflated.inflate(1000.0 * tolerance, 1000.0 * tolerance); Polygon _polygonA = null; if (polygon_a.getPointCount() > 10) { _polygonA = (Polygon)Clipper.clip(polygon_a, envBInflated, tolerance, 0.0); if (_polygonA.isEmpty()) return false; } else { _polygonA = polygon_a; } boolean bContains = RelationalOperationsMatrix.polygonContainsPolygon_(_polygonA, polygon_b, tolerance, progressTracker); return bContains; }
private static boolean polygonContainsPolygonImpl_(Polygon polygon_a, Polygon polygon_b, double tolerance, ProgressTracker progressTracker) { boolean[] b_result_known = new boolean[1]; b_result_known[0] = false; boolean res = polygonContainsMultiPath_(polygon_a, polygon_b, tolerance, b_result_known, progressTracker); if (b_result_known[0]) return res; // We can clip polygon_a to the extent of polyline_b Envelope2D envBInflated = new Envelope2D(); polygon_b.queryEnvelope2D(envBInflated); envBInflated.inflate(1000.0 * tolerance, 1000.0 * tolerance); Polygon _polygonA = null; if (polygon_a.getPointCount() > 10) { _polygonA = (Polygon)Clipper.clip(polygon_a, envBInflated, tolerance, 0.0); if (_polygonA.isEmpty()) return false; } else { _polygonA = polygon_a; } boolean bContains = RelationalOperationsMatrix.polygonContainsPolygon_(_polygonA, polygon_b, tolerance, progressTracker); return bContains; }
private static boolean polygonContainsPolylineImpl_(Polygon polygon_a, Polyline polyline_b, double tolerance, ProgressTracker progress_tracker) { boolean[] b_result_known = new boolean[1]; b_result_known[0] = false; boolean res = polygonContainsMultiPath_(polygon_a, polyline_b, tolerance, b_result_known, progress_tracker); if (b_result_known[0]) return res; // We can clip polygon_a to the extent of polyline_b Envelope2D envBInflated = new Envelope2D(); polyline_b.queryEnvelope2D(envBInflated); envBInflated.inflate(1000.0 * tolerance, 1000.0 * tolerance); Polygon _polygonA = null; if (polygon_a.getPointCount() > 10) { _polygonA = (Polygon)Clipper.clip(polygon_a, envBInflated, tolerance, 0.0); if (_polygonA.isEmpty()) return false; } else { _polygonA = polygon_a; } boolean bContains = RelationalOperationsMatrix.polygonContainsPolyline_(_polygonA, polyline_b, tolerance, progress_tracker); return bContains; }
static int isPointInPolygon(Polygon inputPolygon, double inputPointXVal, double inputPointYVal, double tolerance) { if (inputPolygon.isEmpty()) return 0; Envelope2D env = new Envelope2D(); inputPolygon.queryLooseEnvelope(env); env.inflate(tolerance, tolerance); if (!env.contains(inputPointXVal, inputPointYVal)) return 0; MultiPathImpl mpImpl = (MultiPathImpl) inputPolygon._getImpl(); GeometryAccelerators accel = mpImpl._getAccelerators(); if (accel != null) { RasterizedGeometry2D rgeom = accel.getRasterizedGeometry(); if (rgeom != null) { RasterizedGeometry2D.HitType hit = rgeom.queryPointInGeometry( inputPointXVal, inputPointYVal); if (hit == RasterizedGeometry2D.HitType.Inside) return 1; else if (hit == RasterizedGeometry2D.HitType.Outside) return 0; } } return _isPointInPolygonInternal(inputPolygon, new Point2D( inputPointXVal, inputPointYVal), tolerance); }
static int isPointInPolygon(Polygon inputPolygon, double inputPointXVal, double inputPointYVal, double tolerance) { if (inputPolygon.isEmpty()) return 0; Envelope2D env = new Envelope2D(); inputPolygon.queryLooseEnvelope(env); env.inflate(tolerance, tolerance); if (!env.contains(inputPointXVal, inputPointYVal)) return 0; MultiPathImpl mpImpl = (MultiPathImpl) inputPolygon._getImpl(); GeometryAccelerators accel = mpImpl._getAccelerators(); if (accel != null) { RasterizedGeometry2D rgeom = accel.getRasterizedGeometry(); if (rgeom != null) { RasterizedGeometry2D.HitType hit = rgeom.queryPointInGeometry( inputPointXVal, inputPointYVal); if (hit == RasterizedGeometry2D.HitType.Inside) return 1; else if (hit == RasterizedGeometry2D.HitType.Outside) return 0; } } return _isPointInPolygonInternal(inputPolygon, new Point2D( inputPointXVal, inputPointYVal), tolerance); }
public static int isPointInPolygon(Polygon inputPolygon, Point2D inputPoint, double tolerance) { if (inputPolygon.isEmpty()) return 0; Envelope2D env = new Envelope2D(); inputPolygon.queryLooseEnvelope(env); env.inflate(tolerance, tolerance); if (!env.contains(inputPoint)) return 0; MultiPathImpl mpImpl = (MultiPathImpl) inputPolygon._getImpl(); GeometryAccelerators accel = mpImpl._getAccelerators(); if (accel != null) { // geometry has spatial indices built. Try using them. RasterizedGeometry2D rgeom = accel.getRasterizedGeometry(); if (rgeom != null) { RasterizedGeometry2D.HitType hit = rgeom.queryPointInGeometry( inputPoint.x, inputPoint.y); if (hit == RasterizedGeometry2D.HitType.Inside) return 1; else if (hit == RasterizedGeometry2D.HitType.Outside) return 0; } QuadTreeImpl qtree = accel.getQuadTree(); if (qtree != null) { return _isPointInPolygonInternalWithQuadTree(inputPolygon, qtree, inputPoint, tolerance); } } return _isPointInPolygonInternal(inputPolygon, inputPoint, tolerance); }
public static int isPointInPolygon(Polygon inputPolygon, Point2D inputPoint, double tolerance) { if (inputPolygon.isEmpty()) return 0; Envelope2D env = new Envelope2D(); inputPolygon.queryLooseEnvelope(env); env.inflate(tolerance, tolerance); if (!env.contains(inputPoint)) return 0; MultiPathImpl mpImpl = (MultiPathImpl) inputPolygon._getImpl(); GeometryAccelerators accel = mpImpl._getAccelerators(); if (accel != null) { // geometry has spatial indices built. Try using them. RasterizedGeometry2D rgeom = accel.getRasterizedGeometry(); if (rgeom != null) { RasterizedGeometry2D.HitType hit = rgeom.queryPointInGeometry( inputPoint.x, inputPoint.y); if (hit == RasterizedGeometry2D.HitType.Inside) return 1; else if (hit == RasterizedGeometry2D.HitType.Outside) return 0; } QuadTreeImpl qtree = accel.getQuadTree(); if (qtree != null) { return _isPointInPolygonInternalWithQuadTree(inputPolygon, qtree, inputPoint, tolerance); } } return _isPointInPolygonInternal(inputPolygon, inputPoint, tolerance); }
if (!cutteeRemainder.isEmpty() && cutHandles.size() > 0) m_cuts.add((MultiPath) cutteeRemainder);
if (!cutteeRemainder.isEmpty() && cutHandles.size() > 0) m_cuts.add((MultiPath) cutteeRemainder);
_polygonA = (Polygon) (Clipper.clip(polygon_a, envInter, tolerance, 0.0)); if (_polygonA.isEmpty()) { return false;
if (!polygon.isEmpty()) { if (resultGeom != null && !resultGeom.isEmpty()) { Geometry[] geoms = { resultGeom, polygon };
_polygonA = (Polygon) (Clipper.clip(polygon_a, envInter, tolerance, 0.0)); if (_polygonA.isEmpty()) { return false;
if (!polygon.isEmpty()) { if (resultGeom != null && !resultGeom.isEmpty()) { Geometry[] geoms = { resultGeom, polygon };
_polygonA = (Polygon) (Clipper.clip(polygon_a, envInter, tolerance, 0.0)); if (_polygonA.isEmpty()) { return false;
_polygonA = (Polygon) (Clipper.clip(polygon_a, envInter, tolerance, 0.0)); if (_polygonA.isEmpty()) { return false;