001 /*
002 * GeoAPI - Java interfaces for OGC/ISO standards
003 * http://www.geoapi.org
004 *
005 * Copyright (C) 2004-2012 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
040 import static org.opengis.annotation.Obligation.*;
041 import static org.opengis.annotation.Specification.*;
042
043
044 /**
045 * Supplementary identification and remarks information for a CRS or CRS-related object.
046 * When {@link org.opengis.referencing.crs.CRSAuthorityFactory} is used to create an object,
047 * the {@linkplain ReferenceIdentifier#getAuthority authority} and
048 * {@linkplain ReferenceIdentifier#getCode authority code} values shall be set to the
049 * authority name of the factory object, and the authority code supplied by the client,
050 * respectively. The other values may or may not be set. If the authority is EPSG, the
051 * implementer may consider using the corresponding metadata values in the EPSG tables.
052 *
053 * @departure harmonization
054 * ISO 19111 defines an <code>IdentifiedObjectBase</code> interface. The later is omitted in
055 * GeoAPI because the split between <code>IdentifiedObject</code> and <code>IdentifiedObjectBase</code>
056 * in the ISO/OGC specification was a workaround for introducing <code>IdentifiedObject</code>
057 * in ISO 19111 without changing the <code>ReferenceSystem</code> definition in ISO 19115 but
058 * GeoAPI does not need this workaround.
059 *
060 * @author Martin Desruisseaux (IRD)
061 * @version 3.0
062 * @since 2.0
063 *
064 * @navassoc - - - GenericName
065 * @navassoc - - - ReferenceIdentifier
066 */
067 @UML(identifier="IO_IdentifiedObject", specification=ISO_19111)
068 public interface IdentifiedObject {
069 /**
070 * Key for the <code>{@value}</code> property to be given to the
071 * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
072 * This is used for setting the value to be returned by {@link #getName()}.
073 *
074 * @see #getName()
075 */
076 String NAME_KEY = "name";
077
078 /**
079 * Key for the <code>{@value}</code> property to be given to the
080 * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
081 * This is used for setting the value to be returned by {@link #getAlias()}.
082 *
083 * @see #getAlias()
084 */
085 String ALIAS_KEY = "alias";
086
087 /**
088 * Key for the <code>{@value}</code> property to be given to the
089 * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
090 * This is used for setting the value to be returned by {@link #getIdentifiers()}.
091 *
092 * @see #getIdentifiers()
093 */
094 String IDENTIFIERS_KEY = "identifiers";
095
096 /**
097 * Key for the <code>{@value}</code> property to be given to the
098 * {@linkplain ObjectFactory object factory} <code>createFoo(…)</code> methods.
099 * This is used for setting the value to be returned by {@link #getRemarks()}.
100 *
101 * @see #getRemarks()
102 */
103 String REMARKS_KEY = "remarks";
104
105 /**
106 * The primary name by which this object is identified.
107 *
108 * @return The primary name.
109 */
110 @UML(identifier="name", obligation=MANDATORY, specification=ISO_19111)
111 ReferenceIdentifier getName();
112
113 /**
114 * An alternative name by which this object is identified.
115 *
116 * @return The aliases, or an empty collection if there is none.
117 */
118 @UML(identifier="alias", obligation=OPTIONAL, specification=ISO_19111)
119 Collection<GenericName> getAlias();
120
121 /**
122 * An identifier which references elsewhere the object's defining information.
123 * Alternatively an identifier by which this object can be referenced.
124 *
125 * @return This object identifiers, or an empty collection if there is none.
126 */
127 @UML(identifier="identifier", obligation=OPTIONAL, specification=ISO_19111)
128 Set<ReferenceIdentifier> getIdentifiers();
129
130 /**
131 * Comments on or information about this object, including data source information.
132 *
133 * @return The remarks, or {@code null} if none.
134 */
135 @UML(identifier="remarks", obligation=OPTIONAL, specification=ISO_19111)
136 InternationalString getRemarks();
137
138 /**
139 * Returns a <A HREF="doc-files/WKT.html"><cite>Well Known Text</cite> (WKT)</A> for this object.
140 * This operation may fails if an object is too complex for the WKT format capability (for
141 * example an {@linkplain org.opengis.referencing.crs.EngineeringCRS engineering CRS} with
142 * different unit for each axis).
143 *
144 * @return The Well Know Text for this object.
145 * @throws UnsupportedOperationException If this object can't be formatted as WKT.
146 *
147 * @departure extension
148 * This method is not part of the OGC specification. It has been added in order to provide
149 * the converse of the <code>CRSFactory.createFromWKT(String)</code> method, which is
150 * defined in OGC 01-009.
151 */
152 String toWKT() throws UnsupportedOperationException;
153 }