001/*
002 *    GeoAPI - Java interfaces for OGC/ISO standards
003 *    Copyright © 2004-2024 Open Geospatial Consortium, Inc.
004 *    http://www.geoapi.org
005 *
006 *    Licensed under the Apache License, Version 2.0 (the "License");
007 *    you may not use this file except in compliance with the License.
008 *    You may obtain a copy of the License at
009 *
010 *        http://www.apache.org/licenses/LICENSE-2.0
011 *
012 *    Unless required by applicable law or agreed to in writing, software
013 *    distributed under the License is distributed on an "AS IS" BASIS,
014 *    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
015 *    See the License for the specific language governing permissions and
016 *    limitations under the License.
017 */
018package org.opengis.metadata.lineage;
019
020import java.util.Collection;
021import java.util.Collections;
022import org.opengis.util.InternationalString;
023import org.opengis.metadata.extent.Extent;
024import org.opengis.metadata.maintenance.Scope;
025import org.opengis.metadata.identification.Resolution;
026import org.opengis.metadata.identification.RepresentativeFraction;
027import org.opengis.metadata.citation.Citation;
028import org.opengis.referencing.ReferenceSystem;
029import org.opengis.annotation.UML;
030import org.opengis.metadata.Identifier;
031
032import static org.opengis.annotation.Obligation.*;
033import static org.opengis.annotation.Specification.*;
034
035
036/**
037 * Information about the resource used in creating the resource specified by the scope.
038 *
039 * At least one of the {@linkplain #getDescription() description} and
040 * {@linkplain #getScope() scope} shall be provided.
041 *
042 * @author  Martin Desruisseaux (IRD)
043 * @author  Cory Horner (Refractions Research)
044 * @author  Cédric Briançon (Geomatys)
045 * @author  Rémi Maréchal (Geomatys)
046 * @version 3.1
047 * @since   2.0
048 */
049@UML(identifier="LI_Source", specification=ISO_19115)
050public interface Source {
051    /**
052     * Detailed description of the level of the source data.
053     *
054     * @return description of the level of the source data, or {@code null} if none.
055     *
056     * @condition Mandatory if the {@linkplain #getScope() scope} is not provided.
057     */
058    @UML(identifier="description", obligation=CONDITIONAL, specification=ISO_19115)
059    InternationalString getDescription();
060
061    /**
062     * Spatial resolution expressed as a scale factor, an angle or a level of detail.
063     * May be {@code null} if none.
064     *
065     * @return spatial resolution expressed as a scale factor, an angle or a level of detail, or {@code null} if none.
066     *
067     * @since 3.1
068     */
069    @UML(identifier="sourceSpatialResolution", obligation=OPTIONAL, specification=ISO_19115)
070    default Resolution getSourceSpatialResolution() {
071        return null;
072    }
073
074    /**
075     * Denominator of the representative fraction on a source map.
076     *
077     * @return representative fraction on a source map, or {@code null}.
078     *
079     * @deprecated As of ISO 19115:2014, moved to {@link Resolution#getEquivalentScale()}.
080     */
081    @Deprecated(since="3.1")
082    @UML(identifier="scaleDenominator", obligation=OPTIONAL, specification=ISO_19115, version=2003)
083    default RepresentativeFraction getScaleDenominator() {
084        Resolution res = getSourceSpatialResolution();
085        return (res != null) ? res.getEquivalentScale() : null;
086    }
087
088    /**
089     * Spatial reference system used by the source data.
090     *
091     * @return spatial reference system used by the source data, or {@code null}.
092     */
093    @UML(identifier="sourceReferenceSystem", obligation=OPTIONAL, specification=ISO_19115)
094    default ReferenceSystem getSourceReferenceSystem() {
095        return null;
096    }
097
098    /**
099     * Recommended reference to be used for the source data.
100     *
101     * @return recommended reference to be used for the source data, or {@code null}.
102     */
103    @UML(identifier="sourceCitation", obligation=OPTIONAL, specification=ISO_19115)
104    default Citation getSourceCitation() {
105        return null;
106    }
107
108    /**
109     * References to metadata for the source.
110     * Returns an empty collection if none.
111     *
112     * @return references to metadata for the source.
113     *
114     * @since 3.1
115     */
116    @UML(identifier="sourceMetadata", obligation=OPTIONAL, specification=ISO_19115)
117    default Collection<? extends Citation> getSourceMetadata() {
118        return Collections.emptyList();
119    }
120
121    /**
122     * Type and / or extent of the source.
123     * May be {@code null} if none.
124     *
125     * @return type and / or extent of the source, or {@code null} if none.
126     *
127     * @condition Mandatory if the {@linkplain #getDescription() description} is not provided.
128     *
129     * @since 3.1
130     */
131    @UML(identifier="scope", obligation=CONDITIONAL, specification=ISO_19115)
132    Scope getScope();
133
134    /**
135     * Information about the spatial, vertical and temporal extent of the source data.
136     *
137     * @return information about the extent of the source data.
138     *
139     * @condition Mandatory if the {@linkplain #getDescription() description} is not provided.
140     *
141     * @deprecated As of ISO 19115:2014, moved to {@link Scope#getExtents()}.
142     */
143    @Deprecated(since="3.1")
144    @UML(identifier="sourceExtent", obligation=CONDITIONAL, specification=ISO_19115, version=2003)
145    default Collection<? extends Extent> getSourceExtents() {
146        return Collections.emptyList();
147    }
148
149    /**
150     * Information about process steps in which this source was used.
151     *
152     * @return information about process steps in which this source was used.
153     */
154    @UML(identifier="sourceStep", obligation=OPTIONAL, specification=ISO_19115)
155    default Collection<? extends ProcessStep> getSourceSteps() {
156        return Collections.emptyList();
157    }
158
159    /**
160     * Processing level of the source data.
161     *
162     * @return processing level of the source data, or {@code null}.
163     */
164    @UML(identifier="processedLevel", obligation=OPTIONAL, specification=ISO_19115_2)
165    default Identifier getProcessedLevel() {
166        return null;
167    }
168
169    /**
170     * Distance between consistent parts (centre, left side, right side) of two adjacent pixels.
171     *
172     * @return distance between consistent parts of two adjacent pixels.
173     */
174    @UML(identifier="resolution", obligation=OPTIONAL, specification=ISO_19115_2)
175    default NominalResolution getResolution() {
176        return null;
177    }
178}