Class Band

All Implemented Interfaces:
SchemaModifier, DataSet, GridCoverageResource, Resource

final class Band extends GridResourceWrapper implements SchemaModifier
A band in a Landsat data set. Each band is represented by a separated GeoTIFF file.
Since:
1.1
Version:
1.2
  • Field Details

    • parent

      private final LandsatStore parent
      The data store that contains this band. Also the object on which to perform synchronization locks.
    • band

      final BandName band
      The band for which this instance provides data.
    • identifier

      org.opengis.util.LocalName identifier
      Identifier of the band for which this instance provides data. Should not be modified after the end of metadata parsing.
      See Also:
    • filename

      String filename
      Filename of the file to read for band data. This is relative to LandsatStore.directory. Should not be modified after the end of metadata parsing.
    • sampleDimension

      final DefaultSampleDimension sampleDimension
      Metadata about the band. Should not be modified after the end of metadata parsing.
  • Constructor Details

  • Method Details

    • getSynchronizationLock

      protected final Object getSynchronizationLock()
      Returns the object on which to perform all synchronizations for thread-safety.
      Specified by:
      getSynchronizationLock in class GridResourceWrapper
      Returns:
      the object on which to perform synchronizations.
    • createSource

      protected GridCoverageResource createSource() throws DataStoreException
      Creates the GeoTIFF reader and get the first image from it.
      Specified by:
      createSource in class GridResourceWrapper
      Returns:
      the resource on which to delegate operations.
      Throws:
      DataStoreException - if the resource cannot be created.
    • getIdentifier

      public Optional<org.opengis.util.GenericName> getIdentifier() throws DataStoreException
      Returns the resource persistent identifier. The name is the Enum.name() and the scope (namespace) is the name of the directory that contains this band.
      Specified by:
      getIdentifier in interface Resource
      Overrides:
      getIdentifier in class GridResourceWrapper
      Returns:
      a persistent identifier unique within the data store, or absent if this resource has no such identifier.
      Throws:
      DataStoreException - if an error occurred while fetching the identifier.
      See Also:
    • customize

      public org.opengis.util.GenericName customize(int image, org.opengis.util.GenericName fallback)
      Invoked when the GeoTIFF reader creates the resource identifier. We use the identifier of the enclosing Band.
      Specified by:
      customize in interface SchemaModifier
      Parameters:
      image - index of the image for which to compute identifier, or -1 for the whole store.
      fallback - the default identifier computed by GeoTiffStore. May be null if GeoTiffStore has been unable to determine an identifier by itself.
      Returns:
      the identifier to use, or null if none.
    • customize

      public org.opengis.metadata.Metadata customize(int image, DefaultMetadata metadata)
      Invoked when the GeoTIFF reader creates a metadata. This method modifies or completes some information inferred by the GeoTIFF reader.
      Specified by:
      customize in interface SchemaModifier
      Parameters:
      image - index of the image for which to compute metadata, or -1 for the whole store.
      metadata - metadata pre-filled by GeoTiffStore (never null). Can be modified in-place.
      Returns:
      the metadata to return to user. This is often the same instance than the given metadata. Should never be null.
    • customize

      public SampleDimension customize(int image, int band, NumberRange<?> sampleRange, SampleDimension.Builder dimension)
      Invoked when a sample dimension is created for a band in an image.
      Specified by:
      customize in interface SchemaModifier
      Parameters:
      image - index of the image for which to create sample dimension.
      band - index of the band for which to create sample dimension.
      sampleRange - minimum and maximum values declared in the TIFF tags, or null if unknown. This range may contain the background value.
      dimension - a sample dimension builder initialized with band number as the dimension name. This builder can be modified in-place.
      Returns:
      the sample dimension to use.
    • isElectromagneticMeasurement

      public boolean isElectromagneticMeasurement(int image)
      Returns true if the converted values are measurement in the electromagnetic spectrum.
      Specified by:
      isElectromagneticMeasurement in interface SchemaModifier
      Parameters:
      image - index of the image for which to compute metadata.
      Returns:
      true if the image contains measurements in the electromagnetic spectrum.