Search in sources :

Example 16 with ImmutableIdentifier

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

the class Proj4Factory method identifier.

/**
 * Returns the identifier for the given code in {@literal Proj.4} namespace.
 */
private Map<String, Object> identifier(final String code) {
    Identifier id = identifiers.computeIfAbsent(code, (k) -> {
        short i18n = 0;
        if (k.equalsIgnoreCase(UNNAMED))
            i18n = Vocabulary.Keys.Unnamed;
        if (k.equalsIgnoreCase("Unknown"))
            i18n = Vocabulary.Keys.Unknown;
        return new ImmutableIdentifier(Citations.PROJ4, Constants.PROJ4, k, null, (i18n != 0) ? Vocabulary.formatInternational(i18n) : null);
    });
    final Map<String, Object> properties = new HashMap<>(defaultProperties);
    properties.put(IdentifiedObject.NAME_KEY, id);
    return properties;
}
Also used : ImmutableIdentifier(org.apache.sis.metadata.iso.ImmutableIdentifier) Identifier(org.opengis.metadata.Identifier) WeakValueHashMap(org.apache.sis.util.collection.WeakValueHashMap) HashMap(java.util.HashMap) IdentifiedObject(org.opengis.referencing.IdentifiedObject) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) ImmutableIdentifier(org.apache.sis.metadata.iso.ImmutableIdentifier)

Example 17 with ImmutableIdentifier

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

the class DirectReferenceSystemTest method createMetadata.

/**
 * Creates the metadata object to be tested.
 *
 * @param  legacy  {@code true} for using the legacy {@code ResponsibleParty} instead of {@code Responsibility}.
 *                 This is sometime needed for comparison purpose with unmarshalled metadata.
 */
@SuppressWarnings("deprecation")
private static DefaultMetadata createMetadata(final boolean legacy) {
    final DefaultMetadata metadata = new DefaultMetadata();
    final DefaultCitation citation = new DefaultCitation("EPSG Geodetic Parameter Dataset");
    Collection<ResponsibleParty> r = HardCodedCitations.EPSG.getCitedResponsibleParties();
    if (legacy) {
        r = singleton(new DefaultResponsibleParty(TestUtilities.getSingleton(r)));
    }
    citation.setCitedResponsibleParties(r);
    final DirectReferenceSystem refSys = new DirectReferenceSystem(new ImmutableIdentifier(citation, null, "4326"));
    metadata.setReferenceSystemInfo(singleton(refSys));
    return metadata;
}
Also used : DefaultResponsibleParty(org.apache.sis.metadata.iso.citation.DefaultResponsibleParty) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) DefaultMetadata(org.apache.sis.metadata.iso.DefaultMetadata) ResponsibleParty(org.opengis.metadata.citation.ResponsibleParty) DefaultResponsibleParty(org.apache.sis.metadata.iso.citation.DefaultResponsibleParty) ImmutableIdentifier(org.apache.sis.metadata.iso.ImmutableIdentifier)

Aggregations

ImmutableIdentifier (org.apache.sis.metadata.iso.ImmutableIdentifier)17 Test (org.junit.Test)8 ReferenceIdentifier (org.opengis.referencing.ReferenceIdentifier)7 DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)6 HashMap (java.util.HashMap)5 DependsOnMethod (org.apache.sis.test.DependsOnMethod)5 Identifier (org.opengis.metadata.Identifier)5 Date (java.util.Date)3 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)3 InternationalString (org.opengis.util.InternationalString)3 ResultSet (java.sql.ResultSet)2 SimpleCitation (org.apache.sis.internal.simple.SimpleCitation)2 DefaultResponsibleParty (org.apache.sis.metadata.iso.citation.DefaultResponsibleParty)2 DefaultExtent (org.apache.sis.metadata.iso.extent.DefaultExtent)2 DefaultGeographicBoundingBox (org.apache.sis.metadata.iso.extent.DefaultGeographicBoundingBox)2 DefaultTemporalExtent (org.apache.sis.metadata.iso.extent.DefaultTemporalExtent)2 Citation (org.opengis.metadata.citation.Citation)2 ResponsibleParty (org.opengis.metadata.citation.ResponsibleParty)2 IdentifiedObject (org.opengis.referencing.IdentifiedObject)2 URI (java.net.URI)1