Package org.apache.sis.storage.landsat
Class Band
java.lang.Object
org.apache.sis.internal.storage.GridResourceWrapper
org.apache.sis.storage.landsat.Band
- All Implemented Interfaces:
SchemaModifier
,DataSet
,GridCoverageResource
,Resource
A band in a Landsat data set. Each band is represented by a separated GeoTIFF file.
- Since:
- 1.1
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final BandName
The band for which this instance provides data.(package private) String
Filename of the file to read for band data.(package private) org.opengis.util.LocalName
Identifier of the band for which this instance provides data.private final LandsatStore
The data store that contains this band.(package private) final DefaultSampleDimension
Metadata about the band.Fields inherited from interface org.apache.sis.internal.geotiff.SchemaModifier
DEFAULT, OPTION
-
Constructor Summary
ConstructorsConstructorDescriptionBand
(LandsatStore parent, BandName band) Creates a new resource for the specified band. -
Method Summary
Modifier and TypeMethodDescriptionprotected GridCoverageResource
Creates the GeoTIFF reader and get the first image from it.customize
(int image, int band, NumberRange<?> sampleRange, SampleDimension.Builder dimension) Invoked when a sample dimension is created for a band in an image.org.opengis.metadata.Metadata
customize
(int image, DefaultMetadata metadata) Invoked when the GeoTIFF reader creates a metadata.org.opengis.util.GenericName
customize
(int image, org.opengis.util.GenericName fallback) Invoked when the GeoTIFF reader creates the resource identifier.Optional
<org.opengis.util.GenericName> Returns the resource persistent identifier.protected final Object
Returns the object on which to perform all synchronizations for thread-safety.boolean
isElectromagneticMeasurement
(int image) Returnstrue
if the converted values are measurement in the electromagnetic spectrum.Methods inherited from class org.apache.sis.internal.storage.GridResourceWrapper
addListener, closeDataStore, getEnvelope, getGridGeometry, getLoadingStrategy, getMetadata, getResolutions, getSampleDimensions, read, removeListener, setLoadingStrategy, source
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.apache.sis.storage.GridCoverageResource
subset
-
Field Details
-
parent
The data store that contains this band. Also the object on which to perform synchronization locks. -
band
The band for which this instance provides data. -
identifier
org.opengis.util.LocalName identifierIdentifier of the band for which this instance provides data. Should not be modified after the end of metadata parsing.- See Also:
-
filename
String filenameFilename of the file to read for band data. This is relative toLandsatStore.directory
. Should not be modified after the end of metadata parsing. -
sampleDimension
Metadata about the band. Should not be modified after the end of metadata parsing.
-
-
Constructor Details
-
Band
Band(LandsatStore parent, BandName band) Creates a new resource for the specified band.
-
-
Method Details
-
getSynchronizationLock
Returns the object on which to perform all synchronizations for thread-safety.- Specified by:
getSynchronizationLock
in classGridResourceWrapper
- Returns:
- the object on which to perform synchronizations.
-
createSource
Creates the GeoTIFF reader and get the first image from it.- Specified by:
createSource
in classGridResourceWrapper
- Returns:
- the resource on which to delegate operations.
- Throws:
DataStoreException
- if the resource cannot be created.
-
getIdentifier
Returns the resource persistent identifier. The name is theEnum.name()
and the scope (namespace) is the name of the directory that contains this band.- Specified by:
getIdentifier
in interfaceResource
- Overrides:
getIdentifier
in classGridResourceWrapper
- 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 enclosingBand
.- Specified by:
customize
in interfaceSchemaModifier
- Parameters:
image
- index of the image for which to compute identifier, or -1 for the whole store.fallback
- the default identifier computed byGeoTiffStore
. May benull
ifGeoTiffStore
has been unable to determine an identifier by itself.- Returns:
- the identifier to use, or
null
if none.
-
customize
Invoked when the GeoTIFF reader creates a metadata. This method modifies or completes some information inferred by the GeoTIFF reader.- Specified by:
customize
in interfaceSchemaModifier
- Parameters:
image
- index of the image for which to compute metadata, or -1 for the whole store.metadata
- metadata pre-filled byGeoTiffStore
(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 interfaceSchemaModifier
- 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, ornull
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) Returnstrue
if the converted values are measurement in the electromagnetic spectrum.- Specified by:
isElectromagneticMeasurement
in interfaceSchemaModifier
- Parameters:
image
- index of the image for which to compute metadata.- Returns:
true
if the image contains measurements in the electromagnetic spectrum.
-