public class GridDataset extends java.lang.Object implements GridDataset, FeatureDataset
GridDataset gridDs = GridDataset.open (uriString);
List grids = gridDs.getGrids();
for (int i=0; i<grids.size(); i++) {
GeoGrid grid = (Geogrid) grids.get(i);
}
| Modifier and Type | Class and Description |
|---|---|
class |
GridDataset.Gridset
This is a set of GeoGrids with the same GeoCoordSys.
|
| Constructor and Description |
|---|
GridDataset(NetcdfDataset ds)
Create a GridDataset from a NetcdfDataset.
|
GridDataset(NetcdfDataset ds,
java.util.Formatter parseInfo)
Create a GridDataset from a NetcdfDataset.
|
| Modifier and Type | Method and Description |
|---|---|
void |
calcBounds()
Caclulate date range and bounding box, even if the data has to be scanned.
|
void |
close()
Close all resources associated with this dataset.
|
static GridDataset |
factory(java.lang.String netcdfFileURI)
Deprecated.
: use GridDataset.open().
|
Attribute |
findGlobalAttributeIgnoreCase(java.lang.String name)
Return the global attribute with the given name, ignoring case.
|
GeoGrid |
findGridByName(java.lang.String fullName)
find the named GeoGrid.
|
GridDatatype |
findGridDatatype(java.lang.String name)
find the named GridDatatype.
|
LatLonRect |
getBoundingBox()
The boundingBox for the entire dataset.
|
VariableSimpleIF |
getDataVariable(java.lang.String shortName)
Get the named data Variable.
|
java.util.List<VariableSimpleIF> |
getDataVariables()
The data Variables available in this dataset.
|
DateRange |
getDateRange()
Date range for the entire dataset.
|
java.lang.String |
getDescription()
Text information about this dataset.
|
java.lang.String |
getDetailInfo()
Get Details about the dataset.
|
void |
getDetailInfo(java.util.Formatter buff)
Show debug / underlying implementation details
|
java.util.Date |
getEndDate()
Ending date for the entire dataset.
|
FeatureType |
getFeatureType()
Contains collections of this FeatureType.
|
java.util.List<Attribute> |
getGlobalAttributes()
List of global attributes.
|
java.util.List<GridDatatype> |
getGrids()
get the list of GridDatatype objects contained in this dataset.
|
java.util.List<GridDataset.Gridset> |
getGridsets()
Return GridDatatype objects grouped by GridCoordSys.
|
java.lang.String |
getImplementationName()
Show who is implementing
|
java.lang.String |
getLocation()
The URI location of the dataset
|
java.lang.String |
getLocationURI() |
java.lang.String |
getName() |
NetcdfDataset |
getNetcdfDataset() |
NetcdfFile |
getNetcdfFile()
Return underlying NetcdfFile, or null if none.
|
java.util.Date |
getStartDate()
Starting date for the entire dataset.
|
java.lang.String |
getTitle()
Title of the dataset.
|
static void |
main(java.lang.String[] arg)
testing
|
static GridDataset |
open(java.lang.String location)
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
and turn into a GridDataset.
|
static GridDataset |
open(java.lang.String location,
java.util.Set<NetcdfDataset.Enhance> enhanceMode)
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
and turn into a GridDataset.
|
void |
setFileCache(FileCache fileCache)
If the FileCache is set, the FileCacheable object must store it and call FileCache.release() on FileCacheable.close():
|
boolean |
sync()
Sync() is called when the FileCacheable is found in the cache, before returning the object to the
application.
|
protected FileCache fileCache
public GridDataset(NetcdfDataset ds) throws java.io.IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.java.io.IOException - on read errorpublic GridDataset(NetcdfDataset ds, java.util.Formatter parseInfo) throws java.io.IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.parseInfo - put parse info here, may be nulljava.io.IOException - on read errorpublic static GridDataset open(java.lang.String location) throws java.io.IOException
location - netcdf dataset to open, using NetcdfDataset.acquireDataset().java.io.IOException - on read errorNetcdfDataset.acquireDataset(java.lang.String, ucar.nc2.util.CancelTask)public static GridDataset open(java.lang.String location, java.util.Set<NetcdfDataset.Enhance> enhanceMode) throws java.io.IOException
location - netcdf dataset to open, using NetcdfDataset.acquireDataset().enhanceMode - open netcdf dataset with this enhanceModejava.io.IOException - on read errorNetcdfDataset.acquireDataset(java.lang.String, ucar.nc2.util.CancelTask)public java.lang.String getTitle()
FeatureDatasetgetTitle in interface TypedDatasetgetTitle in interface FeatureDatasetpublic java.lang.String getDescription()
FeatureDatasetgetDescription in interface TypedDatasetgetDescription in interface FeatureDatasetpublic java.lang.String getLocation()
FeatureDatasetgetLocation in interface FeatureDatasetgetLocation in interface FileCacheablepublic java.lang.String getLocationURI()
getLocationURI in interface TypedDatasetpublic java.util.Date getStartDate()
FeatureDatasetgetStartDate in interface TypedDatasetgetStartDate in interface FeatureDatasetpublic java.util.Date getEndDate()
FeatureDatasetgetEndDate in interface TypedDatasetgetEndDate in interface FeatureDatasetpublic LatLonRect getBoundingBox()
FeatureDatasetgetBoundingBox in interface TypedDatasetgetBoundingBox in interface FeatureDatasetpublic void calcBounds()
throws java.io.IOException
FeatureDatasetcalcBounds in interface FeatureDatasetjava.io.IOException - or read error.public java.util.List<Attribute> getGlobalAttributes()
TypedDatasetgetGlobalAttributes in interface TypedDatasetgetGlobalAttributes in interface FeatureDatasetpublic Attribute findGlobalAttributeIgnoreCase(java.lang.String name)
FeatureDatasetfindGlobalAttributeIgnoreCase in interface TypedDatasetfindGlobalAttributeIgnoreCase in interface FeatureDatasetname - attribute namepublic java.util.List<VariableSimpleIF> getDataVariables()
TypedDatasetgetDataVariables in interface TypedDatasetgetDataVariables in interface FeatureDatasetpublic VariableSimpleIF getDataVariable(java.lang.String shortName)
TypedDatasetgetDataVariable in interface TypedDatasetgetDataVariable in interface FeatureDatasetshortName - of data Variable.public NetcdfFile getNetcdfFile()
FeatureDatasetgetNetcdfFile in interface TypedDatasetgetNetcdfFile in interface FeatureDatasetpublic java.lang.String getName()
public NetcdfDataset getNetcdfDataset()
public java.util.List<GridDatatype> getGrids()
GridDatasetgetGrids in interface GridDatasetpublic GridDatatype findGridDatatype(java.lang.String name)
GridDatasetfindGridDatatype in interface GridDatasetname - full unescaped namepublic java.util.List<GridDataset.Gridset> getGridsets()
getGridsets in interface GridDatasetpublic GeoGrid findGridByName(java.lang.String fullName)
fullName - find this GeoGrid by full namepublic java.lang.String getDetailInfo()
getDetailInfo in interface TypedDatasetpublic void getDetailInfo(java.util.Formatter buff)
FeatureDatasetgetDetailInfo in interface FeatureDatasetbuff - append info herepublic FeatureType getFeatureType()
FeatureDatasetgetFeatureType in interface FeatureDatasetpublic DateRange getDateRange()
FeatureDatasetgetDateRange in interface FeatureDatasetpublic java.lang.String getImplementationName()
FeatureDatasetgetImplementationName in interface FeatureDatasetpublic void close()
throws java.io.IOException
TypedDatasetclose in interface TypedDatasetclose in interface FeatureDatasetclose in interface FileCacheablejava.io.IOExceptionpublic boolean sync()
throws java.io.IOException
FileCacheablesync in interface FileCacheablejava.io.IOException - on i/o error.public void setFileCache(FileCache fileCache)
FileCacheable
public synchronized void close() throws java.io.IOException {
if (isClosed) return;
if (cache != null) {
cache.release(this);
} else {
reallyClose();
}
isClosed = true;
setFileCache in interface FileCacheablefileCache - must store this, use it on close as above.public static GridDataset factory(java.lang.String netcdfFileURI) throws java.io.IOException
java.io.IOExceptionpublic static void main(java.lang.String[] arg)