001    /*
002     *    GeoAPI - Java interfaces for OGC/ISO standards
003     *    http://www.geoapi.org
004     *
005     *    Copyright (C) 2004-2013 Open Geospatial Consortium, Inc.
006     *    All Rights Reserved. http://www.opengeospatial.org/ogc/legal
007     *
008     *    Permission to use, copy, and modify this software and its documentation, with
009     *    or without modification, for any purpose and without fee or royalty is hereby
010     *    granted, provided that you include the following on ALL copies of the software
011     *    and documentation or portions thereof, including modifications, that you make:
012     *
013     *    1. The full text of this NOTICE in a location viewable to users of the
014     *       redistributed or derivative work.
015     *    2. Notice of any changes or modifications to the OGC files, including the
016     *       date changes were made.
017     *
018     *    THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE
019     *    NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
020     *    TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT
021     *    THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY
022     *    PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS.
023     *
024     *    COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR
025     *    CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION.
026     *
027     *    The name and trademarks of copyright holders may NOT be used in advertising or
028     *    publicity pertaining to the software without specific, written prior permission.
029     *    Title to copyright in this software and any associated documentation will at all
030     *    times remain with copyright holders.
031     */
032    package org.opengis.referencing;
033    
034    import java.util.Set;
035    import java.util.Collection;
036    import org.opengis.util.GenericName;
037    import org.opengis.util.InternationalString;
038    import org.opengis.annotation.UML;
039    import org.opengis.annotation.Classifier;
040    import org.opengis.annotation.Stereotype;
041    
042    import static org.opengis.annotation.Obligation.*;
043    import static org.opengis.annotation.Specification.*;
044    
045    
046    /**
047     * Supplementary identification and remarks information for a CRS or CRS-related object.
048     * When {@link org.opengis.referencing.crs.CRSAuthorityFactory} is used to create an object,
049     * the {@linkplain ReferenceIdentifier#getAuthority authority} and
050     * {@linkplain ReferenceIdentifier#getCode authority code} values shall be set to the
051     * authority name of the factory object, and the authority code supplied by the client,
052     * respectively. The other values may or may not be set. If the authority is EPSG, the
053     * implementer may consider using the corresponding metadata values in the EPSG tables.
054     *
055     * @departure harmonization
056     *   ISO 19111 defines an <code>IdentifiedObjectBase</code> interface. The later is omitted in
057     *   GeoAPI because the split between <code>IdentifiedObject</code> and <code>IdentifiedObjectBase</code>
058     *   in the ISO/OGC specification was a workaround for introducing <code>IdentifiedObject</code>
059     *   in ISO 19111 without changing the <code>ReferenceSystem</code> definition in ISO 19115 but
060     *   GeoAPI does not need this workaround.
061     *
062     * @author  Martin Desruisseaux (IRD)
063     * @version 3.1
064     * @since   2.0
065     *
066     * @navassoc - - - GenericName
067     * @navassoc - - - ReferenceIdentifier
068     */
069    @Classifier(Stereotype.ABSTRACT)
070    @UML(identifier="IO_IdentifiedObject", specification=ISO_19111)
071    public interface IdentifiedObject {
072        /**
073         * Key for the <code>{@value}</code> property to be given to the
074         * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
075         * This is used for setting the value to be returned by {@link #getName()}.
076         *
077         * @see #getName()
078         */
079        String NAME_KEY = "name";
080    
081        /**
082         * Key for the <code>{@value}</code> property to be given to the
083         * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
084         * This is used for setting the value to be returned by {@link #getAlias()}.
085         *
086         * @see #getAlias()
087         */
088        String ALIAS_KEY = "alias";
089    
090        /**
091         * Key for the <code>{@value}</code> property to be given to the
092         * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
093         * This is used for setting the value to be returned by {@link #getIdentifiers()}.
094         *
095         * @see #getIdentifiers()
096         */
097        String IDENTIFIERS_KEY = "identifiers";
098    
099        /**
100         * Key for the <code>{@value}</code> property to be given to the
101         * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
102         * This is used for setting the value to be returned by {@link #getRemarks()}.
103         *
104         * @see #getRemarks()
105         */
106        String REMARKS_KEY = "remarks";
107    
108        /**
109         * The primary name by which this object is identified.
110         *
111         * @return The primary name.
112         */
113        @UML(identifier="name", obligation=MANDATORY, specification=ISO_19111)
114        ReferenceIdentifier getName();
115    
116        /**
117         * An alternative name by which this object is identified.
118         *
119         * @return The aliases, or an empty collection if there is none.
120         */
121        @UML(identifier="alias", obligation=OPTIONAL, specification=ISO_19111)
122        Collection<GenericName> getAlias();
123    
124        /**
125         * An identifier which references elsewhere the object's defining information.
126         * Alternatively an identifier by which this object can be referenced.
127         *
128         * @return This object identifiers, or an empty collection if there is none.
129         */
130        @UML(identifier="identifier", obligation=OPTIONAL, specification=ISO_19111)
131        Set<ReferenceIdentifier> getIdentifiers();
132    
133        /**
134         * Comments on or information about this object, including data source information.
135         *
136         * @return The remarks, or {@code null} if none.
137         */
138        @UML(identifier="remarks", obligation=OPTIONAL, specification=ISO_19111)
139        InternationalString getRemarks();
140    
141        /**
142         * Returns a <a href="doc-files/WKT.html"><cite>Well Known Text</cite> (WKT)</a> for this object.
143         * This operation may fails if an object is too complex for the WKT format capability (for
144         * example an {@linkplain org.opengis.referencing.crs.EngineeringCRS engineering CRS} with
145         * different unit for each axis).
146         *
147         * @return The Well Know Text for this object.
148         * @throws UnsupportedOperationException If this object can't be formatted as WKT.
149         *
150         * @departure extension
151         *   This method is not part of the OGC specification. It has been added in order to provide
152         *   the converse of the <code>CRSFactory.createFromWKT(String)</code> method, which is
153         *   defined in OGC 01-009.
154         */
155        String toWKT() throws UnsupportedOperationException;
156    }