Class PolygonUtils


  • public final class PolygonUtils
    extends Object
    Methods for working with Polygons. Used internally, use at your own risk.
    • Method Detail

      • getCentroid

        public static Point getCentroid​(List<Point> vertices)
        Get the central coordinates (centroid) of a list of Points.
      • getMinMaxY

        public static MinMax getMinMaxY​(List<Point> vertices)
        Get the maximum and minimum Y coordinates in a given list of Points.
      • getMinMaxX

        public static MinMax getMinMaxX​(List<Point> vertices)
        Get the maximum and minimum X coordinates in a given list of Points.
      • isPointInY

        public static boolean isPointInY​(Point centroid,
                                         Double yMin,
                                         Double yMax)
        Determine if a Point is within two Y coordinates.
      • isPointInPolygonY

        public static boolean isPointInPolygonY​(Point centroid,
                                                Polygon polygon)
        Determine if a Point is within a Polygon's Y axis.
      • combine

        public static Polygon combine​(Polygon base,
                                      Polygon target)
        Merge the coordinates of the two polygons.