Package noaa.coastwatch.io.tile
Class NCTileSource
java.lang.Object
noaa.coastwatch.io.tile.NCTileSource
- All Implemented Interfaces:
TileSource
The
NCTileSource
class provides tiles from a NetCDF 3 or 4
dataset variable.- Since:
- 3.3.1
- Author:
- Peter Hollemans
-
Constructor Summary
ConstructorDescriptionNCTileSource
(ucar.nc2.NetcdfFile file, String varName, int rowIndex, int colIndex, int[] start) Constructs a new NetCDF tile source to access the specified dataset and variable. -
Method Summary
Modifier and TypeMethodDescriptionGets the tiling scheme used to deliver tiles by this source.static void
Tests this class.Reads the specified tile from the source.
-
Constructor Details
-
NCTileSource
public NCTileSource(ucar.nc2.NetcdfFile file, String varName, int rowIndex, int colIndex, int[] start) throws IOException Constructs a new NetCDF tile source to access the specified dataset and variable.- Parameters:
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.- Throws:
IOException
- if a problem occurred accessing the NetCDF file.ArrayIndexOutOfBoundsException
- if the row or column index is out of bounds with respect to the variable dimensions.IllegalArgumentException
- if the start coordinate dimensions do not match the variable.
-
-
Method Details
-
readTile
Description copied from interface:TileSource
Reads the specified tile from the source.- Specified by:
readTile
in interfaceTileSource
- Parameters:
pos
- the tile position to read.- Returns:
- the tile at the specified position.
- Throws:
IOException
- if an error occurred reading the tile data.- See Also:
-
getScheme
Description copied from interface:TileSource
Gets the tiling scheme used to deliver tiles by this source.- Specified by:
getScheme
in interfaceTileSource
- Returns:
- the tiling scheme.
-
main
Tests this class.- Parameters:
argv
- the array of command line parameters.- Throws:
Exception
-