/** * Check if the point is in the polygon ring * * @param point * point * @param ring * polygon ring * @return true if in the polygon * @since 1.0.5 */ public static boolean pointInPolygon(Point point, LineString ring) { return pointInPolygon(point, ring, DEFAULT_EPSILON); }
/** * Check if the point is in the polygon * * @param point * point * @param polygon * polygon * @return true if in the polygon * @since 1.0.5 */ public static boolean pointInPolygon(Point point, Polygon polygon) { return pointInPolygon(point, polygon, DEFAULT_EPSILON); }
/** * Check if the point is in the polygon points * * @param point * point * @param points * polygon points * @return true if in the polygon * @since 1.0.5 */ public static boolean pointInPolygon(Point point, List<Point> points) { return pointInPolygon(point, points, DEFAULT_EPSILON); }
/** * Check if the point is in the polygon ring * * @param point * point * @param ring * polygon ring * @param epsilon * epsilon line tolerance * @return true if in the polygon * @since 1.0.5 */ public static boolean pointInPolygon(Point point, LineString ring, double epsilon) { return pointInPolygon(point, ring.getPoints(), epsilon); }
/** * Check if the point is in the polygon * * @param point * point * @param polygon * polygon * @param epsilon * epsilon line tolerance * @return true if in the polygon * @since 1.0.5 */ public static boolean pointInPolygon(Point point, Polygon polygon, double epsilon) { boolean contains = false; List<LineString> rings = polygon.getRings(); if (!rings.isEmpty()) { contains = pointInPolygon(point, rings.get(0), epsilon); if (contains) { // Check the holes for (int i = 1; i < rings.size(); i++) { if (pointInPolygon(point, rings.get(i), epsilon)) { contains = false; break; } } } } return contains; }
if (!GeometryUtils.pointInPolygon(firstPoint, rings.get(0))) { simple = false; break; if (GeometryUtils.pointInPolygon(firstPoint, holePoints) || GeometryUtils.pointInPolygon(holePoints.get(0), ringCopyPoints)) { simple = false;