|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.timeseries.geotools.vti.connectors.VTIBathymetry
public class VTIBathymetry
Class for obtaining altimetry and bathymetry values from a netCDF file.
Requires the netCDF libraries (see here: http://www.unidata.ucar.edu/software/netcdf-java/documentation.htm)
You should use the class in the following way:
VTIBathymetry bath = new VTIBathymetry("/path/to/bath.nc"); // e.g. gebco_08.nc
bath.open(); // file must be explicitly opened, this takes a short time, avoid opening it several times
short value1 = bath.getZ(142.2, 11.35); // e.g. Mariana Trench
short value2 = bath.getZ(0, 0);
// ...
bath.close(); // file should be closed when not needed any longer
Field Summary | |
---|---|
int |
GRID_COLS
|
int |
GRID_ROWS
|
Constructor Summary | |
---|---|
VTIBathymetry(java.lang.String filename)
Creates an instance of VTIBathymetry with the specified file. |
Method Summary | |
---|---|
void |
close()
Closes the netCDF file. |
short |
getZ(double x,
double y)
Returns the altimetric/bathymetric value of the given geographical coordinates. |
short |
getZ(java.awt.geom.Point2D.Double point)
Returns the altimetric/bathymetric value of the given geographical coordinates. |
short[] |
getZ(java.awt.geom.Point2D.Double[] points)
Returns the altimetric/bathymetric values of the given array of geographical coordinates. |
static void |
main(java.lang.String[] args)
The class can also be used as command-line tool. |
void |
open()
Opens the netCDF file and loads the data array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final int GRID_COLS
public final int GRID_ROWS
Constructor Detail |
---|
public VTIBathymetry(java.lang.String filename)
filename
- the netCDF filename containing the altimetry/bathymetry dataMethod Detail |
---|
public static void main(java.lang.String[] args)
java org.d4science2.vtivre.VTIBathymetry get x1,y1 [x2,y2 [...]] filename
args
- the command-line argumentspublic void open() throws java.io.IOException
java.io.IOException
public void close() throws java.io.IOException
java.io.IOException
public short getZ(java.awt.geom.Point2D.Double point) throws java.io.IOException
point
- the geographical coordinates (x = longitude value (-180 to 180), y = latitude value (-90 to 90))
java.io.IOException
- if the netCDF variable z
could not been readpublic short[] getZ(java.awt.geom.Point2D.Double[] points) throws java.io.IOException
points
- array of geographical coordinates (x = longitude value (-180 to 180), y = latitude value (-90 to 90))
java.io.IOException
- if the netCDF variable z
could not been readpublic short getZ(double x, double y) throws java.lang.NullPointerException, java.io.IOException
x
- longitude coordinate (-180 to 180)y
- latitude coordinate (-90 to 90)
java.lang.NullPointerException
- if the netCDF file has not been opened or the variable z
(containing the altimetry/bathymetry values) is not found
java.io.IOException
- if the netCDF variable z
could not been read
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |