Package ucar.nc2.ft2.simpgeometry
Class SimpleGeometryReader
- java.lang.Object
-
- ucar.nc2.ft2.simpgeometry.SimpleGeometryReader
-
public class SimpleGeometryReader extends Object
A class which given a dataset, will read from the dataset one of the simple geometry types. Those being polygon, line, or point.
-
-
Constructor Summary
Constructors Constructor Description SimpleGeometryReader(NetcdfDataset ds)
Constructs a new Simple Geometry Reader over the specified dataset.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description GeometryType
getGeometryType(String name)
Given a variable name, returns the geometry type which that variable is associated with.Line
readLine(String name, int index)
Returns a Line given a variable name and the geometric index.Point
readPoint(String name, int index)
Returns a Point given a variable name and the geometric index.Polygon
readPolygon(String name, int index)
Returns a Polygon given a variable name and the geometric index.
-
-
-
Constructor Detail
-
SimpleGeometryReader
public SimpleGeometryReader(NetcdfDataset ds)
Constructs a new Simple Geometry Reader over the specified dataset.- Parameters:
ds
- - the specified dataset
-
-
Method Detail
-
readPolygon
public Polygon readPolygon(String name, int index)
Returns a Polygon given a variable name and the geometric index. If the Polygon is not found it will return null. If the Polygon is a part of the Multi-Polygon, it will return the head (the first Polygon in the series which constitutes the Multi-Polygon).- Parameters:
name
- of the variable which holds the Polygonindex
- of the Polygon within the variable- Returns:
- a new polygon with all associated information
-
readLine
public Line readLine(String name, int index)
Returns a Line given a variable name and the geometric index. If the Line is not found it will return null. If the Line is a part of the Multi-Line, it will return the head (the first Line in the series which constitutes the Multi-Line).- Parameters:
name
- of the variable which holds the Lineindex
- of the Line within the variable- Returns:
- a new line with all associated information
-
readPoint
public Point readPoint(String name, int index)
Returns a Point given a variable name and the geometric index. If the Point is not found it will return null. If the Point is a part of the Multi-Point, it will return the head (the first Point in the series which constitutes the Multi-Point).- Parameters:
name
- of the variable which holds the Pointindex
- of the Point within the variable- Returns:
- a new Point with all associated information
-
getGeometryType
public GeometryType getGeometryType(String name)
Given a variable name, returns the geometry type which that variable is associated with. If the variable has no simple geometry information, null will be returned.- Parameters:
name
- variable name which will have geometry type be checked- Returns:
- Geometry Type if holds geometry information, null if not
-
-