Class CFPoint

  • All Implemented Interfaces:
    Point, SimpleGeometry

    public class CFPoint
    extends Object
    implements Point
    A CF 1.8 compliant Point for use with Simple Geometries. Can also represent multipoints.
    • Constructor Summary

      Constructors 
      Constructor Description
      CFPoint()
      Constructs a new empty point at (0,0) with no connections.
      CFPoint​(double x, double y, Point prev, Point next, Array data)
      Construct a new point from specified parameters The construction will automatically connect in related parts of a Multipoint - just specify any constituents of a multipoint as next or prev.
    • Constructor Detail

      • CFPoint

        public CFPoint​(double x,
                       double y,
                       Point prev,
                       Point next,
                       Array data)
        Construct a new point from specified parameters The construction will automatically connect in related parts of a Multipoint - just specify any constituents of a multipoint as next or prev.
        Parameters:
        x - - the x coordinate of the point
        y - - the y coordinate of the point
        prev - - previous point if part of a multipoint
        next - - next point if part of a multipoint
        data - - data associated with the point
      • CFPoint

        public CFPoint()
        Constructs a new empty point at (0,0) with no connections.
    • Method Detail

      • getGeometryType

        public GeometryType getGeometryType()
        Get the geometry the data is associated with.
      • getX

        public double getX()
        Return the x coordinate for the point.
        Specified by:
        getX in interface Point
        Returns:
        x of the point
      • getY

        public double getY()
        Return the y coordinate for the point
        Specified by:
        getY in interface Point
        Returns:
        y of the point
      • getNext

        public Point getNext()
        Retrieves the next point within a multipoint if any
        Specified by:
        getNext in interface Point
        Returns:
        next point if it exists, null if not
      • getPrev

        public Point getPrev()
        Retrieves the previous point within a multipoint if any
        Specified by:
        getPrev in interface Point
        Returns:
        previous point if it exists null if not
      • setData

        public void setData​(Array arr)
        Sets the data array of the point.
        Specified by:
        setData in interface Point
        Specified by:
        setData in interface SimpleGeometry
        Parameters:
        arr - the array which will be the points new data array
      • setX

        public void setX​(double x)
        Sets the x coordinate of the point.
        Specified by:
        setX in interface Point
        Parameters:
        x - coordinate of the point
      • setY

        public void setY​(double y)
        Set the y coordinate of the point.
        Specified by:
        setY in interface Point
        Parameters:
        y - coordinate of the point
      • setNext

        public void setNext​(Point next)
        Sets the next point in a multipoint
        Specified by:
        setNext in interface Point
      • setPrev

        public void setPrev​(Point prev)
        Set the previous point in a multipoint
        Specified by:
        setPrev in interface Point
      • setupPoint

        public Point setupPoint​(NetcdfDataset dataset,
                                Variable vari,
                                int index)
        Given a dataset, variable, and index, automatically populates this Point and returns it. If not found, returns null.
        Specified by:
        setupPoint in interface Point
        Parameters:
        dataset - which the variable is a part of
        vari - the variable which has a geometry attribute
        index - of the point within the variable
        Returns:
        return a point
      • getBBUpper

        public double[] getBBUpper()
        Gets the upper bounding box coordinate on the point.
        Specified by:
        getBBUpper in interface SimpleGeometry
        Returns:
        double array = (x, y)
      • getBBLower

        public double[] getBBLower()
        Gets the lower bounding box coordinate on the polygon.
        Specified by:
        getBBLower in interface SimpleGeometry
        Returns:
        double array = (x, y)