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 enumThe type of grid spatial representation (georectified, georeferenceable or unspecified).private static final classElements to omit in the legal notice to be parsed byparseLegalNotice(String).static enumThe type of party to create (individual, organization or unknown).static enumSpecify if an information apply to data, to metadata or to both.private static final classAn international string where localized identifiers are formatted more like an English sentence. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate DefaultAcquisitionInformationInformation about the platforms and sensors that collected the data, ornullif none.private DefaultAttributeGroupInformation about content type for groups of attributes for a specific range dimension, ornullif none.private DefaultCitationThe citation of data identification, ornullif none.private DefaultLegalConstraintsCopyright information, ornullif none.private DefaultCoverageDescriptionInformation about the content of a grid data cell, ornullif none.private DefaultDistributionInformation about the distributor of and options for obtaining the resource.private booleantrueif the nextCoverageDescriptionto create will be a description of measurements in the electromagnetic spectrum.private DefaultExtentThe extent information that are part of identification, ornullif none.Information about the feature types, ornullif none.private org.opengis.metadata.distribution.FormatThe distribution format, ornullif none.private DefaultGridSpatialRepresentationInformation about the grid shape, ornullif none.private MetadataBuilder.GridTypeWhether the next grid should be an instance ofDefaultGeorectifiedorDefaultGeoreferenceable.private DefaultGCPCollectionCollection of ground control points.private DefaultDataIdentificationThe identification information that are part of metadata, ornullif none.private DefaultLineageInformation about the events or source data used in constructing the data specified by the scope.private DefaultMetadataThe metadata created by this builder, ornullif not yet created.private AbstractPartyPart of the responsible party of the citation, ornullif none.private MetadataBuilder.PartyTypeWhether the next party to create should be an instance ofDefaultIndividualorDefaultOrganisation.private DefaultPlatformPlatform where are installed the sensors that collected the data, ornullif none.private DefaultProcessingInformation about the procedures, processes and algorithms applied in the process step.private DefaultProcessStepInformation about an event or transformation in the life of a resource.private DefaultResponsiblePartyPart of the responsible party of the citation, ornullif none.private DefaultSampleDimensionThe characteristic of each dimension (layer) included in the resource, ornullif none.For using the same instance ofIntegerorDoublewhen the value is the same.private byteWhether to add ISO 19115-1 and ISO 19115-2 entries in "metadata standards" node. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate DefaultAcquisitionInformationCreates the acquisition information object if it does not already exists, then returns it.final voidaddAbstract(CharSequence description) Adds a brief narrative summary of the resource(s).final voidaddAccessConstraint(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 voidaddAcquisitionOperation(CharSequence program, String identifier) Adds the identifier of the operation used to acquire the dataset.final voidaddAcquisitionRequirement(CharSequence authority, String identifier) Adds the identifier of the requirement to be satisfied by data acquisition.final voidaddAcquisitionTime(Instant startTime, Instant endTime) Adds an event that describe the range of time at which data were acquired.final voidaddAcquisitionTime(Date time) Adds an event that describe the time at which data were acquired.final voidaddAuthor(CharSequence name) Adds an author name.final voidaddBandDescription(CharSequence description) Adds a description of the current band.final voidaddBandName(CharSequence authority, String name) Adds an identifier for the current band.final voidaddBoundingPolygon(org.opengis.geometry.Geometry bounds) Adds the given geometry as a bounding polygon.final voidaddCitationDate(Date date, org.opengis.metadata.citation.DateType type, MetadataBuilder.Scope scope) Adds a date of the given type.final voidaddCitedResponsibleParty(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 voidaddCompleteMetadata(URI link) Adds a URL to a more complete description of the metadata.final voidaddCompression(CharSequence value) Adds a compression name.final voidaddContentType(org.opengis.metadata.content.CoverageContentType type) Adds type of information represented in the cell.final voidaddControlPoints(org.opengis.geometry.DirectPosition geographicCoordinates, org.opengis.metadata.quality.Element accuracyReport) Adds check points (if georectified) or ground control points (if georeferenceable).final voidaddCredits(CharSequence credit) Adds recognition of those who contributed to the resource(s).final voidaddDefaultMetadata(AbstractFeatureSet resource, StoreListeners listeners) Adds default metadata for the specified resource.final voidaddDefaultMetadata(AbstractGridCoverageResource resource, StoreListeners listeners) Adds default metadata for the specified resource.final voidaddDefaultMetadata(AbstractResource resource, StoreListeners listeners) Adds default metadata for the specified resource.final voidaddDistributor(org.opengis.metadata.citation.ResponsibleParty distributor) Adds a distributor.private static voidaddEarliest(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 voidaddEdition(CharSequence version) Adds a version of the resource.final voidaddEncoding(Charset encoding, MetadataBuilder.Scope scope) Adds a character set used for encoding the data and/or metadata.final voidaddExtent(double[] coordinates, int index) Adds a geographic bounding box initialized to the values in the given array.final voidaddExtent(CharSequence identifier) Adds a geographic extent described by an identifier.final voidaddExtent(org.opengis.geometry.Envelope envelope) Adds the given envelope, including its CRS, to the metadata.final org.opengis.util.GenericNameaddFeatureType(DefaultFeatureType type, long occurrences) Adds descriptions for the given feature.final voidaddFeatureType(org.opengis.util.GenericName name, long occurrences) Adds descriptions for a feature of the given name.final voidaddFormatName(CharSequence value) Adds a name to the resource format.final voidaddFromComponent(org.opengis.metadata.Metadata component) Appends information from the metadata of a component.final voidaddGeolocation(org.opengis.metadata.spatial.GeolocationInformation info) Adds information about the geolocation of an image.final voidaddHostComputer(CharSequence platform) Adds information about the computer and/or operating system in use at the processing time.final voidaddIdentifier(CharSequence authority, String code, MetadataBuilder.Scope scope) Adds a resource (data) identifier, a metadata identifier, or both as they are often the same.final voidaddIdentifier(org.opengis.metadata.Identifier id, MetadataBuilder.Scope scope) Adds a data and/or metadata identifier.private static <E> voidaddIfNotPresent(Collection<E> collection, E element) Adds the given element in the given collection if not already present.final voidaddInstrument(CharSequence authority, String identifier) Adds an instrument or sensor on the platform.final voidaddKeywords(Iterable<? extends CharSequence> keywords, org.opengis.metadata.identification.KeywordType type, CharSequence thesaurusName) Adds keywords if at least one non-empty element exists in thekeywordsarray.final voidaddLanguage(Locale language, MetadataBuilder.Scope scope) Adds a language used for documenting data and/or metadata.final voidaddLineage(CharSequence statement) Adds a general explanation of the data producer's knowledge about the lineage of a dataset.final voidaddMaximumSampleValue(double value) Adds a maximal value for the current sample dimension.final voidaddMinimumSampleValue(double value) Adds a minimal value for the current sample dimension.final voidaddNewBand(SampleDimension band) Sets the sequence identifier, sample value ranges, transfer function and units of measurement from the given sample dimension.final voidaddOtherCitationDetails(CharSequence details) Adds other information required to complete the citation that is not recorded elsewhere.final voidaddPage(int page, int total) Adds details on which pages of the publication the article was published.final voidaddPage(CharSequence page) Adds details on which pages of the publication the article was published.final voidaddPlatform(CharSequence authority, String identifier) Adds a platform on which instrument are installed.final voidaddPointOfContact(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 voidaddProcessDescription(CharSequence description) Adds additional details about the process step.final voidaddProcessing(CharSequence authority, String identifier) Adds information about the procedure, process and algorithm applied in a process step.final voidaddPurpose(CharSequence intention) Adds a summary of the intentions with which the resource(s) was developed.final voidaddReferenceSystem(org.opengis.referencing.ReferenceSystem crs) Adds the given coordinate reference system to metadata, if it does not already exists.final voidaddResolution(double distance) Adds a linear resolution in metres.final voidaddResourceScope(org.opengis.metadata.maintenance.ScopeCode scope, CharSequence name) Adds information about the scope of the resource.voidaddSampleValueDescription(CharSequence name, CharSequence definition) Adds a description of a particular sample value.final voidaddSeries(CharSequence name) Adds the name of the series, or aggregate dataset, of which the dataset is a part.final voidaddSoftwareReference(CharSequence title) Adds a reference to document describing processing software.final voidaddSource(CharSequence description, org.opengis.metadata.maintenance.ScopeCode level, CharSequence feature) Adds information about a source of data used for producing the resource.final voidaddSource(org.opengis.metadata.Metadata source) Adds a source described by the given metadata.final voidaddSource(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 booleanaddSpatialRepresentation(String description, GridGeometry grid, boolean addResolution) Adds and populates a "spatial representation info" node using the given grid geometry.final voidaddSpatialRepresentation(org.opengis.metadata.spatial.SpatialRepresentationType type) Adds a method used to spatially represent geographic information.final voidAdds any other descriptive information about the resource.final voidaddTemporalExtent(Date startTime, Date endTime) Adds a temporal extent covered by the data.final voidaddTitle(CharSequence title) Adds a title or alternate title of the resource, if not already present.final voidaddTitleOrIdentifier(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 voidaddTopicCategory(org.opengis.metadata.identification.TopicCategory topic) Adds a main theme of the resource.final voidaddUseLimitation(CharSequence limitation) Adds a limitation affecting the fitness for use of the resource.final voidaddVerticalExtent(double minimumValue, double maximumValue, org.opengis.referencing.crs.VerticalCRS verticalCRS) Adds a vertical extent covered by the data.private static org.opengis.util.InternationalStringappend(org.opengis.util.InternationalString previous, org.opengis.util.InternationalString toAdd) Returns the concatenation of the given strings.private DefaultAttributeGroupCreates the attribute group object if it does not already exists, then returns it.private DefaultDimensionaxis(int index) Returns the axis at the given dimension index.final DefaultMetadatabuild()Returns the metadata as a modifiable object.final DefaultMetadataReturns the metadata as an unmodifiable object.private DefaultCitationcitation()Creates the citation object if it does not already exists, then returns it.private DefaultLegalConstraintsCreates the constraints information object if it does not already exists, then returns it.private DefaultCoverageDescriptionCreates the coverage description object if it does not already exists, then returns it.private DefaultDistributionCreates the distribution information object if it does not already exists, then returns it.private static booleanequals(CharSequence s1, CharSequence s2) Returnstrueif the given character sequences have equal content.private DefaultExtentextent()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 voidflush()Writes all pending metadata objects into theDefaultMetadataroot class.private DefaultFormatformat()Creates the distribution format object if it does not already exists, then returns it.private DefaultGridSpatialRepresentationCreates a grid representation object if it does not already exists, then returns it.private DefaultGCPCollectionCreates the collection of ground control points if it does not already exists, then returns it.final booleanReturnstrueif current band has the minimum or maximum value defined.private DefaultDataIdentificationCreates the identification information object if it does not already exists, then returns it.private DefaultLineagelineage()Creates the lineage object if it does not already exists, then returns it.booleanmergeMetadata(Object source, Locale locale) Merge the given metadata into the metadata created by this builder.private DefaultMetadatametadata()Creates the metadata object if it does not already exists, then returns it.final voidCommits all pending information under the metadata "acquisition" node (station, sensors, etc).final voidnewCoverage(boolean electromagnetic) Commits all pending information under the metadata "content info" node (bands, etc).final voidCommits all pending information under metadata "distribution" node.final voidCommits all pending information under the metadata "feature catalog" node.final voidCommits all pending information under the metadata "spatial representation" node (dimensions, etc).final voidCommits all pending information under the metadata "identification info" node (author, bounding box, etc).final voidCommits all pending information under the metadata "lineage" node (process steps, etc).final voidCommits all pending information under the "responsible party" node (author, address, etc).final voidCommits all pending information under the coverage "attribute group" node.final voidparseLegalNotice(String notice) Parses the legal notice.private AbstractPartyparty()Creates the individual or organization information object if it does not already exists, then returns it.private DefaultPlatformplatform()Creates a platform object if it does not already exists, then returns it.private DefaultProcessingCreates the processing object if it does not already exists, then returns it.private DefaultProcessStepCreates the process step object if it does not already exists, then returns it.private DefaultResponsiblePartyCreates the responsibility object if it does not already exists, then returns it.private DefaultSampleDimensionCreates the sample dimension object if it does not already exists, then returns it.private DefaultSeriesseries()Returns the information about the series, or aggregate dataset, of which the dataset is a part.final voidsetAxisName(int dimension, org.opengis.metadata.spatial.DimensionNameType name) Sets the number of cells along the given dimension.final voidsetAxisResolution(int dimension, double resolution, javax.measure.Unit<?> unit) Sets the degree of detail in the given dimension.final voidsetAxisSize(int dimension, long length) Sets the number of cells along the given dimension.final voidsetBandIdentifier(int sequenceIdentifier) Sets the number that uniquely identifies instances of bands of wavelengths on which a sensor operates.final voidsetBandIdentifier(org.opengis.util.GenericName sequenceIdentifier) Sets the name or number that uniquely identifies instances of bands of wavelengths on which a sensor operates.final voidsetBitPerSample(int bits) Sets the maximum number of significant bits in the uncompressed representation for the value in current band.final voidsetCellGeometry(org.opengis.metadata.spatial.CellGeometry value) Sets identification of grid data as point or cell.final voidsetCloudCoverPercentage(double value) Sets the area of the dataset obscured by clouds, expressed as a percentage of the spatial extent.final voidsetFormatEdition(CharSequence value) Sets a version number for the resource format.final voidsetGeoreferencingAvailability(boolean transformationParameterAvailability, boolean controlPointAvailability, boolean orientationParameterAvailability) Sets whether parameters for transformation, control/check point(s) or orientation parameters are available.final voidsetGridToCRS(CharSequence value) Sets a general description of the transformation from grid coordinates to "real world" coordinates.final voidsetIlluminationAzimuthAngle(double value) Sets the illumination azimuth measured in degrees clockwise from true north at the time the image is taken.final voidsetIlluminationElevationAngle(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 voidsetISOStandards(boolean part2) Sets the metadata standards to ISO 19115-1, and optionally to ISO 19115-2 too.final voidsetPointInPixel(org.opengis.metadata.spatial.PixelOrientation value) Sets the point in a pixel corresponding to the Earth location of the pixel.final voidsetPredefinedFormat(String abbreviation) Sets the file format.final voidsetProcessingLevelCode(CharSequence authority, String processingLevel) Sets an identifier for the level of processing that has been applied to the coverage.final voidsetSampleUnits(javax.measure.Unit<?> unit) Sets the units of data in the current band.final voidsetTransferFunction(double scale, double offset) Sets the scale factor and offset which have been applied to the cell value.protected final Doubleshared(double value) Returns a shared instance of the given value.protected final Integershared(int value) Returns a shared instance of the given value.private <T> TReturns a shared instance of the given object if it already exists.private org.opengis.metadata.citation.CitationsharedCitation(org.opengis.util.InternationalString title) Creates or fetches a citation for the given title.private org.opengis.metadata.IdentifiersharedIdentifier(CharSequence authority, String code) Creates or fetches an identifier for the given authority and code.private static org.opengis.util.InternationalStringtrim(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 ofDefaultIndividualorDefaultOrganisation.- See Also:
-
gridType
Whether the next grid should be an instance ofDefaultGeorectifiedorDefaultGeoreferenceable. -
electromagnetic
private boolean electromagnetictrueif the nextCoverageDescriptionto 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, ornullif not yet created. -
identification
The identification information that are part of metadata, ornullif none. -
citation
The citation of data identification, ornullif none. -
responsibility
Part of the responsible party of the citation, ornullif none. -
party
Part of the responsible party of the citation, ornullif none. -
constraints
Copyright information, ornullif none. -
extent
The extent information that are part of identification, ornullif none. -
acquisition
Information about the platforms and sensors that collected the data, ornullif none. -
platform
Platform where are installed the sensors that collected the data, ornullif none. -
featureDescription
Information about the feature types, ornullif none. -
coverageDescription
Information about the content of a grid data cell, ornullif none. May also be an instance ofDefaultImageDescriptionifelectromagneticistrue. -
attributeGroup
Information about content type for groups of attributes for a specific range dimension, ornullif none. -
sampleDimension
The characteristic of each dimension (layer) included in the resource, ornullif none. -
gridRepresentation
Information about the grid shape, ornullif 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, ornullif 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 anAbstractPartyinstead 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 theincludedWithDatasetproperty totruebecause 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 inListrather thanSetand for which we do not keep a reference in thisMetadataBuilderafter the element has been added. This method is intended for adding elements that despite being modifiable, are not going to be modified by thisMetadataBuilderclass. 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 thetypeflag. 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 theelectromagneticflag. 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
electromagneticflag needs to be set totrue.- Parameters:
electromagnetic-trueif the nextCoverageDescriptionto 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 ofDefaultGeorectifiedorDefaultGeoreferenceable.
-
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, ornullif 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 ifcodeis 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, ornullif none.code- the identifier code, ornullfor 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/resourceFormatnode. If this exception throws an exception, than that exception should be reported as a warning. Example:- Parameters:
abbreviation- the format short name or abbreviation, ornullfor no-operation.- Throws:
MetadataStoreException- if this method cannot connect to thejdbc/SpatialMetadatadatabase. 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, ornullfor 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, ornullfor 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)ScopeCode#COVERAGE,ScopeCode.FEATUREor the more genericScopeCode.DATASET. Storage locations are:metadata/metadataScope/resourceScopemetadata/metadataScope/name
- Parameters:
scope- the scope of the resource, ornullif none.name- description of the scope, ornullif 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_UPDATEor any other date type prefixed by"LATE_", where only the latest date is kept.- Parameters:
date- the date to add, ornullfor no-operation..type- the type of the date to add, ornullif 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
Returnstrueif 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/titleif not yet usedmetadata/identificationInfo/citation/alternateTitleotherwise
- Parameters:
title- the resource title or alternate title, ornullfor 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, ornullfor 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), ornullfor 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, ornullfor 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, ornullfor 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), ornullfor 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), ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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 thekeywordsarray. Other arguments have no impact on whether keywords are added or not because only theMD_Keywords.keywordproperty is mandatory. Storage locations are:metadata/identificationInfo/descriptiveKeywordsmetadata/identificationInfo/thesaurusName/titlemetadata/identificationInfo/type
- Parameters:
keywords- word(s) used to describe the subject, ornullfor no-operation.type- subject matter used to group similar keywords, ornullif none.thesaurusName- name of the formally registered thesaurus, ornullif 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, ornullfor 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:roleis 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/citedResponsiblePartymetadata/identificationInfo/citation/citedResponsibleParty/role
- Parameters:
party- the individual or organization that is responsible, ornullfor no-operation.role- the role to set, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullif 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/descriptionmetadata/identificationInfo/extent/geographicElement/identifier
- Parameters:
identifier- identifier or description of spatial and temporal extent, ornullfor 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, ornullfor 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), orNaNeastBoundLongitude(the maximal λ value), orNaNsouthBoundLatitude(the minimal φ value), orNaNnorthBoundLatitude(the maximal φ value), orNaN
metadata/identificationInfo/extent/geographicElement
- Parameters:
coordinates- the geographic coordinates, ornullfor 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.NaNif none.maximumValue- the highest vertical extent contained in the dataset, orDouble.NaNif 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, ornullif unbounded.endTime- when the data ends, ornullif unbounded.- See Also:
-
addFeatureType
Adds descriptions for the given feature. Storage locations are:metadata/contentInfo/featureTypes/featureTypeNamemetadata/contentInfo/featureTypes/featureInstanceCount
FeatureNaming.add(…). Note that theFeatureCatalogBuildersubclasses can also be used for that chaining.- Parameters:
type- the feature type to add, ornullfor 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
nullif 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/featureTypeNamemetadata/contentInfo/featureTypes/featureInstanceCount
- Parameters:
name- name of the feature type to add, ornullfor 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, ornullfor 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 returnsfalsein which case nothing has been done. Storage locations are:metadata/spatialRepresentationInfo/transformationDimensionDescriptionmetadata/spatialRepresentationInfo/transformationParameterAvailabilitymetadata/spatialRepresentationInfo/axisDimensionProperties/dimensionNamemetadata/spatialRepresentationInfo/axisDimensionProperties/dimensionSizemetadata/spatialRepresentationInfo/axisDimensionProperties/resolutionmetadata/identificationInfo/spatialRepresentationTypemetadata/referenceSystemInfo
GridGeometry.getEnvelope(). That envelope appears in a separated node, which can be added byaddExtent(Envelope). This separation is required byAbstractGridCoverageResourcefor instance.- Parameters:
description- a general description of the "grid to CRS" transformation, ornullif none. Can also be specified later by a call tosetGridToCRS(CharSequence).grid- the grid extent, "grid to CRS" transform and target CRS, ornullif none.addResolution- whether to declare the resolutions. Callers should set this argument tofalseif 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, orNaNfor 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, ornullfor 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, ornullfor 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/transformationParameterAvailabilitymetadata/spatialRepresentationInfo/controlPointAvailabilitymetadata/spatialRepresentationInfo/orientationParameterAvailability
- If georeferenced:
metadata/spatialRepresentationInfo/transformationParameterAvailabilitymetadata/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, ornullif 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/geographicCoordinatesif georectifiedmetadata/spatialRepresentationInfo/geolocationInformation/gcp/geographicCoordinatesif 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, ornullif none. Ignored ifgeographicCoordinatesis 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, ornullfor 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, ofnullif 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, ornullfor 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/sequenceIdentifiermetadata/contentInfo/attributeGroup/attribute/minValuemetadata/contentInfo/attributeGroup/attribute/maxValuemetadata/contentInfo/attributeGroup/attribute/scalemetadata/contentInfo/attributeGroup/attribute/offsetmetadata/contentInfo/attributeGroup/attribute/transferFunctionTypemetadata/contentInfo/attributeGroup/attribute/unit
- Parameters:
band- the sample dimension to describe in metadata, ornullif 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, ornullfor 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, ornullif none.name- the band name, ornullfor 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, ornullfor 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.Categoryin thesis-coveragemodule.- Parameters:
name- designation associated with a set of range elements, ornullif none.definition- description of a set of specific range elements, ornullif 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.NaNvalues 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, orNaNfor 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.NaNvalues 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, orNaNfor no-operation.
-
hasSampleValueRange
public final boolean hasSampleValueRange()Returnstrueif 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/scalemetadata/contentInfo/attributeGroup/attribute/offsetmetadata/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/processingLevelbut is currently not used.- Parameters:
authority- identifies which controlled list of code is used, ornullif none.processingLevel- identifier for the level of processing that has been applied to the resource, ornullfor 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 theelectromagneticparameter set totrue. Storage location is:metadata/contentInfo/cloudCoverPercentage
- Parameters:
value- the new cloud percentage, orNaNfor 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 theelectromagneticparameter set totrue. Storage location is:metadata/contentInfo/illuminationAzimuthAngle
- Parameters:
value- the new illumination azimuth angle, orNaNfor 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 theelectromagneticparameter set totrue. Storage location is:metadata/contentInfo/illuminationElevationAngle
- Parameters:
value- the new illumination azimuth angle, orNaNfor 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, ornullif none.identifier- identifier of the platform to add, ornullfor 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, ornullif none.identifier- identifier of the sensor to add, ornullfor 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, ornullfor 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, ornullif unknown.endTime- end time, ornullif 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, ornullif none.identifier- unique identification of the operation, ornullfor 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, ornullif none.identifier- unique name or code for the requirement, ornullfor 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, ornullfor 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/descriptionmetadata/resourceLineage/source/citationmetadata/resourceLineage/source/scope/levelmetadata/resourceLineage/source/scope/extentmetadata/resourceLineage/source/sourceReferenceSystemmetadata/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/descriptionmetadata/resourceLineage/source/scope/levelmetadata/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.MODELand feature "Digital Elevation Model".- Parameters:
description- a detailed description of the level of the source data, ornullif none.level- hierarchical level of the source (e.g. model), ornullif unspecified.feature- more detailed name forlevel, ornullif 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/levelmetadata/resourceLineage/source/scope/extentmetadata/resourceLineage/source/scope/levelDescription/*metadata/resourceLineage/source/citationmetadata/resourceLineage/source/sourceReferenceSystemmetadata/resourceLineage/source/sourceSpatialResolution
Example: if aFeatureSetis the aggregation of two otherFeatureSetresources, then this method can be invoked twice with the metadata of each sourceFeatureSet. If the aggregated data are features, thenlevelshould beScopeCode.FEATURE.- Parameters:
metadata- the metadata of the source, ornullif 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, ornullif none.identifier- processing package that produced the data, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor 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, ornullfor no-operation.- See Also:
-
addCompleteMetadata
Adds a URL to a more complete description of the metadata. Storage location is:metadata/metadataLinkage/linkagewithfunctionset 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
Extentper 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, ornullfor the default locale.- Returns:
trueif the given source has been merged, orfalseif 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 theDefaultMetadataroot class. Then allidentification,gridRepresentation, etc. fields exceptmetadataare 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).
-