Package org.apache.sis.internal.geotiff
Interface SchemaModifier
- All Known Implementing Classes:
Band
public interface SchemaModifier
Modifies the metadata and bands inferred from GeoTIFF tags.
Image indices
All imageindex
arguments in this interfaces starts with 0 for the first (potentially pyramided) image
and are incremented by 1 after each pyramid, as defined by the cloud Optimized GeoTIFF specification.
Consequently, those indices may differ from TIFF Image File Directory (IFD) indices.- Since:
- 1.1
- Version:
- 1.2
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final SchemaModifier
The default instance which performs no modification.static final OptionKey<SchemaModifier>
The option for declaring a schema modifier atGeoTiffStore
creation time. -
Method Summary
Modifier and TypeMethodDescriptiondefault SampleDimension
customize
(int image, int band, NumberRange<?> sampleRange, SampleDimension.Builder dimension) Invoked when a sample dimension is created for a band in an image.default org.opengis.metadata.Metadata
customize
(int image, DefaultMetadata metadata) Invoked when a metadata is created for a single image or for the whole data store.default org.opengis.util.GenericName
customize
(int image, org.opengis.util.GenericName identifier) Invoked when an identifier is created for a single image or for the whole data store.default boolean
isElectromagneticMeasurement
(int image) Returnstrue
if the converted values are measurement in the electromagnetic spectrum.
-
Field Details
-
OPTION
The option for declaring a schema modifier atGeoTiffStore
creation time. -
DEFAULT
The default instance which performs no modification.
-
-
Method Details
-
customize
default org.opengis.util.GenericName customize(int image, org.opengis.util.GenericName identifier) Invoked when an identifier is created for a single image or for the whole data store. Implementations can override this method for replacing the given identifier by their own.- Parameters:
image
- index of the image for which to compute identifier, or -1 for the whole store.identifier
- 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
default org.opengis.metadata.Metadata customize(int image, DefaultMetadata metadata) throws DataStoreException Invoked when a metadata is created for a single image or for the whole data store. Implementations can override this method for modifying or replacing the given metadata. The givenDefaultMetadata
instance is still in modifiable state when this method is invoked.- 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. - Throws:
DataStoreException
- if an exception occurred while updating metadata.
-
customize
default SampleDimension customize(int image, int band, NumberRange<?> sampleRange, SampleDimension.Builder dimension) Invoked when a sample dimension is created for a band in an image.GeoTiffStore
invokes this method with a builder initialized to band number as dimension name, with the fill value declared as background and with no category. Implementations can override this method for setting a better name or for declaring the meaning of sample values (by adding "categories").- 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
default boolean isElectromagneticMeasurement(int image) Returnstrue
if the converted values are measurement in the electromagnetic spectrum. This flag controls the kind of metadata objects (ImageDescription versus CoverageDescription) to be created for describing an image with these sample dimensions. Those metadata have properties specific to electromagnetic spectrum, such as wavelength of peak response.- Parameters:
image
- index of the image for which to compute metadata.- Returns:
true
if the image contains measurements in the electromagnetic spectrum.
-