static Geometry pointMinusPoint_(Point point_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { double tolerance_cluster = tolerance * Math.sqrt(2.0) * 1.00001; double tolerance_cluster_sq = tolerance_cluster * tolerance_cluster; Point2D pt_a = point_a.getXY(); Point2D pt_b = point_b.getXY(); if (Point2D.sqrDistance(pt_a, pt_b) <= tolerance_cluster_sq) return point_a.createInstance(); // return empty point return point_a; }
private static boolean multiPointDisjointPoint_(MultiPoint multipoint_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { Point2D pt_b = point_b.getXY(); return multiPointDisjointPointImpl_(multipoint_a, pt_b, tolerance, progress_tracker); }
private static int quickTest2DPolylinePoint(Polyline geomA, Point geomB, double tolerance, int testType) { Point2D ptB; ptB = geomB.getXY(); return quickTest2DPolylinePoint(geomA, ptB, tolerance, testType); }
private static boolean polygonTouchesPoint_(Polygon polygon_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { Point2D pt_b = point_b.getXY(); return polygonTouchesPointImpl_(polygon_a, pt_b, tolerance, null); }
private static boolean polygonTouchesPoint_(Polygon polygon_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { Point2D pt_b = point_b.getXY(); return polygonTouchesPointImpl_(polygon_a, pt_b, tolerance, null); }
private static boolean polygonContainsPoint_(Polygon polygon_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { Point2D pt_b = point_b.getXY(); return polygonContainsPointImpl_(polygon_a, pt_b, tolerance, progress_tracker); }
private static int quickTest2DPolylinePoint(Polyline geomA, Point geomB, double tolerance, int testType) { Point2D ptB; ptB = geomB.getXY(); return quickTest2DPolylinePoint(geomA, ptB, tolerance, testType); }
private static int quickTest2DMultiPointPoint(MultiPoint geomA, Point geomB, double tolerance) { Point2D ptB; ptB = geomB.getXY(); return quickTest2DMultiPointPoint(geomA, ptB, tolerance); }
public static int isPointInPolygon(Polygon inputPolygon, Point inputPoint, double tolerance) { if (inputPoint.isEmpty()) return 0; return isPointInPolygon(inputPolygon, inputPoint.getXY(), tolerance); }
private static boolean polylineDisjointPoint_(Polyline polyline_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { // Quick rasterize test to see whether the the geometries are disjoint. if (tryRasterizedContainsOrDisjoint_(polyline_a, point_b, tolerance, false) == Relation.disjoint) return true; Point2D pt_b = point_b.getXY(); return !linearPathIntersectsPoint_(polyline_a, pt_b, tolerance); }
private static boolean polylineContainsPoint_(Polyline polyline_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { // Quick rasterize test to see whether the the geometries are disjoint. if (tryRasterizedContainsOrDisjoint_(polyline_a, point_b, tolerance, false) == Relation.disjoint) return false; Point2D pt_b = point_b.getXY(); return linearPathContainsPoint_(polyline_a, pt_b, tolerance); }
private static boolean polylineDisjointPoint_(Polyline polyline_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { // Quick rasterize test to see whether the the geometries are disjoint. if (tryRasterizedContainsOrDisjoint_(polyline_a, point_b, tolerance, false) == Relation.disjoint) return true; Point2D pt_b = point_b.getXY(); return !linearPathIntersectsPoint_(polyline_a, pt_b, tolerance); }
private static boolean polylineTouchesPoint_(Polyline polyline_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { // Quick rasterize test to see whether the the geometries are disjoint. if (tryRasterizedContainsOrDisjoint_(polyline_a, point_b, tolerance, false) == Relation.disjoint) return false; Point2D pt_b = point_b.getXY(); return linearPathTouchesPointImpl_(polyline_a, pt_b, tolerance); }
static Geometry pointSymDiffPoint_(Point point_a, Point point_b, double tolerance, ProgressTracker progress_tracker) { double tolerance_cluster = tolerance * Math.sqrt(2.0) * 1.00001; double tolerance_cluster_sq = tolerance_cluster * tolerance_cluster; Point2D pt_a = point_a.getXY(); Point2D pt_b = point_b.getXY(); MultiPoint multi_point = new MultiPoint(point_a.getDescription()); if (Point2D.sqrDistance(pt_a, pt_b) > tolerance_cluster_sq) { multi_point.add(point_a); multi_point.add(point_b); } return multi_point; }
private static int quickTest2DEnvelopePoint(Envelope geomA, Point geomB, double tolerance) { Envelope2D geomAEnv = new Envelope2D(); geomA.queryEnvelope2D(geomAEnv); Point2D ptB; ptB = geomB.getXY(); return quickTest2DEnvelopePoint(geomAEnv, ptB, tolerance); }
@Override public void applyTransformation(Transformation2D transform) { if (isEmptyImpl()) return; Point2D pt = getXY(); transform.transform(pt, pt); setXY(pt); }
private void addPoint_(Point point) { Point2D pt_p = point.getXY(); int p = addPoint_(pt_p); if (p != -1) { int tp = m_shape.addPoint(m_path_handle, point); m_tree_hull.setElement(p, tp); // reset the place holder to tp } }
static Geometry pointMinusEnvelope_(Point point, Envelope envelope, double tolerance, ProgressTracker progress_tracker) { Envelope2D env = new Envelope2D(); envelope.queryEnvelope2D(env); env.inflate(tolerance, tolerance); Point2D pt = point.getXY(); if (!env.contains(pt)) return point; return point.createInstance(); }
static Geometry pointMinusEnvelope_(Point point, Envelope envelope, double tolerance, ProgressTracker progress_tracker) { Envelope2D env = new Envelope2D(); envelope.queryEnvelope2D(env); env.inflate(tolerance, tolerance); Point2D pt = point.getXY(); if (!env.contains(pt)) return point; return point.createInstance(); }