Package ucar.nc2.ft2.simpgeometry
Class CFPolygon
- java.lang.Object
-
- ucar.nc2.ft2.simpgeometry.CFPolygon
-
- All Implemented Interfaces:
Polygon,SimpleGeometry
public class CFPolygon extends Object implements Polygon
A CF 1.8 compliant Polygon for use with Simple Geometries. Can also represent multipolygons.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoint(double x, double y)Add a point to this polygon's points listdouble[]getBBLower()Gets the lower bounding box coordinate on the polygon.double[]getBBUpper()Gets the upper bounding box coordinate on the polygon.ArraygetData()Get the data associated with this PolygonGeometryTypegetGeometryType()Get the geometry the data is associated with.booleangetInteriorRing()Get whether or not this polygon is an interior ringPolygongetNext()Get the next polygon in the sequence of multi-polygonsList<Point>getPoints()Get the list of points which constitute the polygon.PolygongetPrev()Get the previous polygon in the sequence of multi-polygonsvoidsetData(Array data)Set the data associated with this PolygonvoidsetInteriorRing(boolean interior)Sets whether or not this polygon is an interior ring.protected voidsetNext(CFPolygon next)Sets the next polygon which make up the multipolygon which this polygon is a part of.voidsetNext(Polygon next)Sets the next polygon which make up the multipolygon which this polygon is a part of.voidsetPrev(CFPolygon prev)Sets the previous polygon which makes up the multipolygon which this polygon is a part of.voidsetPrev(Polygon prev)Sets the previous polygon which makes up the multipolygon which this polygon is a part of.PolygonsetupPolygon(NetcdfDataset dataset, Variable polyvar, int index)Given a dataset, variable and index, automatically sets up a previously constructed polygon.
-
-
-
Method Detail
-
getGeometryType
public GeometryType getGeometryType()
Get the geometry the data is associated with.
-
getData
public Array getData()
Get the data associated with this Polygon- Specified by:
getDatain interfacePolygon- Specified by:
getDatain interfaceSimpleGeometry- Returns:
- data
-
getNext
public Polygon getNext()
Get the next polygon in the sequence of multi-polygons
-
getPrev
public Polygon getPrev()
Get the previous polygon in the sequence of multi-polygons
-
getInteriorRing
public boolean getInteriorRing()
Get whether or not this polygon is an interior ring- Specified by:
getInteriorRingin interfacePolygon- Returns:
- true if an interior ring, false if not
-
addPoint
public void addPoint(double x, double y)Add a point to this polygon's points list
-
setData
public void setData(Array data)
Set the data associated with this Polygon- Specified by:
setDatain interfacePolygon- Specified by:
setDatain interfaceSimpleGeometry- Parameters:
data- - array of data to set to
-
setNext
public void setNext(Polygon next)
Sets the next polygon which make up the multipolygon which this polygon is a part of. If next is a CFPolygon, automatically connects the other polygon to this polygon as well.
-
setNext
protected void setNext(CFPolygon next)
Sets the next polygon which make up the multipolygon which this polygon is a part of. Automatically connects the other polygon to this polygon as well.
-
setPrev
public void setPrev(Polygon prev)
Sets the previous polygon which makes up the multipolygon which this polygon is a part of. If prev is a CFPolygon, automatically connect the other polygon to this polygon as well.
-
setPrev
public void setPrev(CFPolygon prev)
Sets the previous polygon which makes up the multipolygon which this polygon is a part of. Automatically connect the other polygon to this polygon as well.
-
setInteriorRing
public void setInteriorRing(boolean interior)
Sets whether or not this polygon is an interior ring.- Specified by:
setInteriorRingin interfacePolygon- Parameters:
interior- ring or not
-
setupPolygon
public Polygon setupPolygon(NetcdfDataset dataset, Variable polyvar, int index)
Given a dataset, variable and index, automatically sets up a previously constructed polygon. If the specified polygon is not found in the dataset, returns null- Specified by:
setupPolygonin interfacePolygon- Parameters:
dataset- which the variable is a part ofpolyvar- the variable which has a geometry attributeindex- of the polygon within the variable- Returns:
- the constructed Polygon with associated data
-
getBBUpper
public double[] getBBUpper()
Gets the upper bounding box coordinate on the polygon.- 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)
-
-