public class VTIBathymetry extends Object
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
| Constructor and Description |
|---|
VTIBathymetry(String filename)
Creates an instance of VTIBathymetry with the specified file.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Closes the netCDF file.
|
short |
getZ(double x,
double y)
Returns the altimetric/bathymetric value of the given geographical coordinates.
|
short |
getZ(Point2D.Double point)
Returns the altimetric/bathymetric value of the given geographical coordinates.
|
short[] |
getZ(Point2D.Double[] points)
Returns the altimetric/bathymetric values of the given array of geographical coordinates.
|
static void |
main(String[] args)
The class can also be used as command-line tool.
|
void |
open()
Opens the netCDF file and loads the data array.
|
public final int GRID_COLS
public final int GRID_ROWS
public VTIBathymetry(String filename)
filename - the netCDF filename containing the altimetry/bathymetry datapublic static void main(String[] args)
java org.d4science2.vtivre.VTIBathymetry get x1,y1 [x2,y2 [...]] filename
args - the command-line argumentspublic void open()
throws IOException
IOExceptionpublic void close()
throws IOException
IOExceptionpublic short getZ(Point2D.Double point) throws IOException
point - the geographical coordinates (x = longitude value (-180 to 180), y = latitude value (-90 to 90))IOException - if the netCDF variable z could not been readpublic short[] getZ(Point2D.Double[] points) throws IOException
points - array of geographical coordinates (x = longitude value (-180 to 180), y = latitude value (-90 to 90))IOException - if the netCDF variable z could not been readpublic short getZ(double x,
double y)
throws NullPointerException,
IOException
x - longitude coordinate (-180 to 180)y - latitude coordinate (-90 to 90)NullPointerException - if the netCDF file has not been opened or the variable z (containing the altimetry/bathymetry values) is not foundIOException - if the netCDF variable z could not been readCopyright © 2017. All Rights Reserved.