Package noaa.coastwatch.io.tile
Class TileCachedGrid
java.lang.Object
noaa.coastwatch.util.MetadataContainer
noaa.coastwatch.util.DataVariable
noaa.coastwatch.util.Grid
noaa.coastwatch.io.tile.TileCachedGrid
- All Implemented Interfaces:
Cloneable,ValueSource
The
TileCachedGrid class is a Grid whose data
is supplied from a TileSource and cached via the
TileCacheManager.- Since:
- 3.3.1
- Author:
- Peter Hollemans
-
Nested Class Summary
Nested classes/interfaces inherited from class noaa.coastwatch.util.DataVariable
DataVariable.AccessType -
Field Summary
Fields inherited from class noaa.coastwatch.util.DataVariable
data, dims, isUnsigned, lookup, unsignedType -
Constructor Summary
ConstructorsConstructorDescriptionTileCachedGrid(Grid grid, TileSource source) Constructs a new grid from the specified tile source. -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()Disposes of any resources used by this variable prior to being finalized.getData()Gets the variable data array.getData(int[] start, int[] count) Gets a subset of grid data values.Gets the class associated with components of the data array.Get the tile source used by this grid.Gets the tiling scheme for this grid if one is available.doublegetValue(int index) Reads a scaled data value.doublegetValue(int row, int col) Reads a scaled data value with no navigation.static voidTests this class.voidsetValue(int index, double val) Writes a scaled data value.Methods inherited from class noaa.coastwatch.util.Grid
arraycopy, checkSubset, getNavigation, getSubset, getValue, interpolate, navigate, setData, setNavigation, setValue, setValueMethods inherited from class noaa.coastwatch.util.DataVariable
convertUnits, format, format, format, getClassBits, getDecimals, getDimensions, getFormat, getLongName, getMissing, getName, getOptimalStride, getRank, getScaling, getStatistics, getStatistics, getStatistics, getStatistics, getUnits, getUnsigned, getValue, getValues, setAccessHint, setAccessType, setData, setFormat, setLongName, setLookup, setMissing, setName, setUnits, setUnsigned, setValue, toStringMethods inherited from class noaa.coastwatch.util.MetadataContainer
clone, getMetadataMap
-
Constructor Details
-
TileCachedGrid
Constructs a new grid from the specified tile source.- Parameters:
source- the tile source to use for tiles.
-
-
Method Details
-
getSource
Get the tile source used by this grid.- Returns:
- the tile source.
- Since:
- 3.5.0
-
getTilingScheme
Description copied from class:GridGets the tiling scheme for this grid if one is available.- Overrides:
getTilingSchemein classGrid- Returns:
- the tiling scheme or null for none.
-
getDataClass
Description copied from class:DataVariableGets the class associated with components of the data array.- Overrides:
getDataClassin classDataVariable- Returns:
- the data class or null if the data array is null.
-
dispose
public void dispose()Description copied from class:DataVariableDisposes of any resources used by this variable prior to being finalized. After calling this method, any calls to retrieve data values may generate errors.- Overrides:
disposein classDataVariable
-
setValue
public void setValue(int index, double val) Description copied from class:DataVariableWrites a scaled data value. The data value is scaled according to the scaling factor and offset and written to the data array.- Overrides:
setValuein classDataVariable- Parameters:
index- the index into the data array.val- the data value as a double. If the data value isDouble.NaNand the missing value is non-null, the missing value is written to the array.- See Also:
-
getValue
public double getValue(int index) Description copied from class:DataVariableReads a scaled data value. The data value is read from the data array and scaled according to the scaling factor and offset.- Overrides:
getValuein classDataVariable- Parameters:
index- the index into the data array.- Returns:
- the scaled data value as a
double. TheDouble.NaNvalue is used if the data value is missing. - See Also:
-
getValue
public double getValue(int row, int col) Description copied from class:GridReads a scaled data value with no navigation. The data value is read from the data array and scaled according to the scaling factor and offset. No navigation transform is applied to correct the data location. -
getData
Description copied from class:DataVariableGets the variable data array. The returned data is read-only -- the result of attempting to set values in the data is undefined.- Overrides:
getDatain classDataVariable
-
getData
Description copied from class:GridGets a subset of grid data values. This method is similar toGrid.getData(int[], int[]), but retrieves only a subset of data values in the raw, unscaled form. -
main
Tests this class.- Parameters:
argv- the array of command line parameters.- Throws:
Exception
-