public class NCTileSource extends java.lang.Object implements TileSource
NCTileSource
class provides tiles from a NetCDF 3 or 4
dataset variable.Constructor and Description |
---|
NCTileSource(ucar.nc2.NetcdfFile file,
java.lang.String varName,
int rowIndex,
int colIndex,
int[] start)
Constructs a new NetCDF tile source to access the specified dataset
and variable.
|
Modifier and Type | Method and Description |
---|---|
TilingScheme |
getScheme()
Gets the tiling scheme used to deliver tiles by this source.
|
static void |
main(java.lang.String[] argv)
Tests this class.
|
TilingScheme.Tile |
readTile(TilingScheme.TilePosition pos)
Reads the specified tile from the source.
|
public NCTileSource(ucar.nc2.NetcdfFile file, java.lang.String varName, int rowIndex, int colIndex, int[] start) throws java.io.IOException
file
- the NetCDF file to access.varName
- the NetCDF variable name to read.rowIndex
- the dimension index to use as the row dimension of the 2D slice.colIndex
- the dimension index to use as the column dimension of the 2D slice.start
- the starting coordinates for the 2D slice, or null to start at
the origin.java.io.IOException
- if a problem occurred accessing the NetCDF file.java.lang.ArrayIndexOutOfBoundsException
- if the row or column index is
out of bounds with respect to the variable dimensions.java.lang.IllegalArgumentException
- if the start coordinate dimensions do
not match the variable.public TilingScheme.Tile readTile(TilingScheme.TilePosition pos) throws java.io.IOException
TileSource
readTile
in interface TileSource
pos
- the tile position to read.java.io.IOException
- if an error occurred reading the tile data.TileSource.getScheme()
public TilingScheme getScheme()
TileSource
getScheme
in interface TileSource
public static void main(java.lang.String[] argv) throws java.lang.Exception
argv
- the array of command line parameters.java.lang.Exception