Package ucar.nc2.ft2.simpgeometry
Class SimpleGeometryFeatureDataset
- java.lang.Object
-
- ucar.nc2.ft2.simpgeometry.SimpleGeometryFeatureDataset
-
- All Implemented Interfaces:
Closeable,AutoCloseable,FeatureDataset,FileCacheable
public class SimpleGeometryFeatureDataset extends Object implements FeatureDataset
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSimpleGeometryFeatureDataset.SimpleGeometryCovSetThis is a set of GeoGrids with the same GeoCoordSys.
-
Constructor Summary
Constructors Constructor Description SimpleGeometryFeatureDataset(NetcdfDataset ncd)Create a SimpleGeometryFeatureDataset from a NetcdfDataset.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description AttributeContainerattributes()Get the global attributes.voidclose()Close all resources associated with this dataset.AttributefindGlobalAttributeIgnoreCase(String name)Deprecated.use attributes()LatLonRectgetBoundingBox()The lat/lon boundingBox for the entire dataset.CalendarDategetCalendarDateEnd()Ending Calendar date for the entire dataset.CalendarDateRangegetCalendarDateRange()Calendar Date range for the entire dataset.CalendarDategetCalendarDateStart()Starting Calendar date for the entire dataset.VariableSimpleIFgetDataVariable(String shortName)Get the named data Variable.List<VariableSimpleIF>getDataVariables()The data Variables available in this dataset.StringgetDescription()Text information about this dataset.voidgetDetailInfo(Formatter sf)Show debug / underlying implementation detailsFeatureTypegetFeatureType()Contains collections of this FeatureType.List<Attribute>getGlobalAttributes()Deprecated.use attributes()StringgetImplementationName()Show who is implementinglonggetLastModified()Returns the time that the underlying file(s) were last modified.StringgetLocation()The URI location of the datasetStringgetName()the name of the dataset is the last part of the locationNetcdfDatasetgetNetcdfDataset()NetcdfFilegetNetcdfFile()Return underlying NetcdfFile, or null if none.StringgetTitle()Title of the dataset.static SimpleGeometryFeatureDatasetopen(String location)Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems and turn into a SimpleGeometryFeatureDataset.static SimpleGeometryFeatureDatasetopen(String location, Set<NetcdfDataset.Enhance> enhanceMode)Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems and turn into a SimpleGeometryFeatureDataset.voidreacquire()Deprecated.do not usevoidrelease()Deprecated.do not usevoidsetFileCache(FileCacheIF fileCache)Deprecated.do not use
-
-
-
Constructor Detail
-
SimpleGeometryFeatureDataset
public SimpleGeometryFeatureDataset(NetcdfDataset ncd) throws IOException
Create a SimpleGeometryFeatureDataset from a NetcdfDataset.- Parameters:
ncd- underlying NetcdfDataset, will do Enhance.CoordSystems if not already done.- Throws:
IOException- on read error
-
-
Method Detail
-
open
public static SimpleGeometryFeatureDataset open(String location) throws IOException
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems and turn into a SimpleGeometryFeatureDataset.- Parameters:
location- netcdf dataset to open, using NetcdfDataset.acquireDataset().- Returns:
- SimpleGeometryFeatureDataset
- Throws:
IOException- on read error- See Also:
NetcdfDataset.acquireDataset(ucar.nc2.dataset.DatasetUrl, ucar.nc2.util.CancelTask)
-
open
public static SimpleGeometryFeatureDataset open(String location, Set<NetcdfDataset.Enhance> enhanceMode) throws IOException
Open a netcdf dataset, using NetcdfDataset.defaultEnhanceMode plus CoordSystems and turn into a SimpleGeometryFeatureDataset.- Parameters:
location- netcdf dataset to open, using NetcdfDataset.acquireDataset().enhanceMode- open netcdf dataset with this enhanceMode- Returns:
- SimpleGeometryFeatureDataset
- Throws:
IOException- on read error- See Also:
NetcdfDataset.acquireDataset(ucar.nc2.dataset.DatasetUrl, ucar.nc2.util.CancelTask)
-
getTitle
public String getTitle()
Description copied from interface:FeatureDatasetTitle of the dataset.- Specified by:
getTitlein interfaceFeatureDataset- Returns:
- the title of the dataset, or null
-
getDescription
public String getDescription()
Description copied from interface:FeatureDatasetText information about this dataset.- Specified by:
getDescriptionin interfaceFeatureDataset- Returns:
- any text information about this dataset, or null.
-
getLocation
public String getLocation()
Description copied from interface:FeatureDatasetThe URI location of the dataset- Specified by:
getLocationin interfaceFeatureDataset- Specified by:
getLocationin interfaceFileCacheable- Returns:
- the URI location of the dataset, or null
-
getCalendarDateRange
public CalendarDateRange getCalendarDateRange()
Description copied from interface:FeatureDatasetCalendar Date range for the entire dataset.- Specified by:
getCalendarDateRangein interfaceFeatureDataset- Returns:
- the date range for the entire dataset, or null if unknown
-
getCalendarDateStart
public CalendarDate getCalendarDateStart()
Description copied from interface:FeatureDatasetStarting Calendar date for the entire dataset.- Specified by:
getCalendarDateStartin interfaceFeatureDataset- Returns:
- the starting date for the entire dataset, or null if unknown
-
getCalendarDateEnd
public CalendarDate getCalendarDateEnd()
Description copied from interface:FeatureDatasetEnding Calendar date for the entire dataset.- Specified by:
getCalendarDateEndin interfaceFeatureDataset- Returns:
- the ending date for the entire dataset, or null if unknown
-
getBoundingBox
public LatLonRect getBoundingBox()
Description copied from interface:FeatureDatasetThe lat/lon boundingBox for the entire dataset.- Specified by:
getBoundingBoxin interfaceFeatureDataset- Returns:
- the lat/lon boundingBox for the entire dataset, or null if unknown.
-
attributes
public AttributeContainer attributes()
Description copied from interface:FeatureDatasetGet the global attributes.- Specified by:
attributesin interfaceFeatureDataset
-
getGlobalAttributes
@Deprecated public List<Attribute> getGlobalAttributes()
Deprecated.use attributes()Description copied from interface:FeatureDatasetList of global attributes.- Specified by:
getGlobalAttributesin interfaceFeatureDataset- Returns:
- List of type ucar.nc2.Attribute, may be empty but not null
-
findGlobalAttributeIgnoreCase
@Deprecated public Attribute findGlobalAttributeIgnoreCase(String name)
Deprecated.use attributes()Description copied from interface:FeatureDatasetReturn the global attribute with the given name, ignoring case.- Specified by:
findGlobalAttributeIgnoreCasein interfaceFeatureDataset- Parameters:
name- attribute name- Returns:
- the global attribute, or null
-
getDataVariables
public List<VariableSimpleIF> getDataVariables()
Description copied from interface:FeatureDatasetThe data Variables available in this dataset. Should just be data variables others might be searching for, not metadata or coordinate system variables, etc. The shapes of the VariableSimpleIF do not necessarily match the StructureData member.- Specified by:
getDataVariablesin interfaceFeatureDataset- Returns:
- List of subclass of VariableSimpleIF, may be empty but not null
-
getDataVariable
public VariableSimpleIF getDataVariable(String shortName)
Description copied from interface:FeatureDatasetGet the named data Variable.- Specified by:
getDataVariablein interfaceFeatureDataset- Parameters:
shortName- of data Variable.- Returns:
- VariableSimpleIF or null if not found
-
getNetcdfFile
public NetcdfFile getNetcdfFile()
Description copied from interface:FeatureDatasetReturn underlying NetcdfFile, or null if none.- Specified by:
getNetcdfFilein interfaceFeatureDataset- Returns:
- the underlying NetcdfFile, or null if none.
-
close
public void close() throws IOExceptionDescription copied from interface:FeatureDatasetClose all resources associated with this dataset.- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceFeatureDataset- Specified by:
closein interfaceFileCacheable- Throws:
IOException- on i/o error
-
getLastModified
public long getLastModified()
Description copied from interface:FileCacheableReturns the time that the underlying file(s) were last modified. If they've changed since they were stored in the cache, they will be closed and reopened withFileFactory.- Specified by:
getLastModifiedin interfaceFileCacheable- Returns:
- a
longvalue representing the time the file(s) were last modified or0Lif the last-modified time couldn't be determined for any reason.
-
setFileCache
@Deprecated public void setFileCache(FileCacheIF fileCache)
Deprecated.do not useDescription copied from interface:FileCacheableIf the FileCache is not null, FileCacheable.close() must call FileCache.release()public synchronized void close() throws java.io.IOException { if (cache != null) { if (cache.release(this)) return; } reallyClose(); }- Specified by:
setFileCachein interfaceFileCacheable- Parameters:
fileCache- must store this, use it on close as above.
-
getDetailInfo
public void getDetailInfo(Formatter sf)
Description copied from interface:FeatureDatasetShow debug / underlying implementation details- Specified by:
getDetailInfoin interfaceFeatureDataset- Parameters:
sf- append info here
-
getName
public String getName()
the name of the dataset is the last part of the location- Returns:
- the name of the dataset
-
getNetcdfDataset
public NetcdfDataset getNetcdfDataset()
- Returns:
- the underlying NetcdfDataset
-
getFeatureType
public FeatureType getFeatureType()
Description copied from interface:FeatureDatasetContains collections of this FeatureType.- Specified by:
getFeatureTypein interfaceFeatureDataset- Returns:
- FeatureType of data
-
getImplementationName
public String getImplementationName()
Description copied from interface:FeatureDatasetShow who is implementing- Specified by:
getImplementationNamein interfaceFeatureDataset- Returns:
- name of implementor
-
release
@Deprecated public void release() throws IOException
Deprecated.do not useDescription copied from interface:FileCacheableRelease any system resources like file handles. Optional, implement only if you are able to reacquire. Used when object is made inactive in cache.- Specified by:
releasein interfaceFileCacheable- Throws:
IOException
-
reacquire
@Deprecated public void reacquire() throws IOException
Deprecated.do not useDescription copied from interface:FileCacheableReacquire any resources like file handles Used when reactivating in cache.- Specified by:
reacquirein interfaceFileCacheable- Throws:
IOException
-
-