Package ucar.nc2.ft2.simpgeometry
Class CFPoint
- java.lang.Object
-
- ucar.nc2.ft2.simpgeometry.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.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double[]
getBBLower()
Gets the lower bounding box coordinate on the polygon.double[]
getBBUpper()
Gets the upper bounding box coordinate on the point.Array
getData()
Get the data associated with this pointGeometryType
getGeometryType()
Get the geometry the data is associated with.Point
getNext()
Retrieves the next point within a multipoint if anyPoint
getPrev()
Retrieves the previous point within a multipoint if anydouble
getX()
Return the x coordinate for the point.double
getY()
Return the y coordinate for the pointvoid
setData(Array arr)
Sets the data array of the point.void
setNext(Point next)
Sets the next point in a multipointvoid
setPrev(Point prev)
Set the previous point in a multipointPoint
setupPoint(NetcdfDataset dataset, Variable vari, int index)
Given a dataset, variable, and index, automatically populates this Point and returns it.void
setX(double x)
Sets the x coordinate of the point.void
setY(double y)
Set the y coordinate of the point.
-
-
-
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 pointy
- - the y coordinate of the pointprev
- - previous point if part of a multipointnext
- - next point if part of a multipointdata
- - 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.
-
getData
public Array getData()
Get the data associated with this point- Specified by:
getData
in interfacePoint
- Specified by:
getData
in interfaceSimpleGeometry
- Returns:
- data
-
getX
public double getX()
Return the x coordinate for the point.
-
getY
public double getY()
Return the y coordinate for the point
-
getNext
public Point getNext()
Retrieves the next point within a multipoint if any
-
getPrev
public Point getPrev()
Retrieves the previous point within a multipoint if any
-
setData
public void setData(Array arr)
Sets the data array of the point.- Specified by:
setData
in interfacePoint
- Specified by:
setData
in interfaceSimpleGeometry
- 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.
-
setY
public void setY(double y)
Set the y coordinate of the point.
-
setNext
public void setNext(Point next)
Sets the next point in a multipoint
-
setPrev
public void setPrev(Point prev)
Set the previous point in a multipoint
-
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 interfacePoint
- Parameters:
dataset
- which the variable is a part ofvari
- the variable which has a geometry attributeindex
- 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 interfaceSimpleGeometry
- Returns:
- double array = (x, y)
-
getBBLower
public double[] getBBLower()
Gets the lower bounding box coordinate on the polygon.- Specified by:
getBBLower
in interfaceSimpleGeometry
- Returns:
- double array = (x, y)
-
-