Class MetadataBuilder
- Direct Known Subclasses:
FeatureCatalogBuilder
,ImageMetadataBuilder
,MetadataReader
DataStore
implementations.
This is not a general-purpose builder suitable for public API, since the
methods provided in this class are tailored for Apache SIS data store needs.
API of this class may change in any future SIS versions.- Since:
- 0.8
- Version:
- 1.3
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
The type of grid spatial representation (georectified, georeferenceable or unspecified).private static final class
Elements to omit in the legal notice to be parsed byparseLegalNotice(String)
.static enum
The type of party to create (individual, organization or unknown).static enum
Specify if an information apply to data, to metadata or to both.private static final class
An international string where localized identifiers are formatted more like an English sentence. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DefaultAcquisitionInformation
Information about the platforms and sensors that collected the data, ornull
if none.private DefaultAttributeGroup
Information about content type for groups of attributes for a specific range dimension, ornull
if none.private DefaultCitation
The citation of data identification, ornull
if none.private DefaultLegalConstraints
Copyright information, ornull
if none.private DefaultCoverageDescription
Information about the content of a grid data cell, ornull
if none.private DefaultDistribution
Information about the distributor of and options for obtaining the resource.private boolean
true
if the nextCoverageDescription
to create will be a description of measurements in the electromagnetic spectrum.private DefaultExtent
The extent information that are part of identification, ornull
if none.Information about the feature types, ornull
if none.private org.opengis.metadata.distribution.Format
The distribution format, ornull
if none.private DefaultGridSpatialRepresentation
Information about the grid shape, ornull
if none.private MetadataBuilder.GridType
Whether the next grid should be an instance ofDefaultGeorectified
orDefaultGeoreferenceable
.private DefaultGCPCollection
Collection of ground control points.private DefaultDataIdentification
The identification information that are part of metadata, ornull
if none.private DefaultLineage
Information about the events or source data used in constructing the data specified by the scope.private DefaultMetadata
The metadata created by this builder, ornull
if not yet created.private AbstractParty
Part of the responsible party of the citation, ornull
if none.private MetadataBuilder.PartyType
Whether the next party to create should be an instance ofDefaultIndividual
orDefaultOrganisation
.private DefaultPlatform
Platform where are installed the sensors that collected the data, ornull
if none.private DefaultProcessing
Information about the procedures, processes and algorithms applied in the process step.private DefaultProcessStep
Information about an event or transformation in the life of a resource.private DefaultResponsibleParty
Part of the responsible party of the citation, ornull
if none.private DefaultSampleDimension
The characteristic of each dimension (layer) included in the resource, ornull
if none.For using the same instance ofInteger
orDouble
when the value is the same.private byte
Whether to add ISO 19115-1 and ISO 19115-2 entries in "metadata standards" node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate DefaultAcquisitionInformation
Creates the acquisition information object if it does not already exists, then returns it.final void
addAbstract
(CharSequence description) Adds a brief narrative summary of the resource(s).final void
addAccessConstraint
(org.opengis.metadata.constraint.Restriction restriction) Adds an access constraint applied to assure the protection of privacy or intellectual property, and any special restrictions or limitations on obtaining the resource.final void
addAcquisitionOperation
(CharSequence program, String identifier) Adds the identifier of the operation used to acquire the dataset.final void
addAcquisitionRequirement
(CharSequence authority, String identifier) Adds the identifier of the requirement to be satisfied by data acquisition.final void
addAcquisitionTime
(Instant startTime, Instant endTime) Adds an event that describe the range of time at which data were acquired.final void
addAcquisitionTime
(Date time) Adds an event that describe the time at which data were acquired.final void
addAuthor
(CharSequence name) Adds an author name.final void
addBandDescription
(CharSequence description) Adds a description of the current band.final void
addBandName
(CharSequence authority, String name) Adds an identifier for the current band.final void
addBoundingPolygon
(org.opengis.geometry.Geometry bounds) Adds the given geometry as a bounding polygon.final void
addCitationDate
(Date date, org.opengis.metadata.citation.DateType type, MetadataBuilder.Scope scope) Adds a date of the given type.final void
addCitedResponsibleParty
(org.opengis.metadata.citation.ResponsibleParty party, org.opengis.metadata.citation.Role role) Adds role, name, contact and position information for an individual or organization that is responsible for the resource.final void
addCompleteMetadata
(URI link) Adds a URL to a more complete description of the metadata.final void
addCompression
(CharSequence value) Adds a compression name.final void
addContentType
(org.opengis.metadata.content.CoverageContentType type) Adds type of information represented in the cell.final void
addControlPoints
(org.opengis.geometry.DirectPosition geographicCoordinates, org.opengis.metadata.quality.Element accuracyReport) Adds check points (if georectified) or ground control points (if georeferenceable).final void
addCredits
(CharSequence credit) Adds recognition of those who contributed to the resource(s).final void
addDefaultMetadata
(AbstractFeatureSet resource, StoreListeners listeners) Adds default metadata for the specified resource.final void
addDefaultMetadata
(AbstractGridCoverageResource resource, StoreListeners listeners) Adds default metadata for the specified resource.final void
addDefaultMetadata
(AbstractResource resource, StoreListeners listeners) Adds default metadata for the specified resource.final void
addDistributor
(org.opengis.metadata.citation.ResponsibleParty distributor) Adds a distributor.private static void
addEarliest
(Collection<org.opengis.metadata.citation.CitationDate> dates, org.opengis.metadata.citation.CitationDate cd, org.opengis.metadata.citation.DateType type) Adds a date in the given collection, making sure that there is no two dates of the same type.final void
addEdition
(CharSequence version) Adds a version of the resource.final void
addEncoding
(Charset encoding, MetadataBuilder.Scope scope) Adds a character set used for encoding the data and/or metadata.final void
addExtent
(double[] coordinates, int index) Adds a geographic bounding box initialized to the values in the given array.final void
addExtent
(CharSequence identifier) Adds a geographic extent described by an identifier.final void
addExtent
(org.opengis.geometry.Envelope envelope) Adds the given envelope, including its CRS, to the metadata.final org.opengis.util.GenericName
addFeatureType
(DefaultFeatureType type, long occurrences) Adds descriptions for the given feature.final void
addFeatureType
(org.opengis.util.GenericName name, long occurrences) Adds descriptions for a feature of the given name.final void
addFormatName
(CharSequence value) Adds a name to the resource format.final void
addFromComponent
(org.opengis.metadata.Metadata component) Appends information from the metadata of a component.final void
addGeolocation
(org.opengis.metadata.spatial.GeolocationInformation info) Adds information about the geolocation of an image.final void
addHostComputer
(CharSequence platform) Adds information about the computer and/or operating system in use at the processing time.final void
addIdentifier
(CharSequence authority, String code, MetadataBuilder.Scope scope) Adds a resource (data) identifier, a metadata identifier, or both as they are often the same.final void
addIdentifier
(org.opengis.metadata.Identifier id, MetadataBuilder.Scope scope) Adds a data and/or metadata identifier.private static <E> void
addIfNotPresent
(Collection<E> collection, E element) Adds the given element in the given collection if not already present.final void
addInstrument
(CharSequence authority, String identifier) Adds an instrument or sensor on the platform.final void
addKeywords
(Iterable<? extends CharSequence> keywords, org.opengis.metadata.identification.KeywordType type, CharSequence thesaurusName) Adds keywords if at least one non-empty element exists in thekeywords
array.final void
addLanguage
(Locale language, MetadataBuilder.Scope scope) Adds a language used for documenting data and/or metadata.final void
addLineage
(CharSequence statement) Adds a general explanation of the data producer's knowledge about the lineage of a dataset.final void
addMaximumSampleValue
(double value) Adds a maximal value for the current sample dimension.final void
addMinimumSampleValue
(double value) Adds a minimal value for the current sample dimension.final void
addNewBand
(SampleDimension band) Sets the sequence identifier, sample value ranges, transfer function and units of measurement from the given sample dimension.final void
addOtherCitationDetails
(CharSequence details) Adds other information required to complete the citation that is not recorded elsewhere.final void
addPage
(int page, int total) Adds details on which pages of the publication the article was published.final void
addPage
(CharSequence page) Adds details on which pages of the publication the article was published.final void
addPlatform
(CharSequence authority, String identifier) Adds a platform on which instrument are installed.final void
addPointOfContact
(org.opengis.metadata.citation.ResponsibleParty contact, MetadataBuilder.Scope scope) Adds a means of communication with person(s) and organizations(s) associated with the resource(s).final void
addProcessDescription
(CharSequence description) Adds additional details about the process step.final void
addProcessing
(CharSequence authority, String identifier) Adds information about the procedure, process and algorithm applied in a process step.final void
addPurpose
(CharSequence intention) Adds a summary of the intentions with which the resource(s) was developed.final void
addReferenceSystem
(org.opengis.referencing.ReferenceSystem crs) Adds the given coordinate reference system to metadata, if it does not already exists.final void
addResolution
(double distance) Adds a linear resolution in metres.final void
addResourceScope
(org.opengis.metadata.maintenance.ScopeCode scope, CharSequence name) Adds information about the scope of the resource.void
addSampleValueDescription
(CharSequence name, CharSequence definition) Adds a description of a particular sample value.final void
addSeries
(CharSequence name) Adds the name of the series, or aggregate dataset, of which the dataset is a part.final void
addSoftwareReference
(CharSequence title) Adds a reference to document describing processing software.final void
addSource
(CharSequence description, org.opengis.metadata.maintenance.ScopeCode level, CharSequence feature) Adds information about a source of data used for producing the resource.final void
addSource
(org.opengis.metadata.Metadata source) Adds a source described by the given metadata.final void
addSource
(org.opengis.metadata.Metadata metadata, org.opengis.metadata.maintenance.ScopeCode level, CharSequence... features) Adds information about a source of data used for producing the resource.final boolean
addSpatialRepresentation
(String description, GridGeometry grid, boolean addResolution) Adds and populates a "spatial representation info" node using the given grid geometry.final void
addSpatialRepresentation
(org.opengis.metadata.spatial.SpatialRepresentationType type) Adds a method used to spatially represent geographic information.final void
Adds any other descriptive information about the resource.final void
addTemporalExtent
(Date startTime, Date endTime) Adds a temporal extent covered by the data.final void
addTitle
(CharSequence title) Adds a title or alternate title of the resource, if not already present.final void
addTitleOrIdentifier
(String code, MetadataBuilder.Scope scope) Adds the given code as a title if the current citation has no title, or as an identifier otherwise.final void
addTopicCategory
(org.opengis.metadata.identification.TopicCategory topic) Adds a main theme of the resource.final void
addUseLimitation
(CharSequence limitation) Adds a limitation affecting the fitness for use of the resource.final void
addVerticalExtent
(double minimumValue, double maximumValue, org.opengis.referencing.crs.VerticalCRS verticalCRS) Adds a vertical extent covered by the data.private static org.opengis.util.InternationalString
append
(org.opengis.util.InternationalString previous, org.opengis.util.InternationalString toAdd) Returns the concatenation of the given strings.private DefaultAttributeGroup
Creates the attribute group object if it does not already exists, then returns it.private DefaultDimension
axis
(int index) Returns the axis at the given dimension index.final DefaultMetadata
build()
Returns the metadata as a modifiable object.final DefaultMetadata
Returns the metadata as an unmodifiable object.private DefaultCitation
citation()
Creates the citation object if it does not already exists, then returns it.private DefaultLegalConstraints
Creates the constraints information object if it does not already exists, then returns it.private DefaultCoverageDescription
Creates the coverage description object if it does not already exists, then returns it.private DefaultDistribution
Creates the distribution information object if it does not already exists, then returns it.private static boolean
equals
(CharSequence s1, CharSequence s2) Returnstrue
if the given character sequences have equal content.private DefaultExtent
extent()
Creates the extent information object if it does not already exists, then returns it.Creates the feature descriptions object if it does not already exists, then returns it.private void
flush()
Writes all pending metadata objects into theDefaultMetadata
root class.private DefaultFormat
format()
Creates the distribution format object if it does not already exists, then returns it.private DefaultGridSpatialRepresentation
Creates a grid representation object if it does not already exists, then returns it.private DefaultGCPCollection
Creates the collection of ground control points if it does not already exists, then returns it.final boolean
Returnstrue
if current band has the minimum or maximum value defined.private DefaultDataIdentification
Creates the identification information object if it does not already exists, then returns it.private DefaultLineage
lineage()
Creates the lineage object if it does not already exists, then returns it.boolean
mergeMetadata
(Object source, Locale locale) Merge the given metadata into the metadata created by this builder.private DefaultMetadata
metadata()
Creates the metadata object if it does not already exists, then returns it.final void
Commits all pending information under the metadata "acquisition" node (station, sensors, etc).final void
newCoverage
(boolean electromagnetic) Commits all pending information under the metadata "content info" node (bands, etc).final void
Commits all pending information under metadata "distribution" node.final void
Commits all pending information under the metadata "feature catalog" node.final void
Commits all pending information under the metadata "spatial representation" node (dimensions, etc).final void
Commits all pending information under the metadata "identification info" node (author, bounding box, etc).final void
Commits all pending information under the metadata "lineage" node (process steps, etc).final void
Commits all pending information under the "responsible party" node (author, address, etc).final void
Commits all pending information under the coverage "attribute group" node.final void
parseLegalNotice
(String notice) Parses the legal notice.private AbstractParty
party()
Creates the individual or organization information object if it does not already exists, then returns it.private DefaultPlatform
platform()
Creates a platform object if it does not already exists, then returns it.private DefaultProcessing
Creates the processing object if it does not already exists, then returns it.private DefaultProcessStep
Creates the process step object if it does not already exists, then returns it.private DefaultResponsibleParty
Creates the responsibility object if it does not already exists, then returns it.private DefaultSampleDimension
Creates the sample dimension object if it does not already exists, then returns it.private DefaultSeries
series()
Returns the information about the series, or aggregate dataset, of which the dataset is a part.final void
setAxisName
(int dimension, org.opengis.metadata.spatial.DimensionNameType name) Sets the number of cells along the given dimension.final void
setAxisResolution
(int dimension, double resolution, javax.measure.Unit<?> unit) Sets the degree of detail in the given dimension.final void
setAxisSize
(int dimension, long length) Sets the number of cells along the given dimension.final void
setBandIdentifier
(int sequenceIdentifier) Sets the number that uniquely identifies instances of bands of wavelengths on which a sensor operates.final void
setBandIdentifier
(org.opengis.util.GenericName sequenceIdentifier) Sets the name or number that uniquely identifies instances of bands of wavelengths on which a sensor operates.final void
setBitPerSample
(int bits) Sets the maximum number of significant bits in the uncompressed representation for the value in current band.final void
setCellGeometry
(org.opengis.metadata.spatial.CellGeometry value) Sets identification of grid data as point or cell.final void
setCloudCoverPercentage
(double value) Sets the area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.final void
setFormatEdition
(CharSequence value) Sets a version number for the resource format.final void
setGeoreferencingAvailability
(boolean transformationParameterAvailability, boolean controlPointAvailability, boolean orientationParameterAvailability) Sets whether parameters for transformation, control/check point(s) or orientation parameters are available.final void
setGridToCRS
(CharSequence value) Sets a general description of the transformation from grid coordinates to "real world" coordinates.final void
setIlluminationAzimuthAngle
(double value) Sets the illumination azimuth measured in degrees clockwise from true north at the time the image is taken.final void
setIlluminationElevationAngle
(double value) Sets the illumination elevation measured in degrees clockwise from the target plane at intersection of the optical line of sight with the Earth's surface.final void
setISOStandards
(boolean part2) Sets the metadata standards to ISO 19115-1, and optionally to ISO 19115-2 too.final void
setPointInPixel
(org.opengis.metadata.spatial.PixelOrientation value) Sets the point in a pixel corresponding to the Earth location of the pixel.final void
setPredefinedFormat
(String abbreviation) Sets the file format.final void
setProcessingLevelCode
(CharSequence authority, String processingLevel) Sets an identifier for the level of processing that has been applied to the coverage.final void
setSampleUnits
(javax.measure.Unit<?> unit) Sets the units of data in the current band.final void
setTransferFunction
(double scale, double offset) Sets the scale factor and offset which have been applied to the cell value.protected final Double
shared
(double value) Returns a shared instance of the given value.protected final Integer
shared
(int value) Returns a shared instance of the given value.private <T> T
Returns a shared instance of the given object if it already exists.private org.opengis.metadata.citation.Citation
sharedCitation
(org.opengis.util.InternationalString title) Creates or fetches a citation for the given title.private org.opengis.metadata.Identifier
sharedIdentifier
(CharSequence authority, String code) Creates or fetches an identifier for the given authority and code.private static org.opengis.util.InternationalString
trim
(CharSequence value) Returns the given character sequence as a non-empty character string with leading and trailing spaces removed.
-
Field Details
-
partyType
Whether the next party to create should be an instance ofDefaultIndividual
orDefaultOrganisation
.- See Also:
-
gridType
Whether the next grid should be an instance ofDefaultGeorectified
orDefaultGeoreferenceable
.- See Also:
-
electromagnetic
private boolean electromagnetictrue
if the nextCoverageDescription
to create will be a description of measurements in the electromagnetic spectrum. In that case, the coverage description will actually be an instance ofImageDescription
.- See Also:
-
standardISO
private byte standardISOWhether to add ISO 19115-1 and ISO 19115-2 entries in "metadata standards" node. Those entries will be added only if the metadata object would be otherwise non-empty. A value of 1 will add ISO 19115-1. A value of 2 will add both ISO 19115-1 and ISO 19115-2.- See Also:
-
metadata
The metadata created by this builder, ornull
if not yet created. -
identification
The identification information that are part of metadata, ornull
if none. -
citation
The citation of data identification, ornull
if none. -
responsibility
Part of the responsible party of the citation, ornull
if none. -
party
Part of the responsible party of the citation, ornull
if none. -
constraints
Copyright information, ornull
if none. -
extent
The extent information that are part of identification, ornull
if none. -
acquisition
Information about the platforms and sensors that collected the data, ornull
if none. -
platform
Platform where are installed the sensors that collected the data, ornull
if none. -
featureDescription
Information about the feature types, ornull
if none. -
coverageDescription
Information about the content of a grid data cell, ornull
if none. May also be an instance ofDefaultImageDescription
ifelectromagnetic
istrue
. -
attributeGroup
Information about content type for groups of attributes for a specific range dimension, ornull
if none. -
sampleDimension
The characteristic of each dimension (layer) included in the resource, ornull
if none. -
gridRepresentation
Information about the grid shape, ornull
if none. -
groundControlPoints
Collection of ground control points. -
distribution
Information about the distributor of and options for obtaining the resource. -
format
private org.opengis.metadata.distribution.Format formatThe distribution format, ornull
if none. This is part of the resource identification. -
lineage
Information about the events or source data used in constructing the data specified by the scope. -
processStep
Information about an event or transformation in the life of a resource. This is part oflineage
. -
processing
Information about the procedures, processes and algorithms applied in the process step. This is part ofprocessStep
.
-
-
Constructor Details
-
MetadataBuilder
public MetadataBuilder()Creates a new metadata builder.
-
-
Method Details
-
metadata
Creates the metadata object if it does not already exists, then returns it.- Returns:
- the metadata (never
null
). - See Also:
-
identification
Creates the identification information object if it does not already exists, then returns it.- Returns:
- the identification information (never
null
). - See Also:
-
citation
Creates the citation object if it does not already exists, then returns it.- Returns:
- the citation information (never
null
).
-
series
Returns the information about the series, or aggregate dataset, of which the dataset is a part. -
responsibility
Creates the responsibility object if it does not already exists, then returns it.- Returns:
- the responsibility party (never
null
).
-
party
Creates the individual or organization information object if it does not already exists, then returns it.Limitations
If the party type is unknown, then this method creates anAbstractParty
instead of one of the subtypes. This is not valid, but we currently have no way to guess if a party is an individual or an organization. For now we prefer to let users know that the type is unknown rather than to pick a potentially wrong type.- Returns:
- the individual or organization information (never
null
). - See Also:
-
constraints
Creates the constraints information object if it does not already exists, then returns it.- Returns:
- the constraints information (never
null
).
-
extent
Creates the extent information object if it does not already exists, then returns it.- Returns:
- the extent information (never
null
).
-
acquisition
Creates the acquisition information object if it does not already exists, then returns it.- Returns:
- the acquisition information (never
null
). - See Also:
-
platform
Creates a platform object if it does not already exists, then returns it.- Returns:
- the platform information (never
null
).
-
featureDescription
Creates the feature descriptions object if it does not already exists, then returns it. This method sets theincludedWithDataset
property totrue
because the metadata built by this helper class are typically encoded together with the data.- Returns:
- the feature descriptions (never
null
). - See Also:
-
coverageDescription
Creates the coverage description object if it does not already exists, then returns it.- Returns:
- the coverage description (never
null
). - See Also:
-
attributeGroup
Creates the attribute group object if it does not already exists, then returns it.- Returns:
- the attribute group (never
null
).
-
sampleDimension
Creates the sample dimension object if it does not already exists, then returns it.- Returns:
- the sample dimension (never
null
). - See Also:
-
gridRepresentation
Creates a grid representation object if it does not already exists, then returns it.- Returns:
- the grid representation object (never
null
). - See Also:
-
groundControlPoints
Creates the collection of ground control points if it does not already exists, then returns it.- Returns:
- the ground control points (never
null
).
-
distribution
Creates the distribution information object if it does not already exists, then returns it.- Returns:
- the distribution information (never
null
). - See Also:
-
format
Creates the distribution format object if it does not already exists, then returns it.- Returns:
- the distribution format (never
null
).
-
lineage
Creates the lineage object if it does not already exists, then returns it.- Returns:
- the lineage (never
null
). - See Also:
-
processStep
Creates the process step object if it does not already exists, then returns it.- Returns:
- the process step (never
null
).
-
processing
Creates the processing object if it does not already exists, then returns it.- Returns:
- the processing (never
null
).
-
addIfNotPresent
Adds the given element in the given collection if not already present. This method is used only for properties that are usually stored inList
rather thanSet
and for which we do not keep a reference in thisMetadataBuilder
after the element has been added. This method is intended for adding elements that despite being modifiable, are not going to be modified by thisMetadataBuilder
class. Performance should not be a concern since the given list is usually very short (0 or 1 element).The given element should be non-null. The check for null value should be done by the caller instead than by this method in order to avoid unneeded creation of collections. Such creation are implicitly done by calls to
metadata.getFoos()
methods. -
newParty
Commits all pending information under the "responsible party" node (author, address, etc). If there is no pending party information, then invoking this method has no effect except setting thetype
flag. If new party information are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "responsible party" node, separated from the previous one, is desired.
- Parameters:
type
- whether the party to create is an individual or an organization.
-
newIdentification
public final void newIdentification()Commits all pending information under the metadata "identification info" node (author, bounding box, etc). If there is no pending identification information, then invoking this method has no effect. If new identification info are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "identification info" node, separated from the previous one, is desired.
-
newAcquisition
public final void newAcquisition()Commits all pending information under the metadata "acquisition" node (station, sensors, etc). If there is no pending acquisition information, then invoking this method has no effect. If new acquisition info are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "acquisition info" node, separated from the previous one, is desired.
-
newDistribution
public final void newDistribution()Commits all pending information under metadata "distribution" node. If there is no pending distribution information, then invoking this method has no effect. If new distribution info are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "distribution info" node, separated from the previous one, is desired.
-
newFeatureTypes
public final void newFeatureTypes()Commits all pending information under the metadata "feature catalog" node. If there is no pending feature description, then invoking this method has no effect. If new feature descriptions are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "feature catalog description" node is desired.
-
newCoverage
public final void newCoverage(boolean electromagnetic) Commits all pending information under the metadata "content info" node (bands, etc). If there is no pending coverage description, then invoking this method has no effect except setting theelectromagnetic
flag. If new coverage descriptions are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "coverage description" node is desired, or the
electromagnetic
flag needs to be set totrue
.- Parameters:
electromagnetic
-true
if the nextCoverageDescription
to create will be a description of measurements in the electromagnetic spectrum.
-
newSampleDimension
public final void newSampleDimension()Commits all pending information under the coverage "attribute group" node. If there is no pending sample dimension description, then invoking this method has no effect. If new sample dimensions are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "sample dimension" node is desired.
-
newGridRepresentation
Commits all pending information under the metadata "spatial representation" node (dimensions, etc). If there is no pending spatial representation information, then invoking this method has no effect. If new spatial representation info are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "spatial representation info" node, separated from the previous one, is desired.
- Parameters:
type
- whether the next grid should be an instance ofDefaultGeorectified
orDefaultGeoreferenceable
.
-
newLineage
public final void newLineage()Commits all pending information under the metadata "lineage" node (process steps, etc). If there is no pending lineage information, then invoking this method has no effect. If new lineage information are added after this method call, they will be stored in a new element.This method does not need to be invoked unless a new "lineage" node, separated from the previous one, is desired.
-
addDefaultMetadata
public final void addDefaultMetadata(AbstractResource resource, StoreListeners listeners) throws DataStoreException Adds default metadata for the specified resource. This is used for default implementation ofAbstractResource.createMetadata()
.- Parameters:
resource
- the resource for which to add metadata.listeners
- the listeners to notify in case of warning.- Throws:
DataStoreException
- if an error occurred while reading metadata from the data store.
-
addDefaultMetadata
public final void addDefaultMetadata(AbstractFeatureSet resource, StoreListeners listeners) throws DataStoreException Adds default metadata for the specified resource. This is used for default implementation ofAbstractFeatureSet.createMetadata()
.- Parameters:
resource
- the resource for which to add metadata.listeners
- the listeners to notify in case of warning.- Throws:
DataStoreException
- if an error occurred while reading metadata from the data store.
-
addDefaultMetadata
public final void addDefaultMetadata(AbstractGridCoverageResource resource, StoreListeners listeners) throws DataStoreException Adds default metadata for the specified resource. This is used for default implementation ofAbstractGridCoverageResource.createMetadata()
.- Parameters:
resource
- the resource for which to add metadata.listeners
- the listeners to notify in case of warning.- Throws:
DataStoreException
- if an error occurred while reading metadata from the data store.
-
addIdentifier
Adds a data and/or metadata identifier. This method performs the same work thanaddIdentifier(CharSequence, String, Scope)
for situations where the identifier instance is already available.- Parameters:
id
- the identifier, ornull
if none.scope
- whether the date applies to data, to metadata or to both.- See Also:
-
addIdentifier
Adds a resource (data) identifier, a metadata identifier, or both as they are often the same. The identifier is added only ifcode
is non-null, regardless other argument values. Empty strings (ignoring spaces) are considered as null. The identifier is not added if already presents. Storage locations are:- Metadata:
metadata/metadataIdentifier
- Resource:
metadata/identificationInfo/citation/identifier
- Parameters:
authority
- the the person or party responsible for maintenance of the namespace, ornull
if none.code
- the identifier code, ornull
for no-operation.scope
- whether the date applies to data, to metadata or to both.- See Also:
- Metadata:
-
setPredefinedFormat
Sets the file format. The given name should be a short name like "GeoTIFF". The long name will be inferred from the given short name, if possible. Storage location is:metadata/identificationInfo/resourceFormat
identificationInfo/resourceFormat
node. If this exception throws an exception, than that exception should be reported as a warning. Example:- Parameters:
abbreviation
- the format short name or abbreviation, ornull
for no-operation.- Throws:
MetadataStoreException
- if this method cannot connect to thejdbc/SpatialMetadata
database. Callers should generally handle this exception as a recoverable one (i.e. log a warning and continue).- See Also:
-
addLanguage
Adds a language used for documenting data and/or metadata. Storage locations are:- Metadata:
metadata/language
- Resource:
metadata/identificationInfo/language
- Parameters:
language
- a language used for documenting data and/or metadata, ornull
for no-operation.scope
- whether the language applies to data, to metadata or to both.- See Also:
- Metadata:
-
addEncoding
Adds a character set used for encoding the data and/or metadata. Storage locations are:- Metadata:
metadata/characterSet
- Resource:
metadata/identificationInfo/characterSet
- Parameters:
encoding
- the character set used for encoding data and/or metadata, ornull
for no-operation.scope
- whether the encoding applies to data, to metadata or to both.- See Also:
- Metadata:
-
addResourceScope
public final void addResourceScope(org.opengis.metadata.maintenance.ScopeCode scope, CharSequence name) Adds information about the scope of the resource. The scope is typically (but not restricted to)invalid reference
ScopeCode#COVERAGE
ScopeCode.FEATURE
or the more genericScopeCode.DATASET
. Storage locations are:metadata/metadataScope/resourceScope
metadata/metadataScope/name
- Parameters:
scope
- the scope of the resource, ornull
if none.name
- description of the scope, ornull
if none.
-
addCitationDate
public final void addCitationDate(Date date, org.opengis.metadata.citation.DateType type, MetadataBuilder.Scope scope) Adds a date of the given type. This is not the data acquisition time, but rather the metadata creation or last update time. WithMetadataBuilder.Scope.METADATA
, this is the creation of the metadata file as a whole. WithMetadataBuilder.Scope.RESOURCE
, this is the creation of the metadata for a particular "identification info". They are often the same, since there is typically only one "identification info" per file. Storage locations are:- Metadata:
metadata/dateInfo/*
- Resource:
metadata/identificationInfo/citation/date/*
DateType.LAST_REVISION
,DateType.LAST_UPDATE LAST_UPDATE
or any other date type prefixed by"LATE_"
, where only the latest date is kept.- Parameters:
date
- the date to add, ornull
for no-operation..type
- the type of the date to add, ornull
if none (not legal but tolerated).scope
- whether the date applies to data, to metadata or to both.- See Also:
- Metadata:
-
addEarliest
private static void addEarliest(Collection<org.opengis.metadata.citation.CitationDate> dates, org.opengis.metadata.citation.CitationDate cd, org.opengis.metadata.citation.DateType type) Adds a date in the given collection, making sure that there is no two dates of the same type. If two dates are of the same type, retains the latest one if the type name starts with"LATE_"
or retains the earliest date otherwise. -
trim
Returns the given character sequence as a non-empty character string with leading and trailing spaces removed. If the given character sequence is null, empty or blank, then this method returnsnull
. -
append
private static org.opengis.util.InternationalString append(org.opengis.util.InternationalString previous, org.opengis.util.InternationalString toAdd) Returns the concatenation of the given strings. The previous string may benull
. This method does nothing if the previous string already contains the one to append. -
equals
Returnstrue
if the given character sequences have equal content. -
addTitle
Adds a title or alternate title of the resource, if not already present. This operation does nothing if the title is already defined and the given title is already used as an identifier (this policy is a complement of theaddTitleOrIdentifier(String, Scope)
behavior). Storage locations are:metadata/identificationInfo/citation/title
if not yet usedmetadata/identificationInfo/citation/alternateTitle
otherwise
- Parameters:
title
- the resource title or alternate title, ornull
for no-operation.- See Also:
-
addTitleOrIdentifier
Adds the given code as a title if the current citation has no title, or as an identifier otherwise. This method is invoked when adding an identifier to a metadata that may have no title. Because the title is mandatory, adding only an identifier would make an invalid metadata.- Parameters:
code
- the identifier code, ornull
for no-operation.scope
- whether the date applies to data, to metadata or to both.- See Also:
-
addEdition
Adds a version of the resource. If a version already exists, the new one will be appended after a new line. Storage location is:metadata/identificationInfo/citation/edition
- Parameters:
version
- the version of resource(s), ornull
for no-operation.
-
addSeries
Adds the name of the series, or aggregate dataset, of which the dataset is a part. Storage location is:metadata/identificationInfo/citation/series/name
- Parameters:
name
- name of the series, ornull
for no-operation.
-
addPage
Adds details on which pages of the publication the article was published. Storage location is:metadata/identificationInfo/citation/series/page
- Parameters:
page
- the page, ornull
for no-operation.
-
addPage
public final void addPage(int page, int total) Adds details on which pages of the publication the article was published. Storage location is:metadata/identificationInfo/citation/series/page
- Parameters:
page
- the page number, or 0 or negative for no-operation.total
- the total number of pages, or 0 or negative if unknown.
-
addAbstract
Adds a brief narrative summary of the resource(s). If a summary already exists, the new one will be appended after a new line. Storage location is:metadata/identificationInfo/abstract
- Parameters:
description
- the summary of resource(s), ornull
for no-operation.- See Also:
-
addPurpose
Adds a summary of the intentions with which the resource(s) was developed. If a purpose already exists, the new one will be appended after a new line. Storage location is:metadata/identificationInfo/purpose
- Parameters:
intention
- the summary of intention(s), ornull
for no-operation.- See Also:
-
addOtherCitationDetails
Adds other information required to complete the citation that is not recorded elsewhere. Storage location is:metadata/identificationInfo/citation/otherCitationDetails
- Parameters:
details
- other details, ornull
for no-operation.
-
addSupplementalInformation
Adds any other descriptive information about the resource. If information already exists, the new one will be appended after a new line. Storage location is:metadata/identificationInfo/supplementalInformation
- Parameters:
info
- any other descriptive information about the resource, ornull
for no-operation.
-
addTopicCategory
public final void addTopicCategory(org.opengis.metadata.identification.TopicCategory topic) Adds a main theme of the resource. Storage location is:metadata/identificationInfo/topicCategory
- Parameters:
topic
- main theme of the resource, ornull
for no-operation.
-
addKeywords
public final void addKeywords(Iterable<? extends CharSequence> keywords, org.opengis.metadata.identification.KeywordType type, CharSequence thesaurusName) Adds keywords if at least one non-empty element exists in thekeywords
array. Other arguments have no impact on whether keywords are added or not because only theMD_Keywords.keyword
property is mandatory. Storage locations are:metadata/identificationInfo/descriptiveKeywords
metadata/identificationInfo/thesaurusName/title
metadata/identificationInfo/type
- Parameters:
keywords
- word(s) used to describe the subject, ornull
for no-operation.type
- subject matter used to group similar keywords, ornull
if none.thesaurusName
- name of the formally registered thesaurus, ornull
if none.
-
addAuthor
Adds an author name. If an author was already defined with a different name, then a new party instance is created. Storage location is:metadata/identificationInfo/citation/party/name
- Parameters:
name
- the name of the author or publisher, ornull
for no-operation.
-
addCitedResponsibleParty
public final void addCitedResponsibleParty(org.opengis.metadata.citation.ResponsibleParty party, org.opengis.metadata.citation.Role role) Adds role, name, contact and position information for an individual or organization that is responsible for the resource. This method can be used as an alternative toaddAuthor(CharSequence)
when the caller needs to create the responsibly party itself.If the given
Storage locations are:role
is non-null, then this method will ensure that the added party has the given role. A copy of the given party will be created if needed (the given party will never be modified).metadata/identificationInfo/citation/citedResponsibleParty
metadata/identificationInfo/citation/citedResponsibleParty/role
- Parameters:
party
- the individual or organization that is responsible, ornull
for no-operation.role
- the role to set, ornull
for leaving it unchanged.
-
addPointOfContact
public final void addPointOfContact(org.opengis.metadata.citation.ResponsibleParty contact, MetadataBuilder.Scope scope) Adds a means of communication with person(s) and organizations(s) associated with the resource(s). This is often the same party than the above cited responsibly party, with only the role changed. Storage locations are:- Metadata
metadata/contact
- Resource
metadata/identificationInfo/pointOfContact
- Parameters:
contact
- means of communication with party associated with the resource, ornull
for no-operation.scope
- whether the contact applies to data, to metadata or to both.
- Metadata
-
addDistributor
public final void addDistributor(org.opengis.metadata.citation.ResponsibleParty distributor) Adds a distributor. This is often the same than the above responsible party. Storage location is:metadata/distributionInfo/distributor/distributorContact
- Parameters:
distributor
- the distributor, ornull
for no-operation.
-
addCredits
Adds recognition of those who contributed to the resource(s). Storage location is:metadata/identificationInfo/credit
- Parameters:
credit
- recognition of those who contributed to the resource, ornull
for no-operation.
-
parseLegalNotice
Parses the legal notice. The method expects a string of the form “Copyright, John Smith, 1992. All rights reserved.” The result of above example will be: Storage location is:metadata/identificationInfo/resourceConstraint
- Parameters:
notice
- the legal notice, ornull
for no-operation.
-
addAccessConstraint
public final void addAccessConstraint(org.opengis.metadata.constraint.Restriction restriction) Adds an access constraint applied to assure the protection of privacy or intellectual property, and any special restrictions or limitations on obtaining the resource. Storage location is:metadata/identificationInfo/resourceConstraint/accessConstraints
- Parameters:
restriction
- access constraints applied, ornull
for no-operation.
-
addUseLimitation
Adds a limitation affecting the fitness for use of the resource. Storage location is:metadata/identificationInfo/resourceConstraint/useLimitation
- Parameters:
limitation
- limitation affecting the fitness for use, ornull
for no-operation.
-
addReferenceSystem
public final void addReferenceSystem(org.opengis.referencing.ReferenceSystem crs) Adds the given coordinate reference system to metadata, if it does not already exists. This method ensures that there is no duplicated values. Storage location is:metadata/referenceSystemInfo
- Parameters:
crs
- the coordinate reference system to add to the metadata, ornull
for no-operation.
-
addBoundingPolygon
public final void addBoundingPolygon(org.opengis.geometry.Geometry bounds) Adds the given geometry as a bounding polygon. Storage locations is:metadata/identificationInfo/extent/geographicElement/polygon
- Parameters:
bounds
- the bounding polygon, ornull
if none.
-
addExtent
Adds a geographic extent described by an identifier. The given identifier is stored as-is as the natural language description, and possibly in a modified form as the geographic identifier. SeeDefaultGeographicDescription(CharSequence)
for details. Storage locations are:metadata/identificationInfo/extent/geographicElement/description
metadata/identificationInfo/extent/geographicElement/identifier
- Parameters:
identifier
- identifier or description of spatial and temporal extent, ornull
for no-operation.
-
addExtent
public final void addExtent(org.opengis.geometry.Envelope envelope) throws org.opengis.referencing.operation.TransformException Adds the given envelope, including its CRS, to the metadata. If the metadata already contains a geographic bounding box, then a new bounding box is added; this method does not compute the union of the two boxes. Storage location is:metadata/identificationInfo/extent/geographicElement
- Parameters:
envelope
- the extent to add in the metadata, ornull
for no-operation.- Throws:
org.opengis.referencing.operation.TransformException
- if an error occurred while converting the given envelope to extents.
-
addExtent
public final void addExtent(double[] coordinates, int index) Adds a geographic bounding box initialized to the values in the given array. The array must contains at least 4 values starting at the given index in this exact order:westBoundLongitude
(the minimal λ value), orNaN
eastBoundLongitude
(the maximal λ value), orNaN
southBoundLatitude
(the minimal φ value), orNaN
northBoundLatitude
(the maximal φ value), orNaN
metadata/identificationInfo/extent/geographicElement
- Parameters:
coordinates
- the geographic coordinates, ornull
for no-operation.index
- index of the first value to use in the given array.
-
addVerticalExtent
public final void addVerticalExtent(double minimumValue, double maximumValue, org.opengis.referencing.crs.VerticalCRS verticalCRS) Adds a vertical extent covered by the data. Storage location is:metadata/identificationInfo/extent/verticalElement
- Parameters:
minimumValue
- the lowest vertical extent contained in the dataset, orDouble.NaN
if none.maximumValue
- the highest vertical extent contained in the dataset, orDouble.NaN
if none.verticalCRS
- the information about the vertical coordinate reference system, ornull
.
-
addTemporalExtent
Adds a temporal extent covered by the data. Storage location is:metadata/identificationInfo/extent/temporalElement
- Parameters:
startTime
- when the data begins, ornull
if unbounded.endTime
- when the data ends, ornull
if unbounded.- See Also:
-
addFeatureType
Adds descriptions for the given feature. Storage locations are:metadata/contentInfo/featureTypes/featureTypeName
metadata/contentInfo/featureTypes/featureInstanceCount
FeatureNaming.add(…)
. Note that theFeatureCatalogBuilder
subclasses can also be used for that chaining.- Parameters:
type
- the feature type to add, ornull
for no-operation.occurrences
- number of instances of the given feature type, or a negative value if unknown. Note that ISO-19115 considers 0 as an invalid value. Consequently, if 0, the feature is not added.- Returns:
- the name of the added feature (even if not added to the metadata), or
null
if none. - See Also:
-
addFeatureType
public final void addFeatureType(org.opengis.util.GenericName name, long occurrences) Adds descriptions for a feature of the given name. Storage locations are:metadata/contentInfo/featureTypes/featureTypeName
metadata/contentInfo/featureTypes/featureInstanceCount
- Parameters:
name
- name of the feature type to add, ornull
for no-operation.occurrences
- number of instances of the given feature type, or a negative value if unknown. Note that ISO-19115 considers 0 as an invalid value. Consequently, if 0, the feature is not added.
-
addSpatialRepresentation
public final void addSpatialRepresentation(org.opengis.metadata.spatial.SpatialRepresentationType type) Adds a method used to spatially represent geographic information. Storage location is:metadata/identificationInfo/spatialRepresentationType
- Parameters:
type
- method used to spatially represent geographic information, ornull
for no-operation.
-
addSpatialRepresentation
public final boolean addSpatialRepresentation(String description, GridGeometry grid, boolean addResolution) Adds and populates a "spatial representation info" node using the given grid geometry. This method invokes implicitlynewGridRepresentation(GridType)
, unless this method returnsfalse
in which case nothing has been done. Storage locations are:metadata/spatialRepresentationInfo/transformationDimensionDescription
metadata/spatialRepresentationInfo/transformationParameterAvailability
metadata/spatialRepresentationInfo/axisDimensionProperties/dimensionName
metadata/spatialRepresentationInfo/axisDimensionProperties/dimensionSize
metadata/spatialRepresentationInfo/axisDimensionProperties/resolution
metadata/identificationInfo/spatialRepresentationType
metadata/referenceSystemInfo
GridGeometry.getEnvelope()
. That envelope appears in a separated node, which can be added byaddExtent(Envelope)
. This separation is required byAbstractGridCoverageResource
for instance.- Parameters:
description
- a general description of the "grid to CRS" transformation, ornull
if none. Can also be specified later by a call tosetGridToCRS(CharSequence)
.grid
- the grid extent, "grid to CRS" transform and target CRS, ornull
if none.addResolution
- whether to declare the resolutions. Callers should set this argument tofalse
if they intend to provide the resolution themselves, or if grid axes are not in the same order than CRS axes.- Returns:
- whether a "spatial representation info" node has been added.
-
addResolution
public final void addResolution(double distance) Adds a linear resolution in metres. Storage location is:metadata/identificationInfo/spatialResolution/distance
- Parameters:
distance
- the resolution in metres, orNaN
for no-operation.
-
setCellGeometry
public final void setCellGeometry(org.opengis.metadata.spatial.CellGeometry value) Sets identification of grid data as point or cell. Storage location is:metadata/spatialRepresentationInfo/cellGeometry
- Parameters:
value
- whether the data represent point or area, ornull
for no-operation.
-
setPointInPixel
public final void setPointInPixel(org.opengis.metadata.spatial.PixelOrientation value) Sets the point in a pixel corresponding to the Earth location of the pixel. Storage location is:metadata/spatialRepresentationInfo/pointInPixel
- Parameters:
value
- whether the data represent point or area, ornull
for no-operation.
-
setGeoreferencingAvailability
public final void setGeoreferencingAvailability(boolean transformationParameterAvailability, boolean controlPointAvailability, boolean orientationParameterAvailability) Sets whether parameters for transformation, control/check point(s) or orientation parameters are available. Storage locations are:- If georeferenceable:
metadata/spatialRepresentationInfo/transformationParameterAvailability
metadata/spatialRepresentationInfo/controlPointAvailability
metadata/spatialRepresentationInfo/orientationParameterAvailability
- If georeferenced:
metadata/spatialRepresentationInfo/transformationParameterAvailability
metadata/spatialRepresentationInfo/checkPointAvailability
- Parameters:
transformationParameterAvailability
- indication of whether or not parameters for transformation exists.controlPointAvailability
- indication of whether or not control or check point(s) exists.orientationParameterAvailability
- indication of whether or not orientation parameters are available.
- If georeferenceable:
-
addGeolocation
public final void addGeolocation(org.opengis.metadata.spatial.GeolocationInformation info) Adds information about the geolocation of an image. Storage location is:metadata/spatialRepresentationInfo/geolocationInformation
- Parameters:
info
- the geolocation information to add, ornull
if none.
-
addControlPoints
public final void addControlPoints(org.opengis.geometry.DirectPosition geographicCoordinates, org.opengis.metadata.quality.Element accuracyReport) Adds check points (if georectified) or ground control points (if georeferenceable). Ground control points (GCP) are large marked targets on the ground. GCP should not be used for storing the localization grid (e.g. "model tie points" in a GeoTIFF file). Storage locations are:metadata/spatialRepresentationInfo/checkPoint/geographicCoordinates
if georectifiedmetadata/spatialRepresentationInfo/geolocationInformation/gcp/geographicCoordinates
if georeferenceable
- Parameters:
geographicCoordinates
- the geographic or map position of the control point, in either two or three dimensions.accuracyReport
- the accuracy of a ground control point, ornull
if none. Ignored ifgeographicCoordinates
is null.
-
setGridToCRS
Sets a general description of the transformation from grid coordinates to "real world" coordinates. Storage location is:metadata/spatialRepresentationInfo/transformationDimensionDescription
- Parameters:
value
- a general description of the "grid to CRS" transformation, ornull
for no-operation.
-
axis
Returns the axis at the given dimension index. All previous dimensions are created if needed.- Parameters:
index
- index of the desired dimension.- Returns:
- dimension at the given index.
-
setAxisName
public final void setAxisName(int dimension, org.opengis.metadata.spatial.DimensionNameType name) Sets the number of cells along the given dimension. Storage location is:metadata/spatialRepresentationInfo/axisDimensionProperties/dimensionName
- Parameters:
dimension
- the axis dimension.name
- the name to set for the given dimension.
-
setAxisSize
public final void setAxisSize(int dimension, long length) Sets the number of cells along the given dimension. Storage location is:metadata/spatialRepresentationInfo/axisDimensionProperties/dimensionSize
- Parameters:
dimension
- the axis dimension.length
- number of cell values along the given dimension.
-
setAxisResolution
public final void setAxisResolution(int dimension, double resolution, javax.measure.Unit<?> unit) Sets the degree of detail in the given dimension. This method does nothing if the given resolution if NaN or infinite. Storage location is:metadata/spatialRepresentationInfo/axisDimensionProperties/resolution
- Parameters:
dimension
- the axis dimension.resolution
- the degree of detail in the grid dataset, or NaN for no-operation.unit
- the resolution unit, ofnull
if unknown.
-
addContentType
public final void addContentType(org.opengis.metadata.content.CoverageContentType type) Adds type of information represented in the cell. Storage location is:metadata/contentInfo/attributeGroup/contentType
- Parameters:
type
- type of information represented in the cell, ornull
for no-operation.
-
addNewBand
Sets the sequence identifier, sample value ranges, transfer function and units of measurement from the given sample dimension. This method dispatch its work to other methods in this class. Before to set any value, this method starts a new band by callingnewSampleDimension()
. Storage locations are:metadata/contentInfo/attributeGroup/attribute/sequenceIdentifier
metadata/contentInfo/attributeGroup/attribute/minValue
metadata/contentInfo/attributeGroup/attribute/maxValue
metadata/contentInfo/attributeGroup/attribute/scale
metadata/contentInfo/attributeGroup/attribute/offset
metadata/contentInfo/attributeGroup/attribute/transferFunctionType
metadata/contentInfo/attributeGroup/attribute/unit
- Parameters:
band
- the sample dimension to describe in metadata, ornull
if none.
-
setBandIdentifier
public final void setBandIdentifier(org.opengis.util.GenericName sequenceIdentifier) Sets the name or number that uniquely identifies instances of bands of wavelengths on which a sensor operates. If a coverage contains more than one band, additional bands can be created by callingnewSampleDimension()
before to call this method. Storage location is:metadata/contentInfo/attributeGroup/attribute/sequenceIdentifier
- Parameters:
sequenceIdentifier
- the band name or number, ornull
for no-operation.
-
setBandIdentifier
public final void setBandIdentifier(int sequenceIdentifier) Sets the number that uniquely identifies instances of bands of wavelengths on which a sensor operates. This is a convenience method forsetBandIdentifier(MemberName)
when the band is specified only by a number. Storage location is:metadata/contentInfo/attributeGroup/attribute/sequenceIdentifier
- Parameters:
sequenceIdentifier
- the band number, or 0 or negative if none.
-
addBandName
Adds an identifier for the current band. These identifiers can be used to provide names for the attribute from a standard set of names. If a coverage contains more than one band, additional bands can be created by callingnewSampleDimension()
before to call this method. Storage location is:metadata/contentInfo/attributeGroup/attribute/name
- Parameters:
authority
- identifies which controlled list of name is used, ornull
if none.name
- the band name, ornull
for no-operation.
-
addBandDescription
Adds a description of the current band. If a coverage contains more than one band, additional bands can be created by callingnewSampleDimension()
before to call this method. Storage location is:metadata/contentInfo/attributeGroup/attribute/description
- Parameters:
description
- the band description, ornull
for no-operation.
-
addSampleValueDescription
Adds a description of a particular sample value. Storage location is:metadata/contentInfo/rangeElementDescription
Note: ISO 19115 range elements are approximately equivalent toorg.apache.sis.coverage.Category
in thesis-coverage
module.- Parameters:
name
- designation associated with a set of range elements, ornull
if none.definition
- description of a set of specific range elements, ornull
if none.
-
addMinimumSampleValue
public final void addMinimumSampleValue(double value) Adds a minimal value for the current sample dimension. The value should be in the unit of measurement specified bysetSampleUnits(Unit)
. If a minimal value was already defined, then the new value will be set only if it is smaller than the existing one.NaN
values are ignored. Storage location is:metadata/contentInfo/attributeGroup/attribute/minValue
newSampleDimension()
before to call this method.- Parameters:
value
- the minimal value to add to the existing range of sample values, orNaN
for no-operation.
-
addMaximumSampleValue
public final void addMaximumSampleValue(double value) Adds a maximal value for the current sample dimension. The value should be in the unit of measurement specified bysetSampleUnits(Unit)
. If a maximal value was already defined, then the new value will be set only if it is greater than the existing one.NaN
values are ignored. Storage location is:metadata/contentInfo/attributeGroup/attribute/maxValue
newSampleDimension()
before to call this method.- Parameters:
value
- the maximal value to add to the existing range of sample values, orNaN
for no-operation.
-
hasSampleValueRange
public final boolean hasSampleValueRange()Returnstrue
if current band has the minimum or maximum value defined.- Returns:
- whether minimum or maximum value is defined for current band.
-
setSampleUnits
public final void setSampleUnits(javax.measure.Unit<?> unit) Sets the units of data in the current band. Storage location is:metadata/contentInfo/attributeGroup/attribute/unit
newSampleDimension()
before to call this method.- Parameters:
unit
- units of measurement of sample values.
-
setTransferFunction
public final void setTransferFunction(double scale, double offset) Sets the scale factor and offset which have been applied to the cell value. The transfer function type is declared linear Storage locations are:metadata/contentInfo/attributeGroup/attribute/scale
metadata/contentInfo/attributeGroup/attribute/offset
metadata/contentInfo/attributeGroup/attribute/transferFunctionType
newSampleDimension()
before to call this method.- Parameters:
scale
- the scale factor which has been applied to the cell value.offset
- the physical value corresponding to a cell value of zero.
-
setBitPerSample
public final void setBitPerSample(int bits) Sets the maximum number of significant bits in the uncompressed representation for the value in current band. Storage location is:metadata/contentInfo/attributeGroup/attribute/bitsPerValue
- Parameters:
bits
- the new maximum number of significant bits.- Throws:
IllegalArgumentException
- if the given value is zero or negative.
-
setProcessingLevelCode
Sets an identifier for the level of processing that has been applied to the coverage. For image descriptions, this is the image distributor's code that identifies the level of radiometric and geometric processing that has been applied. Storage location is:metadata/contentInfo/processingLevelCode
metadata/identificationInfo/processingLevel
but is currently not used.- Parameters:
authority
- identifies which controlled list of code is used, ornull
if none.processingLevel
- identifier for the level of processing that has been applied to the resource, ornull
for no-operation.
-
setCloudCoverPercentage
public final void setCloudCoverPercentage(double value) Sets the area of the dataset obscured by clouds, expressed as a percentage of the spatial extent. This method does nothing if the given value isDouble.NaN
.This method is available only if
newCoverage(boolean)
has been invoked with theelectromagnetic
parameter set totrue
. Storage location is:metadata/contentInfo/cloudCoverPercentage
- Parameters:
value
- the new cloud percentage, orNaN
for no-operation.- Throws:
IllegalArgumentException
- if the given value is out of range.
-
setIlluminationAzimuthAngle
public final void setIlluminationAzimuthAngle(double value) Sets the illumination azimuth measured in degrees clockwise from true north at the time the image is taken. For images from a scanning device, refer to the centre pixel of the image. This method does nothing if the given value isDouble.NaN
.This method is available only if
newCoverage(boolean)
has been invoked with theelectromagnetic
parameter set totrue
. Storage location is:metadata/contentInfo/illuminationAzimuthAngle
- Parameters:
value
- the new illumination azimuth angle, orNaN
for no-operation.- Throws:
IllegalArgumentException
- if the given value is out of range.
-
setIlluminationElevationAngle
public final void setIlluminationElevationAngle(double value) Sets the illumination elevation measured in degrees clockwise from the target plane at intersection of the optical line of sight with the Earth's surface. For images from a canning device, refer to the centre pixel of the image. This method does nothing if the given value isDouble.NaN
.This method is available only if
newCoverage(boolean)
has been invoked with theelectromagnetic
parameter set totrue
. Storage location is:metadata/contentInfo/illuminationElevationAngle
- Parameters:
value
- the new illumination azimuth angle, orNaN
for no-operation.- Throws:
IllegalArgumentException
- if the given value is out of range.
-
addPlatform
Adds a platform on which instrument are installed. If a platform was already defined with a different identifier, then a new platform instance will be created. Storage location is:metadata/acquisitionInformation/platform/identifier
- Parameters:
authority
- identifiers the authority that define platform codes, ornull
if none.identifier
- identifier of the platform to add, ornull
for no-operation.
-
addInstrument
Adds an instrument or sensor on the platform. Storage location is:metadata/acquisitionInformation/platform/instrument/identifier
- Parameters:
authority
- identifiers the authority that define instrument codes, ornull
if none.identifier
- identifier of the sensor to add, ornull
for no-operation.
-
addAcquisitionTime
Adds an event that describe the time at which data were acquired. Storage location is:metadata/acquisitionInformation/operation/significantEvent/time
- Parameters:
time
- the acquisition time, ornull
for no-operation.- See Also:
-
addAcquisitionTime
Adds an event that describe the range of time at which data were acquired. Current implementation computes the average of given instants. Storage location is:metadata/acquisitionInformation/operation/significantEvent/time
- Parameters:
startTime
- start time, ornull
if unknown.endTime
- end time, ornull
if unknown.
-
addAcquisitionOperation
Adds the identifier of the operation used to acquire the dataset. Examples: "GHRSST", "NOAA CDR", "NASA EOS", "JPSS", "GOES-R". Storage location is:metadata/acquisitionInformation/operation/identifier
- Parameters:
program
- identification of the mission, ornull
if none.identifier
- unique identification of the operation, ornull
for no-operation.
-
addAcquisitionRequirement
Adds the identifier of the requirement to be satisfied by data acquisition. Storage location is:metadata/acquisitionInformation/acquisitionRequirement/identifier
- Parameters:
authority
- specifies the authority that define requirement codes, ornull
if none.identifier
- unique name or code for the requirement, ornull
for no-operation.
-
addLineage
Adds a general explanation of the data producer's knowledge about the lineage of a dataset. If a statement already exists, the new one will be appended after a new line. Storage location is:metadata/resourceLineage/statement
- Parameters:
statement
- explanation of the data producer's knowledge about the lineage, ornull
for no-operation.- See Also:
-
addSource
public final void addSource(org.opengis.metadata.Metadata source) Adds a source described by the given metadata. Storage locations are:metadata/resourceLineage/source/description
metadata/resourceLineage/source/citation
metadata/resourceLineage/source/scope/level
metadata/resourceLineage/source/scope/extent
metadata/resourceLineage/source/sourceReferenceSystem
metadata/resourceLineage/source/sourceSpatialResolution
- Parameters:
source
- metadata about a source of the resource for which to describe the lineage.- See Also:
-
addSource
public final void addSource(CharSequence description, org.opengis.metadata.maintenance.ScopeCode level, CharSequence feature) Adds information about a source of data used for producing the resource. Storage locations are:metadata/resourceLineage/source/description
metadata/resourceLineage/source/scope/level
metadata/resourceLineage/source/scope/levelDescription/features
Example: if a Landsat image uses the "GTOPO30" digital elevation model, then it can declare the source with "GTOPO30" description,ScopeCode.MODEL
and feature "Digital Elevation Model".- Parameters:
description
- a detailed description of the level of the source data, ornull
if none.level
- hierarchical level of the source (e.g. model), ornull
if unspecified.feature
- more detailed name forlevel
, ornull
if none.- See Also:
-
addSource
public final void addSource(org.opengis.metadata.Metadata metadata, org.opengis.metadata.maintenance.ScopeCode level, CharSequence... features) Adds information about a source of data used for producing the resource. Storage locations are:metadata/resourceLineage/source/scope/level
metadata/resourceLineage/source/scope/extent
metadata/resourceLineage/source/scope/levelDescription/*
metadata/resourceLineage/source/citation
metadata/resourceLineage/source/sourceReferenceSystem
metadata/resourceLineage/source/sourceSpatialResolution
Example: if aFeatureSet
is the aggregation of two otherFeatureSet
resources, then this method can be invoked twice with the metadata of each sourceFeatureSet
. If the aggregated data are features, thenlevel
should beScopeCode.FEATURE
.- Parameters:
metadata
- the metadata of the source, ornull
if none.level
- hierarchical level of the source (e.g. feature). Should not be null.features
- names of dataset, features or attributes used in the source.- See Also:
-
addProcessing
Adds information about the procedure, process and algorithm applied in a process step. If a processing was already defined with a different identifier, then a new processing instance will be created. Storage location is:metadata/resourceLineage/processStep/processingInformation/identifier
- Parameters:
authority
- identifies the authority that defines processing code, ornull
if none.identifier
- processing package that produced the data, ornull
for no-operation.- See Also:
-
addSoftwareReference
Adds a reference to document describing processing software. This is added to the processing identified by last call toaddProcessing(CharSequence, String)
. Storage location is:metadata/resourceLineage/processStep/processingInformation/softwareReference/title
- Parameters:
title
- title of the document that describe the software, ornull
for no-operation.- See Also:
-
addHostComputer
Adds information about the computer and/or operating system in use at the processing time. This is added to the processing identified by last call toaddProcessing(CharSequence, String)
. Storage location is:metadata/resourceLineage/processStep/processingInformation/procedureDescription
- Parameters:
platform
- name of the system on which the processing has been executed, ornull
for no-operation.- See Also:
-
addProcessDescription
Adds additional details about the process step. If a description already exists, the new one will be added on a new line. Storage location is:metadata/resourceLineage/processStep/description
- Parameters:
description
- additional details about the process step, ornull
for no-operation.- See Also:
-
addFormatName
Adds a name to the resource format. Note that this method does not add a new format, but only an alternative name to current format. Storage location is:metadata/identificationInfo/resourceFormat/formatSpecificationCitation/alternateTitle
setPredefinedFormat(String)
, thensetPredefinedFormat(…)
should be invoked before this method.- Parameters:
value
- the format name, ornull
for no-operation.- See Also:
-
setFormatEdition
Sets a version number for the resource format. Storage location is:metadata/identificationInfo/resourceFormat/formatSpecificationCitation/edition
setPredefinedFormat(String)
, thensetPredefinedFormat(…)
should be invoked before this method.- Parameters:
value
- the format edition, ornull
for no-operation.- See Also:
-
addCompression
Adds a compression name. Storage location is:metadata/identificationInfo/resourceFormat/fileDecompressionTechnique
setPredefinedFormat(String)
, thensetPredefinedFormat(…)
should be invoked before this method.- Parameters:
value
- the compression name, ornull
for no-operation.- See Also:
-
addCompleteMetadata
Adds a URL to a more complete description of the metadata. Storage location is:metadata/metadataLinkage/linkage
withfunction
set toOnLineFunction.COMPLETE_METADATA
- Parameters:
link
- URL to a more complete description of the metadata, ornull
.
-
setISOStandards
public final void setISOStandards(boolean part2) Sets the metadata standards to ISO 19115-1, and optionally to ISO 19115-2 too. Those metadata citations are added only if the metadata object is otherwise non-empty. Storage location is:metadata/metadataStandards
- Parameters:
part2
- whether to set ISO 19115-2 in addition to ISO 19115-1.
-
addFromComponent
public final void addFromComponent(org.opengis.metadata.Metadata component) Appends information from the metadata of a component. This is an helper method for building the metadata of an aggregate. Aggregate metadata should be set before to invoke this method, in particular: This method applies the following heuristic rules (may change in any future version). Those rules assume that the component metadata was built withMetadataBuilder
(this assumption determines which metadata elements are inspected).- Content information is added verbatim. There is usually one instance per component.
- Extents are added as one
Extent
per component, but without duplicated values. - All Coordinate Reference System information are added without duplicated values.
- Some citation information are merged in a single citation.
The following information are ignored because considered too specific to the component:
- titles
- identifiers
- series (includes page numbers).
- Compression are added (without duplicated value) but not the other format information (because the aggregate is assumed to have its own format name).
- Distributor names, but not the other distribution information because the aggregated resource may not be distributed in the same way then the components.
- Parameters:
component
- the component from which to append metadata.
-
mergeMetadata
Merge the given metadata into the metadata created by this builder. The given source should be an instance ofMetadata
, but some types of metadata components are accepted as well.This method should be invoked last, just before the call to
build()
. Any identification information, responsible party, extent, coverage description, etc. added after this method call will be stored in new metadata object (not merged).- Parameters:
source
- the source metadata to merge. Will never be modified.locale
- the locale to use for error message in exceptions, ornull
for the default locale.- Returns:
true
if the given source has been merged, orfalse
if its type is not managed by this builder.- Throws:
RuntimeException
- if the merge failed (may beIllegalArgumentException
,ClassCastException
,InvalidMetadataException
…)- See Also:
-
flush
private void flush()Writes all pending metadata objects into theDefaultMetadata
root class. Then allidentification
,gridRepresentation
, etc. fields exceptmetadata
are set tonull
. -
build
Returns the metadata as a modifiable object.- Returns:
- the metadata (never
null
).
-
buildAndFreeze
Returns the metadata as an unmodifiable object.- Returns:
- the metadata (never
null
).
-