类 GeometryUtil


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

      • GeometryUtil

        public GeometryUtil()
    • 方法详细资料

      • getPointsExtent

        public static Extent getPointsExtent​(List<? extends PointD> PList)
        Get extent from point list
        参数:
        PList - point list
        返回:
        extent
      • getExtent

        public static Extent getExtent​(List<? extends Shape> shapes)
        Get extent of the shapes
        参数:
        shapes -
        返回:
        Extent
      • getExtent

        public static Extent3D getExtent​(PointZ[] points)
        Get extent of the points
        参数:
        points -
        返回:
        Extent
      • getExtent

        public static Extent getExtent​(PointF[] points)
        Get extent of the points
        参数:
        points -
        返回:
        Extent
      • 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 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 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,
                                      List<Number> x,
                                      List<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,
                                      List<Number> x,
                                      List<Number> y,
                                      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,
                                      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,
                                      List<Number> x,
                                      List<Number> y,
                                      List<Number> x_p,
                                      List<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
      • polygonIndex

        public static Array polygonIndex​(Array x,
                                         Array y,
                                         List<PolygonShape> polygons)
        Find polygon index for each point
        参数:
        x - X coordinate of the points
        y - Y coordinate of the points
        polygons - The polygons
        返回:
        Polygon index for each point
      • maskout

        public static Array maskout​(Array a,
                                    List<Number> x,
                                    List<Number> y,
                                    PolygonShape polygon,
                                    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,
                                    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,
                                   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,
                                             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,
                                            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,
                                    List<Number> x,
                                    List<Number> y,
                                    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,
                                    List<Number> x,
                                    List<Number> y,
                                    List<PolygonShape> polygons,
                                    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,
                                    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​(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
      • getCoordinates

        public static Array[] getCoordinates​(PolygonShape pgs)
        Get polygon shape coordinate arrays
        参数:
        pgs - The polygon shape
        返回:
        Coordinate arrays
      • getCoordinates

        public static Array[] getCoordinates​(PolylineShape pls)
        Get polyline shape coordinate arrays
        参数:
        pls - The polygon shape
        返回:
        Coordinate arrays