Package org.geotools.imageio.netcdf
Class VariableAdapter
- Object
-
- CoverageSourceDescriptor
-
- VariableAdapter
-
public class VariableAdapter extends CoverageSourceDescriptor
- Author:
- Simone Giannecchini, GeoSolutions SAS
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
VariableAdapter.UnidataAdditionalDomain
TODO improve support for thisclass
VariableAdapter.UnidataSpatialDomain
class
VariableAdapter.UnidataTemporalDomain
class
VariableAdapter.UnidataVerticalDomain
-
Constructor Summary
Constructors Constructor Description VariableAdapter(NetCDFImageReader reader, Name coverageName, VariableDS variable)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static void
clearCache()
Clear the parsed unit cacheint
getFeatures(int startIndex, int limit, ListFeatureCollection collection)
Return features for that variable adapter, starting from slices with index = "startIndex", and up to "limit" elements.protected GridGeometry2D
getGridGeometry()
Extracts thegrid geometry
from the unidata variable.int
getHeight()
int
getNDimensionIndex(int n)
Utility method to retrieve the index of a specific dimension index, for constructing the rangeint
getNIndex(int n, int imageIndex)
Utility method to retrieve the n-index of a Variable coverageDescriptor stored onNetCDFImageReader
NetCDF Flat ReaderHashMap
indexMap.int
getNumBands()
int
getNumberOfSlices()
int
getRank()
SampleModel
getSampleModel()
int[]
getShape()
VariableAdapter.UnidataSpatialDomain
getSpatialDomain()
VariableAdapter.UnidataTemporalDomain
getTemporalDomain()
VariableAdapter.UnidataVerticalDomain
getVerticalDomain()
int
getWidth()
Map<String,Integer>
mapIndex(int[] splittedIndex)
int[]
splitIndex(int imageIndex)
Utility method to split the index of a Variable coverageDescriptor stored onNetCDFImageReader
NetCDF Flat ReaderHashMap
indexMap into dimensions.void
updateMapping(SimpleFeatureType indexSchema, List<DimensionDescriptor> descriptors)
Update the dimensionDescriptor attributes mapping by checking the actual attribute names from the schema-
Methods inherited from class CoverageSourceDescriptor
dispose, getAdditionalDomains, getDimensionDescriptors, getName, getRangeType, isHasAdditionalDomains, isHasTemporalDomain, isHasVerticalDomain, setAdditionalDomains, setDimensionDescriptors, setHasAdditionalDomains, setHasTemporalDomain, setHasVerticalDomain, setName, setRangeType, setSpatialDomain, setTemporalDomain, setVerticalDomain
-
-
-
-
Field Detail
-
Z
public static final int Z
- See Also:
- Constant Field Values
-
T
public static final int T
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
VariableAdapter
public VariableAdapter(NetCDFImageReader reader, Name coverageName, VariableDS variable) throws Exception
- Throws:
Exception
-
-
Method Detail
-
getRank
public int getRank()
-
updateMapping
public void updateMapping(SimpleFeatureType indexSchema, List<DimensionDescriptor> descriptors) throws IOException
Update the dimensionDescriptor attributes mapping by checking the actual attribute names from the schema- Throws:
IOException
-
getGridGeometry
protected GridGeometry2D getGridGeometry() throws IOException
Extracts thegrid geometry
from the unidata variable.- Returns:
- the
GridGeometry2D
. - Throws:
IOException
-
getNumBands
public int getNumBands()
-
getSampleModel
public SampleModel getSampleModel()
-
getSpatialDomain
public VariableAdapter.UnidataSpatialDomain getSpatialDomain()
- Overrides:
getSpatialDomain
in classCoverageSourceDescriptor
-
getTemporalDomain
public VariableAdapter.UnidataTemporalDomain getTemporalDomain()
- Overrides:
getTemporalDomain
in classCoverageSourceDescriptor
-
getVerticalDomain
public VariableAdapter.UnidataVerticalDomain getVerticalDomain()
- Overrides:
getVerticalDomain
in classCoverageSourceDescriptor
-
getWidth
public int getWidth()
- Returns:
-
getHeight
public int getHeight()
- Returns:
-
getNDimensionIndex
public int getNDimensionIndex(int n)
Utility method to retrieve the index of a specific dimension index, for constructing the range- Parameters:
n
- the dimension to retrieve the index for (0=Z, 1=T, 2+=Additional)- Returns:
- the index
-
getNIndex
public int getNIndex(int n, int imageIndex)
Utility method to retrieve the n-index of a Variable coverageDescriptor stored onNetCDFImageReader
NetCDF Flat ReaderHashMap
indexMap.- Parameters:
n
-int
the dimensionimageIndex
-int
the image index- Returns:
- n-index
int
-1 if not present
-
splitIndex
public int[] splitIndex(int imageIndex)
Utility method to split the index of a Variable coverageDescriptor stored onNetCDFImageReader
NetCDF Flat ReaderHashMap
indexMap into dimensions.- Parameters:
imageIndex
-int
the index- Returns:
- splitted index
-
getNumberOfSlices
public int getNumberOfSlices()
- Returns:
- the numberOfSlices
-
getShape
public int[] getShape()
- Returns:
- the shape
-
getFeatures
public int getFeatures(int startIndex, int limit, ListFeatureCollection collection)
Return features for that variable adapter, starting from slices with index = "startIndex", and up to "limit" elements. This allows for paging. Put the created features inside the provided collection- Parameters:
startIndex
- the first slice to be returnedlimit
- the max number of features to be createdcollection
- the feature collection where features need to be stored
-
clearCache
public static void clearCache()
Clear the parsed unit cache
-
-