use of org.opengis.metadata.citation.Citation in project sis by apache.
the class CommonAuthorityFactoryTest method testAuthority.
/**
* Checks the value returned by {@link CommonAuthorityFactory#getAuthority()}.
*/
@Test
public void testAuthority() {
final Citation authority = factory.getAuthority();
assertTrue(Citations.identifierMatches(authority, "WMS"));
assertFalse(Citations.identifierMatches(authority, "OGP"));
assertFalse(Citations.identifierMatches(authority, "EPSG"));
assertEquals(Constants.OGC, Citations.getCodeSpace(authority));
}
use of org.opengis.metadata.citation.Citation in project sis by apache.
the class DefaultAggregateInformation method setAggregateDataSetIdentifier.
/**
* Sets the identification information about aggregate dataset.
*
* @param newValue the new identifier.
*
* @deprecated As of ISO 19115:2014, replaced by an identifier of {@link #getAggregateDataSetName()}.
*/
@Deprecated
public void setAggregateDataSetIdentifier(final Identifier newValue) {
checkWritePermission();
Citation name = getAggregateDataSetName();
if (newValue != null) {
if (!(name instanceof DefaultCitation)) {
name = new DefaultCitation(name);
setAggregateDataSetName(name);
}
/*
* If there is more than one value, replace only the first one and keep all other ones unchanged.
* The intent is to be consistent with the getter method, which returns the first element.
*/
final ArrayList<Identifier> identifiers = new ArrayList<>(name.getIdentifiers());
if (identifiers.isEmpty()) {
identifiers.add(newValue);
} else {
identifiers.set(0, newValue);
}
((DefaultCitation) name).setIdentifiers(identifiers);
} else if (name != null) {
final Iterator<? extends Identifier> it = name.getIdentifiers().iterator();
if (it.hasNext()) {
it.next();
it.remove();
}
}
}
use of org.opengis.metadata.citation.Citation in project sis by apache.
the class Proj4Factory method getAuthority.
/**
* Returns the project that defines the codes recognized by this factory.
* The authority determines the {@linkplain #getCodeSpaces() code space}.
*
* @return {@link Citations#PROJ4}.
*/
@Override
public Citation getAuthority() {
Citation c = authority;
if (c == null) {
c = Citations.PROJ4;
final String release = Proj4.version();
if (release != null) {
final DefaultCitation df = new DefaultCitation(c);
df.setEdition(new SimpleInternationalString(release));
df.freeze();
c = df;
}
authority = c;
}
return c;
}
Aggregations