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;
}
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;
}
Aggregations