类 GeometryUtil


  • public class GeometryUtil
    extends java.lang.Object
    作者:
    wyq
    • 构造器详细资料

      • GeometryUtil

        public GeometryUtil()
    • 方法详细资料

      • getEllipseXY

        public static PointD getEllipseXY​(double x0,
                                          double y0,
                                          double a,
                                          double b,
                                          double angle)
        Get ellipse coordinate
        参数:
        x0 - Center x
        y0 - Center y
        a - Major axis
        b - Minor axis
        angle - Angle
        返回:
        Coordinate on the ellipse
      • getEllipseCoordinates

        public static java.util.List<PointD> getEllipseCoordinates​(double x0,
                                                                   double y0,
                                                                   double a,
                                                                   double b,
                                                                   double deltaAngle)
        Get ellipse coordinates
        参数:
        x0 - Center x
        y0 - Center y
        a - Major axis
        b - Minor axis
        deltaAngle - Delta angle
        返回:
        Coordinate on the ellipse
      • getEllipseCoordinates

        public static java.util.List<PointD> getEllipseCoordinates​(double x0,
                                                                   double y0,
                                                                   double a,
                                                                   double b)
        Get ellipse coordinates
        参数:
        x0 - Center x
        y0 - Center y
        a - Major axis
        b - Minor axis
        返回:
        Coordinate on the ellipse
      • convexHull

        public static PolygonShape convexHull​(Array x,
                                              Array y)
        Computes the smallest convex Polygon that contains all the points
        参数:
        x - X array
        y - Y array
        返回:
        PolygonShape
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      VectorLayer layer)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        layer - Polygon vector layer
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      PolygonShape ps)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        ps - Polygon shape
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      java.util.List<PolygonShape> polygons)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array x,
                                      Array y,
                                      java.util.List<PolygonShape> polygons)
        In polygon function
        参数:
        x - X coordinates
        y - Y coordinates
        polygons - PolygonShape list
        返回:
        Result boolean array
      • inPolygon

        public static Array inPolygon​(Array a,
                                      java.util.List<java.lang.Number> x,
                                      java.util.List<java.lang.Number> y,
                                      java.util.List<java.lang.Number> x_p,
                                      java.util.List<java.lang.Number> y_p)
        In polygon function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        x_p - X coordinate of the polygon
        y_p - Y coordinate of the polygon
        返回:
        Result array with cell values of 1 inside polygons and -1 outside polygons
      • inPolygon

        public static Array inPolygon​(Array x,
                                      Array y,
                                      Array x_p,
                                      Array y_p)
        In polygon function
        参数:
        x - X coordinates
        y - Y coordinates
        x_p - X coordinate of the polygon
        y_p - Y coordinate of the polygon
        返回:
        Result boolean array
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    VectorLayer layer,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        layer - VectorLayer
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    PolygonShape polygon,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygon - Polygon shape
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    Array x,
                                    Array y,
                                    java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskout
        返回:
        Result array with cell values of missing outside polygons
      • maskin

        public static Array maskin​(Array a,
                                   Array x,
                                   Array y,
                                   java.util.List<PolygonShape> polygons)
        Maskin function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskin
        返回:
        Result array with cell values of missing inside polygons
      • maskout_Remove

        public static Array[] maskout_Remove​(Array a,
                                             Array x,
                                             Array y,
                                             java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskout
        返回:
        Result arrays removing cells outside polygons
      • maskin_Remove

        public static Array[] maskin_Remove​(Array a,
                                            Array x,
                                            Array y,
                                            java.util.List<PolygonShape> polygons)
        Maskin function
        参数:
        a - Array a
        x - X Array
        y - Y Array
        polygons - Polygons for maskin
        返回:
        Result arrays removing cells inside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    java.util.List<PolygonShape> polygons)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    java.util.List<java.lang.Number> x,
                                    java.util.List<java.lang.Number> y,
                                    java.util.List<PolygonShape> polygons,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        x - X dimension values
        y - Y dimension values
        polygons - PolygonShape list
        missingValue - Missing value
        返回:
        Result array with cell values of missing outside polygons
      • maskout

        public static Array maskout​(Array a,
                                    Array m,
                                    java.lang.Number missingValue)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        missingValue - Missing value
        返回:
        Result array
      • maskout

        public static Array maskout​(Array a,
                                    Array m)
        Maskout function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • maskin

        public static Array maskin​(Array a,
                                   Array m)
        Maskin function
        参数:
        a - Array a
        m - Array mask
        返回:
        Result array
      • isConvex

        public static boolean isConvex​(java.util.List<? extends PointD> points)
        Check if a polygon is convex
        参数:
        points - Outline point of the polygon
        返回:
        Is convex or not
      • isConvex

        public static boolean isConvex​(Polygon polygon)
        Check if a polygon is convex
        参数:
        polygon - The polygon
        返回:
        Is convex or not