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.ArraygetData()Get the data associated with this pointGeometryTypegetGeometryType()Get the geometry the data is associated with.PointgetNext()Retrieves the next point within a multipoint if anyPointgetPrev()Retrieves the previous point within a multipoint if anydoublegetX()Return the x coordinate for the point.doublegetY()Return the y coordinate for the pointvoidsetData(Array arr)Sets the data array of the point.voidsetNext(Point next)Sets the next point in a multipointvoidsetPrev(Point prev)Set the previous point in a multipointPointsetupPoint(NetcdfDataset dataset, Variable vari, int index)Given a dataset, variable, and index, automatically populates this Point and returns it.voidsetX(double x)Sets the x coordinate of the point.voidsetY(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:
getDatain interfacePoint- Specified by:
getDatain 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:
setDatain interfacePoint- Specified by:
setDatain 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:
setupPointin 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:
getBBUpperin interfaceSimpleGeometry- Returns:
- double array = (x, y)
-
getBBLower
public double[] getBBLower()
Gets the lower bounding box coordinate on the polygon.- Specified by:
getBBLowerin interfaceSimpleGeometry- Returns:
- double array = (x, y)
-
-