Class CFLine

  • All Implemented Interfaces:
    Line, SimpleGeometry

    public class CFLine
    extends Object
    implements Line
    A CF 1.8 compliant Line for use with Simple Geometries. Can also represent Multilines.
    • Constructor Summary

      Constructors 
      Constructor Description
      CFLine()
      Constructs an "empty" line with no members using an ArrayList to implement the point list.
      CFLine​(List<Point> newPt)
      From a given list of points, construct a line
    • Constructor Detail

      • CFLine

        public CFLine()
        Constructs an "empty" line with no members using an ArrayList to implement the point list.
      • CFLine

        public CFLine​(List<Point> newPt)
        From a given list of points, construct a line
        Parameters:
        newPt - The list of points which will constitute the new line
    • Method Detail

      • getGeometryType

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

        public void addPoint​(double x,
                             double y)
        Add a point to the end of the line.
        Specified by:
        addPoint in interface Line
      • getPoints

        public List<Point> getPoints()
        Returns the list of points which make up this line
        Specified by:
        getPoints in interface Line
        Returns:
        points - the collection of points that make up this line
      • getNext

        public Line getNext()
        If part of a multiline, returns the next line within that line if it is present.
        Specified by:
        getNext in interface Line
        Returns:
        next line if present, null if not
      • getPrev

        public Line getPrev()
        If part of a multiline, returns the previous line within that line if it is present
        Specified by:
        getPrev in interface Line
        Returns:
        previous line if present, null if not
      • setData

        public void setData​(Array data)
        Set the data associated with this Line
        Specified by:
        setData in interface Line
        Specified by:
        setData in interface SimpleGeometry
        Parameters:
        data - - array of data to set to
      • setNext

        public void setNext​(Line next)
        Sets the previous line which makes up the multiline which this line is a part of. If prev is a CFLine, automatically connect the other line to this line as well.
        Specified by:
        setNext in interface Line
      • setNext

        protected void setNext​(CFLine next)
        Sets the next line which makes up the multiline which this line is a part of. Automatically connects the other line to this line as well.
      • setPrev

        public void setPrev​(Line prev)
        Sets the previous line which makes up the multiline which this line is a part of. If prev is a CFLine, automatically connect the other line to this line as well.
        Specified by:
        setPrev in interface Line
      • setPrev

        protected void setPrev​(CFLine prev)
        Sets the previous line which makes up the multiline which this line is a part of. Automatically connect the other line to this line as well.
      • setupLine

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

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

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