public class GridDataset extends 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 |
|---|---|
static class |
GridDataset.Gridset
This is a set of GeoGrids with the same GeoCoordSys.
|
| Modifier and Type | Field and Description |
|---|---|
protected FileCacheIF |
fileCache |
| Constructor and Description |
|---|
GridDataset(NetcdfDataset ds)
Create a GridDataset from a NetcdfDataset.
|
GridDataset(NetcdfDataset ds,
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(String netcdfFileURI)
Deprecated.
: use GridDataset.open().
|
Attribute |
findGlobalAttributeIgnoreCase(String name)
Return the global attribute with the given name, ignoring case.
|
GeoGrid |
findGridByName(String fullName)
find the named GeoGrid.
|
GeoGrid |
findGridByShortName(String shortName)
find the named GeoGrid.
|
GridDatatype |
findGridDatatype(String name)
find the named GridDatatype.
|
GeoGrid |
findGridDatatypeByAttribute(String attName,
String attValue) |
LatLonRect |
getBoundingBox()
The boundingBox for the entire dataset.
|
CalendarDate |
getCalendarDateEnd()
Ending Calendar date for the entire dataset.
|
CalendarDateRange |
getCalendarDateRange()
Calendar Date range for the entire dataset.
|
CalendarDate |
getCalendarDateStart()
Starting Calendar date for the entire dataset.
|
VariableSimpleIF |
getDataVariable(String shortName)
Get the named data Variable.
|
List<VariableSimpleIF> |
getDataVariables()
The data Variables available in this dataset.
|
DateRange |
getDateRange()
Deprecated.
use getCalendarDateRange
|
String |
getDescription()
Text information about this dataset.
|
String |
getDetailInfo()
Get Details about the dataset.
|
void |
getDetailInfo(Formatter buff)
Show debug / underlying implementation details
|
Date |
getEndDate()
Deprecated.
use getEndCalendarDate
|
FeatureType |
getFeatureType()
Contains collections of this FeatureType.
|
List<Attribute> |
getGlobalAttributes()
List of global attributes.
|
List<GridDatatype> |
getGrids()
get the list of GridDatatype objects contained in this dataset.
|
List<GridDataset.Gridset> |
getGridsets()
Return GridDatatype objects grouped by GridCoordSys.
|
String |
getImplementationName()
Show who is implementing
|
long |
getLastModified()
Get last modified date of underlying file(s).
|
String |
getLocation()
The URI location of the dataset
|
String |
getLocationURI() |
String |
getName()
the name of the dataset is the last part of the location
|
NetcdfDataset |
getNetcdfDataset() |
NetcdfFile |
getNetcdfFile()
Return underlying NetcdfFile, or null if none.
|
Date |
getStartDate()
Deprecated.
use getStartCalendarDate
|
String |
getTitle()
Title of the dataset.
|
static GridDataset |
open(String location)
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
and turn into a GridDataset.
|
static GridDataset |
open(String location,
Set<NetcdfDataset.Enhance> enhanceMode)
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems
and turn into a GridDataset.
|
void |
setFileCache(FileCacheIF fileCache)
If the FileCache is not null, FileCacheable.close() must call FileCache.release()
|
protected FileCacheIF fileCache
public GridDataset(NetcdfDataset ds) throws IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.IOException - on read errorpublic GridDataset(NetcdfDataset ds, Formatter parseInfo) throws IOException
ds - underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.parseInfo - put parse info here, may be nullIOException - on read errorpublic static GridDataset open(String location) throws IOException
location - netcdf dataset to open, using NetcdfDataset.acquireDataset().IOException - on read errorNetcdfDataset.acquireDataset(java.lang.String, ucar.nc2.util.CancelTask)public static GridDataset open(String location, Set<NetcdfDataset.Enhance> enhanceMode) throws IOException
location - netcdf dataset to open, using NetcdfDataset.acquireDataset().enhanceMode - open netcdf dataset with this enhanceModeIOException - on read errorNetcdfDataset.acquireDataset(java.lang.String, ucar.nc2.util.CancelTask)public String getTitle()
FeatureDatasetgetTitle in interface TypedDatasetgetTitle in interface FeatureDatasetpublic String getDescription()
FeatureDatasetgetDescription in interface TypedDatasetgetDescription in interface FeatureDatasetpublic String getLocation()
FeatureDatasetgetLocation in interface FeatureDatasetgetLocation in interface FileCacheablepublic String getLocationURI()
getLocationURI in interface TypedDatasetpublic DateRange getDateRange()
FeatureDatasetgetDateRange in interface FeatureDatasetpublic Date getStartDate()
FeatureDatasetgetStartDate in interface TypedDatasetgetStartDate in interface FeatureDatasetpublic Date getEndDate()
FeatureDatasetgetEndDate in interface TypedDatasetgetEndDate in interface FeatureDatasetpublic CalendarDateRange getCalendarDateRange()
FeatureDatasetgetCalendarDateRange in interface FeatureDatasetpublic CalendarDate getCalendarDateStart()
FeatureDatasetgetCalendarDateStart in interface GridDatasetgetCalendarDateStart in interface FeatureDatasetpublic CalendarDate getCalendarDateEnd()
FeatureDatasetgetCalendarDateEnd in interface GridDatasetgetCalendarDateEnd in interface FeatureDatasetpublic LatLonRect getBoundingBox()
FeatureDatasetgetBoundingBox in interface TypedDatasetgetBoundingBox in interface FeatureDatasetpublic void calcBounds()
throws IOException
FeatureDatasetcalcBounds in interface FeatureDatasetIOException - or read error.public List<Attribute> getGlobalAttributes()
TypedDatasetgetGlobalAttributes in interface TypedDatasetgetGlobalAttributes in interface FeatureDatasetpublic Attribute findGlobalAttributeIgnoreCase(String name)
FeatureDatasetfindGlobalAttributeIgnoreCase in interface TypedDatasetfindGlobalAttributeIgnoreCase in interface FeatureDatasetname - attribute namepublic List<VariableSimpleIF> getDataVariables()
TypedDatasetgetDataVariables in interface TypedDatasetgetDataVariables in interface FeatureDatasetpublic VariableSimpleIF getDataVariable(String shortName)
TypedDatasetgetDataVariable in interface TypedDatasetgetDataVariable in interface FeatureDatasetshortName - of data Variable.public NetcdfFile getNetcdfFile()
FeatureDatasetgetNetcdfFile in interface TypedDatasetgetNetcdfFile in interface FeatureDatasetpublic String getName()
public NetcdfDataset getNetcdfDataset()
public List<GridDatatype> getGrids()
GridDatasetgetGrids in interface GridDatasetpublic GridDatatype findGridDatatype(String name)
GridDatasetfindGridDatatype in interface GridDatasetname - full unescaped namepublic List<GridDataset.Gridset> getGridsets()
getGridsets in interface GridDatasetpublic GeoGrid findGridByName(String fullName)
fullName - find this GeoGrid by full namepublic GeoGrid findGridByShortName(String shortName)
findGridByShortName in interface GridDatasetshortName - find this GeoGrid by short namepublic GeoGrid findGridDatatypeByAttribute(String attName, String attValue)
public String getDetailInfo()
getDetailInfo in interface TypedDatasetpublic void getDetailInfo(Formatter buff)
FeatureDatasetgetDetailInfo in interface FeatureDatasetbuff - append info herepublic FeatureType getFeatureType()
FeatureDatasetgetFeatureType in interface FeatureDatasetpublic String getImplementationName()
FeatureDatasetgetImplementationName in interface FeatureDatasetpublic void close()
throws IOException
TypedDatasetclose in interface AutoCloseableclose in interface TypedDatasetclose in interface FeatureDatasetclose in interface FileCacheableIOException - on io errorpublic long getLastModified()
FileCacheablegetLastModified in interface FileCacheablepublic void setFileCache(FileCacheIF fileCache)
FileCacheable
public synchronized void close() throws java.io.IOException {
if (cache != null) {
cache.release(this);
} else {
reallyClose();
}
setFileCache in interface FileCacheablefileCache - must store this, use it on close as above.public static GridDataset factory(String netcdfFileURI) throws IOException
IOExceptionCopyright © 1999–2015 UCAR/Unidata. All rights reserved.