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 |
---|---|
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 ncd)
Create a GridDataset from a NetcdfDataset.
|
GridDataset(NetcdfDataset ncd,
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.
|
GeoGrid |
findGridByShortName(java.lang.String shortName)
find the named GeoGrid.
|
GridDatatype |
findGridDatatype(java.lang.String name)
find the named GridDatatype.
|
GeoGrid |
findGridDatatypeByAttribute(java.lang.String attName,
java.lang.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(java.lang.String shortName)
Get the named data Variable.
|
java.util.List<VariableSimpleIF> |
getDataVariables()
The data Variables available in this dataset.
|
DateRange |
getDateRange()
Deprecated.
use getCalendarDateRange
|
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()
Deprecated.
use getEndCalendarDate
|
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
|
long |
getLastModified()
Returns the time that the underlying file(s) were last modified.
|
java.lang.String |
getLocation()
The URI location of the dataset
|
java.lang.String |
getLocationURI() |
java.lang.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.
|
java.util.Date |
getStartDate()
Deprecated.
use getStartCalendarDate
|
java.lang.String |
getTitle()
Title of the dataset.
|
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 |
reacquire() |
void |
release() |
void |
setFileCache(FileCacheIF fileCache)
If the FileCache is not null, FileCacheable.close() must call FileCache.release()
|
protected FileCacheIF fileCache
public GridDataset(NetcdfDataset ncd) throws java.io.IOException
ncd
- underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.java.io.IOException
- on read errorpublic GridDataset(NetcdfDataset ncd, java.util.Formatter parseInfo) throws java.io.IOException
ncd
- 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()
FeatureDataset
getTitle
in interface TypedDataset
getTitle
in interface FeatureDataset
public java.lang.String getDescription()
FeatureDataset
getDescription
in interface TypedDataset
getDescription
in interface FeatureDataset
public java.lang.String getLocation()
FeatureDataset
getLocation
in interface FeatureDataset
getLocation
in interface FileCacheable
public java.lang.String getLocationURI()
getLocationURI
in interface TypedDataset
public DateRange getDateRange()
FeatureDataset
getDateRange
in interface FeatureDataset
public java.util.Date getStartDate()
FeatureDataset
getStartDate
in interface TypedDataset
getStartDate
in interface FeatureDataset
public java.util.Date getEndDate()
FeatureDataset
getEndDate
in interface TypedDataset
getEndDate
in interface FeatureDataset
public CalendarDateRange getCalendarDateRange()
FeatureDataset
getCalendarDateRange
in interface FeatureDataset
public CalendarDate getCalendarDateStart()
FeatureDataset
getCalendarDateStart
in interface GridDataset
getCalendarDateStart
in interface FeatureDataset
public CalendarDate getCalendarDateEnd()
FeatureDataset
getCalendarDateEnd
in interface GridDataset
getCalendarDateEnd
in interface FeatureDataset
public LatLonRect getBoundingBox()
FeatureDataset
getBoundingBox
in interface TypedDataset
getBoundingBox
in interface FeatureDataset
public void calcBounds() throws java.io.IOException
FeatureDataset
calcBounds
in interface FeatureDataset
java.io.IOException
- or read error.public java.util.List<Attribute> getGlobalAttributes()
TypedDataset
getGlobalAttributes
in interface TypedDataset
getGlobalAttributes
in interface FeatureDataset
public Attribute findGlobalAttributeIgnoreCase(java.lang.String name)
FeatureDataset
findGlobalAttributeIgnoreCase
in interface TypedDataset
findGlobalAttributeIgnoreCase
in interface FeatureDataset
name
- attribute namepublic java.util.List<VariableSimpleIF> getDataVariables()
TypedDataset
getDataVariables
in interface TypedDataset
getDataVariables
in interface FeatureDataset
public VariableSimpleIF getDataVariable(java.lang.String shortName)
TypedDataset
getDataVariable
in interface TypedDataset
getDataVariable
in interface FeatureDataset
shortName
- of data Variable.public NetcdfFile getNetcdfFile()
FeatureDataset
getNetcdfFile
in interface TypedDataset
getNetcdfFile
in interface FeatureDataset
public java.lang.String getName()
public NetcdfDataset getNetcdfDataset()
public java.util.List<GridDatatype> getGrids()
GridDataset
getGrids
in interface GridDataset
public GridDatatype findGridDatatype(java.lang.String name)
GridDataset
findGridDatatype
in interface GridDataset
name
- full unescaped namepublic java.util.List<GridDataset.Gridset> getGridsets()
getGridsets
in interface GridDataset
public GeoGrid findGridByName(java.lang.String fullName)
fullName
- find this GeoGrid by full namepublic GeoGrid findGridByShortName(java.lang.String shortName)
findGridByShortName
in interface GridDataset
shortName
- find this GeoGrid by short namepublic GeoGrid findGridDatatypeByAttribute(java.lang.String attName, java.lang.String attValue)
public java.lang.String getDetailInfo()
getDetailInfo
in interface TypedDataset
public void getDetailInfo(java.util.Formatter buff)
FeatureDataset
getDetailInfo
in interface FeatureDataset
buff
- append info herepublic FeatureType getFeatureType()
FeatureDataset
getFeatureType
in interface FeatureDataset
public java.lang.String getImplementationName()
FeatureDataset
getImplementationName
in interface FeatureDataset
public void close() throws java.io.IOException
TypedDataset
close
in interface java.io.Closeable
close
in interface java.lang.AutoCloseable
close
in interface TypedDataset
close
in interface FeatureDataset
close
in interface FileCacheable
java.io.IOException
- on io errorpublic void release() throws java.io.IOException
release
in interface FileCacheable
java.io.IOException
public void reacquire() throws java.io.IOException
reacquire
in interface FileCacheable
java.io.IOException
public long getLastModified()
FileCacheable
FileFactory
.getLastModified
in interface FileCacheable
long
value representing the time the file(s) were last modified or 0L
if the
last-modified time couldn't be determined for any reason.public void setFileCache(FileCacheIF fileCache)
FileCacheable
public synchronized void close() throws java.io.IOException { if (cache != null) { if (cache.release(this)) return; } reallyClose(); }
setFileCache
in interface FileCacheable
fileCache
- must store this, use it on close as above.public static GridDataset factory(java.lang.String netcdfFileURI) throws java.io.IOException
java.io.IOException