Search in sources :

Example 6 with DefaultIdentifier

use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.

the class DefaultProcessStepTest method roundtrip.

/**
 * Tests (un)marshalling in the given version.
 */
private void roundtrip(final String filename, final Version version) throws JAXBException {
    final DefaultProcessing processing = new DefaultProcessing();
    final DefaultProcessStep processStep = new DefaultProcessStep("Some process step.");
    processing.setProcedureDescription(new SimpleInternationalString("Some procedure."));
    processing.setIdentifier(new DefaultIdentifier("P4"));
    processStep.setProcessingInformation(processing);
    /*
         * XML marshalling, and compare with the content of "ProcessStep.xml" file.
         */
    assertMarshalEqualsFile(filename, processStep, version, "xmlns:*", "xsi:schemaLocation");
    /*
         * XML unmarshalling: ensure that we didn't lost any information.
         * Note that since the XML uses the <gmi:…> namespace, we got an instance of LE_ProcessStep, which
         * in SIS implementation does not carry any useful information; it is just a consequence of the way
         * namespaces are managed. We will convert to the parent DefaultProcessStep type before comparison.
         */
    DefaultProcessStep step = unmarshalFile(DefaultProcessStep.class, filename);
    assertInstanceOf("The unmarshalled object is expected to be in GMI namespace.", LE_ProcessStep.class, step);
    step = new DefaultProcessStep(step);
    assertEquals(processStep, step);
}
Also used : SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) DefaultIdentifier(org.apache.sis.metadata.iso.DefaultIdentifier)

Example 7 with DefaultIdentifier

use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.

the class MergerTest method createSample2.

/**
 * Creates a metadata sample with content information of different kind in a different order
 * than the one created by {@link #createSample1()}.
 */
private static DefaultMetadata createSample2() {
    final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
    final DefaultImageDescription image = new DefaultImageDescription();
    final DefaultMetadata metadata = new DefaultMetadata();
    image.setProcessingLevelCode(new DefaultIdentifier("Level 2"));
    metadata.getContentInfo().add(image);
    features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("GPX file")));
    features.setIncludedWithDataset(Boolean.TRUE);
    metadata.getContentInfo().add(features);
    metadata.getLanguages().add(Locale.FRENCH);
    return metadata;
}
Also used : DefaultImageDescription(org.apache.sis.metadata.iso.content.DefaultImageDescription) DefaultFeatureCatalogueDescription(org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultMetadata(org.apache.sis.metadata.iso.DefaultMetadata) DefaultIdentifier(org.apache.sis.metadata.iso.DefaultIdentifier)

Example 8 with DefaultIdentifier

use of org.apache.sis.metadata.iso.DefaultIdentifier in project sis by apache.

the class MergerTest method createSample1.

/**
 * Creates a metadata sample with 3 content information of different kind.
 */
private static DefaultMetadata createSample1() {
    final DefaultFeatureCatalogueDescription features = new DefaultFeatureCatalogueDescription();
    final DefaultCoverageDescription coverage = new DefaultCoverageDescription();
    final DefaultImageDescription image = new DefaultImageDescription();
    final DefaultMetadata metadata = new DefaultMetadata();
    features.setFeatureCatalogueCitations(Collections.singleton(new DefaultCitation("Shapefile")));
    features.setIncludedWithDataset(Boolean.TRUE);
    metadata.getContentInfo().add(features);
    coverage.setProcessingLevelCode(new DefaultIdentifier("Level 1"));
    metadata.getContentInfo().add(coverage);
    image.setImagingCondition(ImagingCondition.CLOUD);
    image.setCloudCoverPercentage(0.8);
    metadata.getContentInfo().add(image);
    metadata.getLanguages().add(Locale.JAPANESE);
    metadata.getCharacterSets().add(StandardCharsets.UTF_16);
    return metadata;
}
Also used : DefaultImageDescription(org.apache.sis.metadata.iso.content.DefaultImageDescription) DefaultFeatureCatalogueDescription(org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultMetadata(org.apache.sis.metadata.iso.DefaultMetadata) DefaultCoverageDescription(org.apache.sis.metadata.iso.content.DefaultCoverageDescription) DefaultIdentifier(org.apache.sis.metadata.iso.DefaultIdentifier)

Aggregations

DefaultIdentifier (org.apache.sis.metadata.iso.DefaultIdentifier)8 DefaultMetadata (org.apache.sis.metadata.iso.DefaultMetadata)3 DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)3 DefaultFeatureCatalogueDescription (org.apache.sis.metadata.iso.content.DefaultFeatureCatalogueDescription)2 DefaultImageDescription (org.apache.sis.metadata.iso.content.DefaultImageDescription)2 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)2 Test (org.junit.Test)2 Identifier (org.opengis.metadata.Identifier)2 DefaultCitationDate (org.apache.sis.metadata.iso.citation.DefaultCitationDate)1 DefaultConstraints (org.apache.sis.metadata.iso.constraint.DefaultConstraints)1 DefaultCoverageDescription (org.apache.sis.metadata.iso.content.DefaultCoverageDescription)1 DependsOnMethod (org.apache.sis.test.DependsOnMethod)1 IdentifierMap (org.apache.sis.xml.IdentifierMap)1 Metadata (org.opengis.metadata.Metadata)1 ReferenceSystem (org.opengis.referencing.ReferenceSystem)1