sis-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From desruisse...@apache.org
Subject [sis] 01/01: Merge branch 'geoapi-4.0' into 'geoapi-3.1'.
Date Wed, 18 Jul 2018 17:29:48 GMT
This is an automated email from the ASF dual-hosted git repository.

desruisseaux pushed a commit to branch geoapi-3.1
in repository https://gitbox.apache.org/repos/asf/sis.git

commit e044c131b91f3fa123aa0ad866416c834b95de44
Merge: 585bddd e487e47
Author: Martin Desruisseaux <martin.desruisseaux@geomatys.com>
AuthorDate: Wed Jul 18 19:29:04 2018 +0200

    Merge branch 'geoapi-4.0' into 'geoapi-3.1'.

 NOTICE                                             |   2 +-
 core/sis-build-helper/pom.xml                      |   8 +-
 .../java/org/apache/sis/feature/FeatureFormat.java |   9 +-
 .../apache/sis/feature/StringJoinOperation.java    |   3 +-
 .../feature/builder/AssociationRoleBuilder.java    |   2 +-
 .../sis/feature/builder/AttributeTypeBuilder.java  |   4 +-
 .../sis/feature/builder/FeatureTypeBuilder.java    |  20 +-
 .../sis/feature/builder/PropertyTypeBuilder.java   |   2 +-
 .../apache/sis/feature/builder/TypeBuilder.java    |   9 +-
 core/sis-metadata/pom.xml                          |  10 +
 .../apache/sis/internal/metadata/sql/Dialect.java  |   3 +-
 .../sis/internal/metadata/sql/Reflection.java      | 216 ++++++
 .../sis/internal/metadata/sql/SQLBuilder.java      |  35 +-
 .../sis/internal/metadata/sql/SQLUtilities.java    |   5 +-
 .../sis/internal/metadata/sql/ScriptRunner.java    |   4 +-
 .../iso/maintenance/AttributeTypeAdapter.java      |   4 +-
 .../iso/maintenance/DefaultScopeDescription.java   |   2 +-
 .../iso/maintenance/FeatureTypeAdapter.java        |   4 +-
 .../{LegacyType.java => LegacyFeatureType.java}    |  17 +-
 .../apache/sis/metadata/sql/MetadataSource.java    |   3 +-
 .../apache/sis/metadata/sql/MetadataWriter.java    |  11 +-
 .../apache/sis/metadata/sql/TableHierarchy.java    |   6 +-
 .../org/apache/sis/util/iso/GlobalNameSpace.java   |   2 +-
 .../main/java/org/apache/sis/util/iso/Names.java   |  25 +-
 .../main/java/org/apache/sis/xml/Namespaces.java   |  14 +-
 .../internal/jaxb/cat/CodeListMarshallingTest.java |   4 +-
 .../sis/internal/jaxb/cat/EnumMarshallingTest.java |   4 +-
 .../sis/internal/jaxb/gco/PropertyTypeTest.java    |   8 +-
 .../sis/internal/jaxb/gml/TimePeriodTest.java      |   4 +-
 .../internal/jaxb/lan/FreeTextMarshallingTest.java |   4 +-
 .../sis/internal/jaxb/lan/LanguageCodeTest.java    |   4 +-
 .../metadata/replace/ServiceParameterTest.java     |   4 +-
 .../internal/metadata/sql/ScriptRunnerTest.java    |  16 +-
 .../sis/internal/metadata/sql/TestDatabase.java    | 119 ----
 ...aratorTest.java => DocumentComparatorTest.java} |  20 +-
 .../apache/sis/internal/xml/XmlUtilitiesTest.java  |   4 +-
 .../sis/metadata/iso/CustomMetadataTest.java       |   4 +-
 .../sis/metadata/iso/DefaultIdentifierTest.java    |   4 +-
 .../sis/metadata/iso/DefaultMetadataTest.java      |   4 +-
 .../sis/metadata/iso/ImmutableIdentifierTest.java  |   4 +-
 .../metadata/iso/citation/DefaultContactTest.java  |   4 +-
 .../iso/citation/DefaultResponsibilityTest.java    |   4 +-
 .../constraint/DefaultLegalConstraintsTest.java    |   4 +-
 .../identification/DefaultBrowseGraphicTest.java   |   4 +-
 .../DefaultRepresentativeFractionTest.java         |   4 +-
 .../iso/identification/DefaultResolutionTest.java  |   4 +-
 .../metadata/iso/lineage/DefaultLineageTest.java   |   4 +-
 .../sis/metadata/sql/IdentifierGeneratorTest.java  |  13 +-
 .../sis/metadata/sql/MetadataSourceTest.java       |  12 +-
 .../sis/metadata/sql/MetadataWriterTest.java       |  51 +-
 .../org/apache/sis/metadata/xml/TestUsingFile.java |   4 +-
 .../java/org/apache/sis/test/MetadataAssert.java   |  15 +-
 .../org/apache/sis/test/mock/package-info.java     |   2 +-
 .../java/org/apache/sis/test/sql/TestDatabase.java | 269 +++++++
 .../org/apache/sis/test/sql}/package-info.java     |  13 +-
 .../apache/sis/test/suite/MetadataTestSuite.java   |   2 +-
 .../DocumentComparator.java}                       |  30 +-
 .../test/{XMLTestCase.java => xml/TestCase.java}   |  12 +-
 .../java/org/apache/sis/test/xml/package-info.java |  23 +-
 .../apache/sis/util/iso/NameMarshallingTest.java   |   4 +-
 .../sis/xml/CharSequenceSubstitutionTest.java      |   4 +-
 .../apache/sis/xml/NilReasonMarshallingTest.java   |   4 +-
 .../org/apache/sis/xml/ReferenceResolverMock.java  |   2 +-
 .../org/apache/sis/xml/UUIDMarshallingTest.java    |   4 +-
 .../org/apache/sis/xml/XLinkMarshallingTest.java   |   4 +-
 .../java/org/apache/sis/parameter/Parameters.java  |   2 +
 .../referencing/factory/sql/EPSGDataAccess.java    |   2 +-
 .../sis/referencing/factory/sql/SQLTranslator.java |   9 +-
 .../CC_GeneralOperationParameterTest.java          |   4 +-
 .../CC_OperationParameterGroupTest.java            |   4 +-
 .../referencing/SecondDefiningParameterTest.java   |   4 +-
 .../sis/parameter/ParameterMarshallingTest.java    |   4 +-
 .../referencing/crs/DefaultCompoundCRSTest.java    |   4 +-
 .../sis/referencing/crs/DefaultDerivedCRSTest.java |   4 +-
 .../referencing/crs/DefaultEngineeringCRSTest.java |   4 +-
 .../referencing/crs/DefaultGeodeticCRSTest.java    |   4 +-
 .../sis/referencing/crs/DefaultImageCRSTest.java   |   4 +-
 .../referencing/crs/DefaultProjectedCRSTest.java   |   4 +-
 .../sis/referencing/cs/DefaultCartesianCSTest.java |   4 +-
 .../referencing/cs/DefaultEllipsoidalCSTest.java   |   4 +-
 .../referencing/datum/DefaultEllipsoidTest.java    |   4 +-
 .../datum/DefaultGeodeticDatumTest.java            |   4 +-
 .../datum/DefaultPrimeMeridianTest.java            |   4 +-
 .../datum/DefaultTemporalDatumTest.java            |   4 +-
 .../datum/DefaultVerticalDatumTest.java            |   4 +-
 .../referencing/factory/sql/EPSGInstallerTest.java |  43 +-
 .../factory/sql/epsg/DataScriptFormatter.java      |  10 +-
 .../DefaultConcatenatedOperationTest.java          |   4 +-
 .../operation/DefaultPassThroughOperationTest.java |   4 +-
 .../operation/SingleOperationMarshallingTest.java  |   4 +-
 .../apache/sis/test/integration/MetadataTest.java  |   8 +-
 .../apache/sis/internal/util/CollectionsExt.java   |  22 +
 .../sis/util/resources/IndexedResourceBundle.java  |   2 +-
 .../resources/ResourceInternationalString.java     |  27 +-
 .../org/apache/sis/util/resources/Vocabulary.java  |   5 +
 .../sis/util/resources/Vocabulary.properties       |   1 +
 .../sis/util/resources/Vocabulary_fr.properties    |   1 +
 .../apache/sis/util/resources/package-info.java    |   2 +-
 ide-project/NetBeans/build.xml                     |   3 +
 ide-project/NetBeans/nbproject/project.properties  |   5 +-
 pom.xml                                            |  12 +-
 .../profile/fra/DataIdentificationTest.java        |   4 +-
 .../profile/fra/DirectReferenceSystemTest.java     |   4 +-
 storage/pom.xml                                    |   4 +-
 .../storage/earthobservation/LandsatReader.java    |  23 +-
 .../earthobservation/LandsatReaderTest.java        |  10 +-
 .../apache/sis/storage/geotiff/Compression.java    |  28 +-
 .../apache/sis/storage/geotiff/GeoTiffStore.java   |   1 +
 .../apache/sis/storage/netcdf/AttributeNames.java  |  19 +-
 .../apache/sis/storage/netcdf/MetadataReader.java  |  69 +-
 .../org/apache/sis/storage/netcdf/NetcdfStore.java |  48 +-
 .../sis/storage/netcdf/MetadataReaderTest.java     |   8 +-
 .../java/org/apache/sis/internal/sql/Dialect.java  | 167 -----
 .../internal/sql/SingleAttributeTypeBuilder.java   | 260 -------
 .../sis/internal/sql/postgres/PostgresDialect.java | 107 ---
 .../sis/internal/sql/postgres/PostgresStore.java   |  88 ---
 .../sql/postgres/PostgresStoreProvider.java        |  74 --
 .../sis/internal/sql/reverse/CachedResultSet.java  |  73 --
 .../sis/internal/sql/reverse/ColumnMetaModel.java  | 208 ------
 .../sis/internal/sql/reverse/DataBaseModel.java    | 769 ---------------------
 .../internal/sql/reverse/MetaDataConstants.java    | 515 --------------
 .../apache/sis/internal/sql/reverse/MetaModel.java |  79 ---
 .../sis/internal/sql/reverse/PrimaryKey.java       | 104 ---
 .../sis/internal/sql/reverse/QueryFeatureSet.java  |  94 ---
 .../internal/sql/reverse/RelationMetaModel.java    |  65 --
 .../sis/internal/sql/reverse/SchemaMetaModel.java  |  70 --
 .../sis/internal/sql/reverse/TableMetaModel.java   | 116 ----
 .../java/org/apache/sis/storage/sql/SQLQuery.java  |  72 --
 .../java/org/apache/sis/storage/sql/SQLStore.java  |  73 --
 storage/{sis-sql => sis-sqlstore}/pom.xml          |  25 +-
 .../apache/sis/internal/sql/feature/Analyzer.java  | 329 +++++++++
 .../apache/sis/internal/sql/feature/Database.java  | 237 +++++++
 .../apache/sis/internal/sql/feature/Features.java  | 499 +++++++++++++
 .../apache/sis/internal/sql/feature/Relation.java  | 419 +++++++++++
 .../apache/sis/internal/sql/feature/Resources.java | 211 ++++++
 .../sis/internal/sql/feature/Resources.properties  |  28 +
 .../internal/sql/feature/Resources_fr.properties   |  33 +
 .../sis/internal/sql/feature/SpatialFunctions.java | 144 ++++
 .../org/apache/sis/internal/sql/feature/Table.java | 625 +++++++++++++++++
 .../sis/internal/sql/feature/TableReference.java   | 152 ++++
 .../sis/internal/sql/feature}/package-info.java    |   6 +-
 .../java/org/apache/sis/storage/sql/SQLStore.java  | 245 +++++++
 .../apache/sis/storage/sql/SQLStoreProvider.java   | 231 +++++++
 .../org/apache/sis/storage/sql/package-info.java   |   7 +-
 .../org/apache/sis/storage/sql/SQLStoreTest.java   | 270 ++++++++
 .../org/apache/sis/test/suite/SQLTestSuite.java}   |  31 +-
 .../org/apache/sis/test/suite/package-info.txt     |   0
 .../org/apache/sis/storage/sql/Features.sql        |  69 ++
 .../sis/internal/storage/AbstractFeatureSet.java   |   2 +-
 .../sis/internal/storage/MetadataBuilder.java      | 139 +++-
 .../org/apache/sis/internal/storage/csv/Store.java |   4 +-
 .../java/org/apache/sis/storage/Aggregate.java     |   2 +-
 .../sis/storage/InternalDataStoreException.java    |  71 ++
 153 files changed, 4791 insertions(+), 3497 deletions(-)

diff --cc core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java
index be02d95,0000000..6db039e
mode 100644,000000..100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/AttributeTypeAdapter.java
@@@ -1,52 -1,0 +1,52 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.sis.metadata.iso.maintenance;
 +
 +import javax.xml.bind.annotation.adapters.XmlAdapter;
 +import org.opengis.feature.type.AttributeType;
 +import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 +
 +
 +/**
 + * For (un)marshalling deprecated {@link AttributeType} as a character string,
 + * as expected by ISO 19115-3:2016. This is a temporary bridge to be removed
 + * after the GeoAPI interfaces has been upgraded to ISO 19115-1:2014 model.
 + *
 + * @author  Martin Desruisseaux (Geomatys)
 + * @version 1.0
 + * @since   1.0
 + * @module
 + */
 +final class AttributeTypeAdapter extends XmlAdapter<GO_CharacterString, AttributeType>
{
 +    /**
 +     * Wrap the given value from {@link DefaultScopeDescription} to the elements
 +     * defined by ISO 19115-3:2016 schema.
 +     */
 +    @Override
 +    public AttributeType unmarshal(GO_CharacterString value) {
-         return new LegacyType(LegacyType.ADAPTER.unmarshal(value));
++        return new LegacyFeatureType(LegacyFeatureType.ADAPTER.unmarshal(value));
 +    }
 +
 +    /**
 +     * Unwrap the elements defined by ISO 19115-3:2016 schema to the value used by
 +     * {@link DefaultScopeDescription}.
 +     */
 +    @Override
 +    public GO_CharacterString marshal(AttributeType value) {
-         return LegacyType.ADAPTER.marshal(LegacyType.wrap(value));
++        return LegacyFeatureType.ADAPTER.marshal(LegacyFeatureType.wrap(value));
 +    }
 +}
diff --cc core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java
index a9f1b47,0000000..af1eb36
mode 100644,000000..100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/FeatureTypeAdapter.java
@@@ -1,52 -1,0 +1,52 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.sis.metadata.iso.maintenance;
 +
 +import javax.xml.bind.annotation.adapters.XmlAdapter;
 +import org.opengis.feature.type.FeatureType;
 +import org.apache.sis.internal.jaxb.gco.GO_CharacterString;
 +
 +
 +/**
 + * For (un)marshalling deprecated {@link FeatureType} as a character string,
 + * as expected by ISO 19115-3:2016. This is a temporary bridge to be removed
 + * after the GeoAPI interfaces has been upgraded to ISO 19115-1:2014 model.
 + *
 + * @author  Martin Desruisseaux (Geomatys)
 + * @version 1.0
 + * @since   1.0
 + * @module
 + */
 +final class FeatureTypeAdapter extends XmlAdapter<GO_CharacterString, FeatureType>
{
 +    /**
 +     * Wrap the given value from {@link DefaultScopeDescription} to the elements
 +     * defined by ISO 19115-3:2016 schema.
 +     */
 +    @Override
 +    public FeatureType unmarshal(GO_CharacterString value) {
-         return new LegacyType(LegacyType.ADAPTER.unmarshal(value));
++        return new LegacyFeatureType(LegacyFeatureType.ADAPTER.unmarshal(value));
 +    }
 +
 +    /**
 +     * Unwrap the elements defined by ISO 19115-3:2016 schema to the value used by
 +     * {@link DefaultScopeDescription}.
 +     */
 +    @Override
 +    public GO_CharacterString marshal(FeatureType value) {
-         return LegacyType.ADAPTER.marshal(LegacyType.wrap(value));
++        return LegacyFeatureType.ADAPTER.marshal(LegacyFeatureType.wrap(value));
 +    }
 +}
diff --cc core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyFeatureType.java
index d6f24c3,0000000..33c720c
mode 100644,000000..100644
--- a/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyFeatureType.java
+++ b/core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/maintenance/LegacyFeatureType.java
@@@ -1,70 -1,0 +1,77 @@@
 +/*
 + * Licensed to the Apache Software Foundation (ASF) under one or more
 + * contributor license agreements.  See the NOTICE file distributed with
 + * this work for additional information regarding copyright ownership.
 + * The ASF licenses this file to You under the Apache License, Version 2.0
 + * (the "License"); you may not use this file except in compliance with
 + * the License.  You may obtain a copy of the License at
 + *
 + *     http://www.apache.org/licenses/LICENSE-2.0
 + *
 + * Unless required by applicable law or agreed to in writing, software
 + * distributed under the License is distributed on an "AS IS" BASIS,
 + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 + * See the License for the specific language governing permissions and
 + * limitations under the License.
 + */
 +package org.apache.sis.metadata.iso.maintenance;
 +
 +import org.opengis.feature.type.FeatureType;
 +import org.opengis.feature.type.AttributeType;
 +import org.apache.sis.internal.jaxb.gco.CharSequenceAdapter;
++import org.apache.sis.util.ArgumentChecks;
 +
 +
 +/**
 + * Bridges between deprecated {@link FeatureType} / {@link AttributeType} and {@link CharSequence}.
 + * {@code FeatureType} and {@code AttributeType} were used in ISO 19115:2003, but have been
replaced
 + * by {@link CharSequence} in ISO 19115:2014. The corresponding GeoAPI 3.0 interfaces are
empty since
-  * they were placeholder for future work. We use this {@code LegacyType} as a temporary
bridge, to be
-  * removed with GeoAPI 4.0.
++ * they were placeholder for future work. We use this {@code LegacyFeatureType} as a temporary
bridge,
++ * to be removed with GeoAPI 4.0.
 + *
 + * @author  Martin Desruisseaux (Geomatys)
 + * @version 1.0
 + * @since   1.0
 + * @module
++ *
++ * @deprecated To be removed after migration to GeoAPI 4.0.
 + */
- final class LegacyType implements FeatureType, AttributeType, CharSequence {
++@Deprecated
++public final class LegacyFeatureType implements FeatureType, AttributeType, CharSequence
{
 +    /**
 +     * The adapter doing most of the actual work of converting {@code FeatureType} or {@code
AttributeType}
 +     * to {@code <gco:CharacterSequence>} elements.
 +     */
 +    static final CharSequenceAdapter ADAPTER = new CharSequenceAdapter();
 +
 +    /**
 +     * The value to wrap as a {@code FeatureType} or {@code AttributeType}.
 +     */
 +    private final CharSequence value;
 +
 +    /**
 +     * Creates a new type for the given value, which must be non-null.
++     *
++     * @param  value  the text to wrap in a legacy feature type.
 +     */
-     LegacyType(final CharSequence value) {
++    public LegacyFeatureType(final CharSequence value) {
++        ArgumentChecks.ensureNonNull("value", value);
 +        this.value = value;
 +    }
 +
 +    /**
 +     * Wraps the given {@code FeatureType} or {@code AttributeType} as a {@code CharSequence}.
 +     */
 +    static CharSequence wrap(final Object value) {
 +        return (value == null || value instanceof CharSequence)
-                 ? (CharSequence) value : new LegacyType(value.toString());
++                ? (CharSequence) value : new LegacyFeatureType(value.toString());
 +    }
 +
 +    /**
 +     * Delegates to the value given at construction time.
 +     */
 +    @Override public int          length()                        {return value.length();}
 +    @Override public char         charAt(int index)               {return value.charAt(index);}
 +    @Override public CharSequence subSequence(int start, int end) {return value.subSequence(start,
end);}
 +    @Override public String       toString()                      {return value.toString();}
 +}
diff --cc core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataWriterTest.java
index 5849532,ed867e1..8b4d6a2
--- a/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataWriterTest.java
+++ b/core/sis-metadata/src/test/java/org/apache/sis/metadata/sql/MetadataWriterTest.java
@@@ -126,7 -121,7 +121,7 @@@ public final strictfp class MetadataWri
          assertEquals("EPSG",      source.search(HardCodedCitations.EPSG));
          assertEquals("SIS",       source.search(HardCodedCitations.SIS));
          assertNull  ("ISO 19111", source.search(HardCodedCitations.ISO_19111));
-         assertEquals("{CI_ResponsibleParty}EPS", source.search(TestUtilities.getSingleton(
 -        assertEquals("EPSG",      source.search(TestUtilities.getSingleton(
++        assertEquals("{rp}EPSG",  source.search(TestUtilities.getSingleton(
                  HardCodedCitations.EPSG.getCitedResponsibleParties())));
      }
  
diff --cc storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
index f9d9c9c,975692a..44ce727
--- a/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
+++ b/storage/sis-netcdf/src/main/java/org/apache/sis/storage/netcdf/MetadataReader.java
@@@ -661,8 -647,10 +648,10 @@@ split:  while ((start = CharSequences.s
              for (final String keyword : split(stringValue(ACCESS_CONSTRAINT))) {
                  addAccessConstraint(forCodeName(Restriction.class, keyword));
              }
 -            addTopicCategory(forEnumName(TopicCategory.class, stringValue(TOPIC_CATEGORY)));
 +            addTopicCategory(forCodeName(TopicCategory.class, stringValue(TOPIC_CATEGORY)));
-             addSpatialRepresentation(forCodeName(SpatialRepresentationType.class, stringValue(DATA_TYPE)));
+             SpatialRepresentationType dt = forCodeName(SpatialRepresentationType.class,
stringValue(DATA_TYPE));
+             addSpatialRepresentation(dt);
+             hasDataType |= (dt != null);
              if (!hasExtent) {
                  /*
                   * Takes only ONE extent, because a netCDF file may declare many time the
same
diff --cc storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
index d2e48b6,7b1eac6..22f33a9
--- a/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
+++ b/storage/sis-storage/src/main/java/org/apache/sis/internal/storage/MetadataBuilder.java
@@@ -2605,6 -2624,64 +2631,64 @@@ parse:      for (int i = 0; i < length;
      }
  
      /**
+      * 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:
+      *
+      * <ul>
+      *   <li>{@code metadata/resourceLineage/statement}</li>
+      * </ul>
+      *
+      * @param statement  explanation of the data producer's knowledge about the lineage,
or {@code null} for no-operation.
+      *
+      * @see #addProcessDescription(CharSequence)
+      */
+     public final void addLineage(final CharSequence statement) {
+         final InternationalString i18n = trim(statement);
+         if (i18n != null) {
+             final DefaultLineage lineage = lineage();
+             lineage.setStatement(append(lineage.getStatement(), i18n));
+         }
+     }
+ 
+     /**
+      * Adds information about a source of data used for producing the resource.
+      * Storage location is:
+      *
+      * <ul>
+      *   <li>{@code metadata/resourceLineage/source/description}</li>
+      *   <li>{@code metadata/resourceLineage/source/scope/level}</li>
+      *   <li>{@code metadata/resourceLineage/source/scope/levelDescription/features}</li>
+      * </ul>
+      *
+      * <div class="note"><b>Example:</b>
+      * if a Landsat image uses the "GTOPO30" digital elevation model, then it can declare
the source
+      * with "GTOPO30" description, {@link ScopeCode#MODEL} and feature "Digital Elevation
Model".</div>
+      *
+      * @param  description  a detailed description of the level of the source data, or {@code
null} if none.
+      * @param  level        hierarchical level of the source (e.g. model), or {@code null} if
unspecified.
+      * @param  feature      more detailed name for {@code level}, or {@code null} if none.
+      *
+      * @see #addProcessing(CharSequence, String)
+      * @see #addProcessDescription(CharSequence)
+      */
+     public final void addSource(final CharSequence description, final ScopeCode level, final
CharSequence feature) {
+         final InternationalString i18n = trim(description);
+         if (i18n != null) {
+             final DefaultSource source = new DefaultSource(description);
+             if (level != null || feature != null) {
+                 DefaultScope scope = new DefaultScope(level);
+                 if (feature != null) {
+                     final DefaultScopeDescription sd = new DefaultScopeDescription();
 -                    sd.getFeatures().add(feature);
++                    sd.getFeatures().add(new org.apache.sis.metadata.iso.maintenance.LegacyFeatureType(feature));
+                     scope.getLevelDescription().add(sd);
+                 }
+             }
+             addIfNotPresent(lineage().getSources(), source);
+         }
+     }
+ 
+     /**
       * 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:


Mime
View raw message