Search in sources :

Example 41 with Citation

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));
}
Also used : Citation(org.opengis.metadata.citation.Citation) Test(org.junit.Test)

Example 42 with Citation

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();
        }
    }
}
Also used : Identifier(org.opengis.metadata.Identifier) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) ArrayList(java.util.ArrayList) Iterator(java.util.Iterator) Citation(org.opengis.metadata.citation.Citation) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation)

Example 43 with Citation

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;
}
Also used : DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString) Citation(org.opengis.metadata.citation.Citation) DefaultCitation(org.apache.sis.metadata.iso.citation.DefaultCitation) SimpleInternationalString(org.apache.sis.util.iso.SimpleInternationalString)

Aggregations

Citation (org.opengis.metadata.citation.Citation)43 Test (org.junit.Test)17 DefaultCitation (org.apache.sis.metadata.iso.citation.DefaultCitation)12 InternationalString (org.opengis.util.InternationalString)11 Identifier (org.opengis.metadata.Identifier)10 SimpleInternationalString (org.apache.sis.util.iso.SimpleInternationalString)7 Series (org.opengis.metadata.citation.Series)6 DependsOnMethod (org.apache.sis.test.DependsOnMethod)5 ArrayList (java.util.ArrayList)4 NamedIdentifier (org.apache.sis.referencing.NamedIdentifier)4 ReferenceIdentifier (org.opengis.referencing.ReferenceIdentifier)4 ResponsibleParty (org.opengis.metadata.citation.ResponsibleParty)3 CI_Citation (org.apache.sis.internal.jaxb.metadata.CI_Citation)2 FormattableObject (org.apache.sis.io.wkt.FormattableObject)2 ImmutableIdentifier (org.apache.sis.metadata.iso.ImmutableIdentifier)2 DefaultInternationalString (org.apache.sis.util.iso.DefaultInternationalString)2 OnlineResource (org.opengis.metadata.citation.OnlineResource)2 NoSuchAuthorityCodeException (org.opengis.referencing.NoSuchAuthorityCodeException)2 VendorOptionVersion (com.sldeditor.common.vendoroption.VendorOptionVersion)1 ValueComboBoxData (com.sldeditor.ui.widgets.ValueComboBoxData)1