Package ucar.nc2.ft2.simpgeometry
Class CFLine
- java.lang.Object
-
- ucar.nc2.ft2.simpgeometry.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.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addPoint(double x, double y)
Add a point to the end of the line.double[]
getBBLower()
Gets the lower bounding box coordinate on the line.double[]
getBBUpper()
Gets the upper bounding box coordinate on the line.Array
getData()
Get the data associated with this lineGeometryType
getGeometryType()
Get the geometry the data is associated with.Line
getNext()
If part of a multiline, returns the next line within that line if it is present.List<Point>
getPoints()
Returns the list of points which make up this lineLine
getPrev()
If part of a multiline, returns the previous line within that line if it is presentvoid
setData(Array data)
Set the data associated with this Lineprotected void
setNext(CFLine next)
Sets the next line which makes up the multiline which this line is a part of.void
setNext(Line next)
Sets the previous line which makes up the multiline which this line is a part of.protected void
setPrev(CFLine prev)
Sets the previous line which makes up the multiline which this line is a part of.void
setPrev(Line prev)
Sets the previous line which makes up the multiline which this line is a part of.Line
setupLine(NetcdfDataset dataset, Variable var, int index)
Given a dataset, variable, and index, automatically populates this Line and returns it.
-
-
-
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.
-
getData
public Array getData()
Get the data associated with this line- Specified by:
getData
in interfaceLine
- Specified by:
getData
in interfaceSimpleGeometry
- Returns:
- data
-
getNext
public Line getNext()
If part of a multiline, returns the next line within that line if it is present.
-
getPrev
public Line getPrev()
If part of a multiline, returns the previous line within that line if it is present
-
setData
public void setData(Array data)
Set the data associated with this Line- Specified by:
setData
in interfaceLine
- Specified by:
setData
in interfaceSimpleGeometry
- 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.
-
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.
-
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.
-
getBBUpper
public double[] getBBUpper()
Gets the upper bounding box coordinate on the line.- Specified by:
getBBUpper
in interfaceSimpleGeometry
- Returns:
- double array = (x, y)
-
getBBLower
public double[] getBBLower()
Gets the lower bounding box coordinate on the line.- Specified by:
getBBLower
in interfaceSimpleGeometry
- Returns:
- double array = (x, y)
-
-