Class NetcdfStore

Object
DataStore
NetcdfStore
All Implemented Interfaces:
Auto­Closeable, Aggregate, Resource, Localized

public class NetcdfStore extends DataStore implements Aggregate
A data store backed by netCDF files. Instances of this data store are created by Netcdf­Store­Provider​.open(Storage­Connector).
Since:
0.3
See Also:

Defined in the sis-netcdf module

  • Constructor Details

  • Method Details

    • getOpenParameters

      public Optional<ParameterValueGroup> getOpenParameters()
      Returns the parameters used to open this netCDF data store. If non-null, the parameters are described by Netcdf­Store­Provider​.get­Open­Parameters() and contains at least a parameter named "location" with a URI value. This method may return null if the storage input can not be described by a URI (for example a netCDF file reading directly from a Readable­Byte­Channel).
      Specified by:
      get­Open­Parameters in class Data­Store
      Returns:
      parameters used for opening this data store.
      Since:
      0.8
    • getConventionVersion

      public Version getConventionVersion() throws DataStoreException
      Returns the version number of the Climate and Forecast (CF) conventions used in the netCDF file. The use of CF convention is mandated by the OGC 11-165r2 standard (CF-netCDF3 Data Model Extension standard).
      Returns:
      CF-convention version, or null if no information about CF convention has been found.
      Throws:
      Data­Store­Exception - if an error occurred while reading the data.
      Since:
      0.8
    • getIdentifier

      public Optional<GenericName> getIdentifier() throws DataStoreException
      Returns an identifier constructed from global attributes or the filename of the netCDF file.
      Specified by:
      get­Identifier in interface Resource
      Overrides:
      get­Identifier in class Data­Store
      Returns:
      the identifier fetched from global attributes or the filename. May be absent.
      Throws:
      Data­Store­Exception - if an error occurred while fetching the identifier.
      Since:
      1.0
    • getMetadata

      public Metadata getMetadata() throws DataStoreException
      Returns information about the dataset as a whole. The returned metadata object can contain information such as the spatiotemporal extent of the dataset, contact information about the creator or distributor, data quality, usage constraints and more.
      Specified by:
      get­Metadata in interface Resource
      Specified by:
      get­Metadata in class Data­Store
      Returns:
      information about the dataset.
      Throws:
      Data­Store­Exception - if an error occurred while reading the data.
    • getNativeMetadata

      public Optional<TreeTable> getNativeMetadata() throws DataStoreException
      Returns netCDF attributes. The meaning of those attributes may vary depending on data provider. The standard metadata should be preferred since they allow abstraction of data format details, but those native metadata are sometime useful when an information is not provided by the standard metadata.
      Overrides:
      get­Native­Metadata in class Data­Store
      Returns:
      resources information structured in an implementation-specific way.
      Throws:
      Data­Store­Exception - if an error occurred while reading the metadata.
      Since:
      1.1
    • components

      public Collection<Resource> components() throws DataStoreException
      Returns the resources (features or coverages) in this netCDF store.
      Specified by:
      components in interface Aggregate
      Returns:
      children resources that are components of this netCDF store.
      Throws:
      Data­Store­Exception - if an error occurred while fetching the components.
      Since:
      0.8
    • addListener

      public <T extends StoreEvent> void addListener(Class<T> eventType, StoreListener<? super T> listener)
      Registers a listener to notify when the specified kind of event occurs in this data store. The current implementation of this data store can emit only Warning­Events; any listener specified for another kind of events will be ignored.
      Specified by:
      add­Listener in interface Resource
      Overrides:
      add­Listener in class Data­Store
    • close

      public void close() throws DataStoreException
      Closes this netCDF store and releases any underlying resources.
      Specified by:
      close in interface Auto­Closeable
      Specified by:
      close in class Data­Store
      Throws:
      Data­Store­Exception - if an error occurred while closing the netCDF file.
    • toString

      public String toString()
      Returns a string representation of this netCDF store for debugging purpose. The content of the string returned by this method may change in any future SIS version.
      Overrides:
      to­String in class Data­Store
      Returns:
      a string representation of this data store for debugging purpose.