root / org.gvsig.proj / branches / refactor2018 / org.gvsig.proj / org.gvsig.proj.catalog / org.gvsig.proj.catalog.api / src / main / java / org / gvsig / proj / catalog / CRSDefinition.java @ 817
History | View | Annotate | Download (7.96 KB)
1 | 793 | cmartinez | /**
|
---|---|---|---|
2 | * gvSIG. Desktop Geographic Information System.
|
||
3 | *
|
||
4 | * Copyright (C) 2018 gvSIG Association.
|
||
5 | *
|
||
6 | * This program is free software; you can redistribute it and/or
|
||
7 | * modify it under the terms of the GNU General Public License
|
||
8 | * as published by the Free Software Foundation; either version 2
|
||
9 | * of the License, or (at your option) any later version.
|
||
10 | *
|
||
11 | * This program is distributed in the hope that it will be useful,
|
||
12 | * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||
13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||
14 | * GNU General Public License for more details.
|
||
15 | *
|
||
16 | * You should have received a copy of the GNU General Public License
|
||
17 | * along with this program; if not, write to the Free Software
|
||
18 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
|
||
19 | * MA 02110-1301, USA.
|
||
20 | *
|
||
21 | * For any additional information, do not hesitate to contact us
|
||
22 | * at info AT gvsig.com, or visit our website www.gvsig.com.
|
||
23 | */
|
||
24 | 807 | cmartinez | package org.gvsig.proj.catalog; |
25 | 793 | cmartinez | |
26 | 794 | cmartinez | import java.util.List; |
27 | import java.util.Set; |
||
28 | |||
29 | 805 | cmartinez | import javax.measure.Unit; |
30 | import javax.measure.quantity.Length; |
||
31 | |||
32 | 807 | cmartinez | import org.gvsig.proj.catalog.datum.Datum; |
33 | import org.gvsig.proj.catalog.ref.Extent; |
||
34 | 793 | cmartinez | |
35 | /**
|
||
36 | 794 | cmartinez | * Definition of a Coordinate Reference System (CRS).
|
37 | 793 | cmartinez | *
|
38 | 794 | cmartinez | * A CRS defines how a set of coordinates relate to real positions (on earth, on other
|
39 | * planet or in the space). A CRS defines the number of coordinate axis, its name, order and
|
||
40 | * direction, its units, the mathematical model used to define the geometric figure (ellipsoid)
|
||
41 | * to approximate the shape of the earth, the relationship of this mathematical model with the
|
||
42 | * earth (datum), among other concepts and parameters. Some CRSs include a projection, which
|
||
43 | * defines a mathematical model to approximate the surface of an area of the earth using a
|
||
44 | * planar surface.
|
||
45 | *
|
||
46 | * Note that a set of coordinates is meaningless if their CRS is not defined, as these
|
||
47 | * values can refer to different locations on the Earth depending on the CRS being used.
|
||
48 | *
|
||
49 | 793 | cmartinez | * @author gvSIG Team
|
50 | 794 | cmartinez | * @author Cesar Martinez Izquierdo
|
51 | 793 | cmartinez | */
|
52 | 794 | cmartinez | public interface CRSDefinition { |
53 | |||
54 | 793 | cmartinez | /**
|
55 | 794 | cmartinez | * A common name for this coordinate reference system
|
56 | *
|
||
57 | * @return the name, or {@code null} if none.
|
||
58 | */
|
||
59 | String getName();
|
||
60 | |||
61 | /**
|
||
62 | * Gets a code that references an unambiguous definition of the coordinate reference
|
||
63 | * system for some authority. Examples: "EPSG:4326", "EPSG:25830".
|
||
64 | *
|
||
65 | 805 | cmartinez | * Note that identifiers in the "USER:" namespace are an special case, as their
|
66 | * definition will be different for each user, so they don't reference an
|
||
67 | * unambiguous definition.
|
||
68 | *
|
||
69 | 794 | cmartinez | * @return the identifier which was used to instantiate the object, or the
|
70 | * identifier that more closely matches the information used to instantiate
|
||
71 | * the object (e.g. if derived from an WKT definition)
|
||
72 | */
|
||
73 | String getIdentifier();
|
||
74 | |||
75 | /**
|
||
76 | * Gets the list of identifiers which describe this coordinate reference system
|
||
77 | * definition.
|
||
78 | *
|
||
79 | * @return the list of object identifiers, or an empty collection if there is none.
|
||
80 | */
|
||
81 | Set<String> getIdentifiers(); |
||
82 | 805 | cmartinez | |
83 | /**
|
||
84 | * Gets the authority which defines this coordinate references system
|
||
85 | * (e.g. "EPSG", "ESRI", "USER"...).
|
||
86 | *
|
||
87 | * If the CRS is defined by several
|
||
88 | * authorities, it returns the authority which was used to instantiate
|
||
89 | * the object, or the authority that more closely matches the information
|
||
90 | * used to instantiate the object (e.g. if derived from an WKT definition)
|
||
91 | *
|
||
92 | * @return The authority name
|
||
93 | */
|
||
94 | String getAuthorityName();
|
||
95 | 794 | cmartinez | |
96 | /**
|
||
97 | * FIXME: GeoAPI
|
||
98 | 793 | cmartinez | * Area or region or timeframe in which this (coordinate) reference system is valid.
|
99 | *
|
||
100 | * @return the reference system valid domain, or {@code null} if not available.
|
||
101 | * @since 2.1
|
||
102 | */
|
||
103 | Extent getDomainOfValidity(); |
||
104 | 794 | cmartinez | |
105 | /**
|
||
106 | * Textual description of the coordinate reference system, including remarks
|
||
107 | * and its scope.
|
||
108 | *
|
||
109 | * @return the description, or {@code null} if none.
|
||
110 | */
|
||
111 | String getDescription();
|
||
112 | |||
113 | /**
|
||
114 | * Some CRSs include a projection, which defines a mathematical model to approximate
|
||
115 | * the surface of an area of the earth using a planar surface. CRS including a
|
||
116 | * projection are called projected CRSs
|
||
117 | *
|
||
118 | * @return true if the CRS is projected, false otherwise
|
||
119 | */
|
||
120 | boolean isProjected();
|
||
121 | |||
122 | /**
|
||
123 | * Gets the type of coordinate reference system
|
||
124 | *
|
||
125 | * @return
|
||
126 | */
|
||
127 | CRSType getType(); |
||
128 | |||
129 | /**
|
||
130 | 796 | cmartinez | * Returns a <cite>Well-Known Text</cite> (WKT) definition for this object.
|
131 | * Note that there are different versions of the WKT specification
|
||
132 | * (the older WKT defined by OGC 01-009 and the newer one, defined by OGC 12-063r5
|
||
133 | * and ISO 19162). Also note that ESRI uses different names to refer to CRSs, datums,
|
||
134 | * ellipsoids, etc. compared to OGC, so OGC and ESRI WKTs can be considered as different
|
||
135 | * dialects.
|
||
136 | *
|
||
137 | * Whenever possible, this method will return a WKT following the same specification and
|
||
138 | * dialect that the one used to instantiate this CRSDefinition. If the original
|
||
139 | * specification or dialect are unknown, implementations are encouraged to format according
|
||
140 | * to the most recent standard and following OGC dialect.
|
||
141 | 794 | cmartinez | *
|
142 | 796 | cmartinez | * @return the Well-Known Text (WKT) definition for this object.
|
143 | 794 | cmartinez | * @throws UnsupportedOperationException if this object can not be formatted as WKT.
|
144 | */
|
||
145 | String toWKT() throws UnsupportedOperationException; |
||
146 | 793 | cmartinez | |
147 | 794 | cmartinez | /**
|
148 | 796 | cmartinez | * If the CRS type is {@link CRSType#CompoundCRSType}, this method returns the ordered
|
149 | * list of coordinate reference systems which are its components.
|
||
150 | *
|
||
151 | * @return the ordered list of coordinate reference systems, or <code>null if the CRS
|
||
152 | * is not compound
|
||
153 | * @see #getType()
|
||
154 | * @see CRSType#CompoundCRSType
|
||
155 | */
|
||
156 | 794 | cmartinez | List<CRSDefinition> getComponents();
|
157 | |||
158 | /**
|
||
159 | * Gets the number of axis of the associated CoordinateSystem
|
||
160 | *
|
||
161 | * @return
|
||
162 | */
|
||
163 | int getAxisCount();
|
||
164 | |||
165 | /**
|
||
166 | * Returns the axis for the associated coordinate system at the specified dimension,
|
||
167 | * as officially defined by the authority.
|
||
168 | *
|
||
169 | * @param dimension
|
||
170 | * @return
|
||
171 | * @throws IndexOutOfBoundsException
|
||
172 | */
|
||
173 | CoordinateSystemAxis getAxis(int dimension) throws IndexOutOfBoundsException; |
||
174 | |||
175 | /**
|
||
176 | * Returns the axis for the associated coordinate system at the specified
|
||
177 | * dimension as internally used by gvSIG, which will sometimes differ from
|
||
178 | * the order officially defined by the authority.
|
||
179 | *
|
||
180 | * The internal order is used for convenience and performance. gvSIG geometries
|
||
181 | * and gvSIG coordinate transformations always expect coordinates to be provided
|
||
182 | * using the internal order (xy axis order). However, some
|
||
183 | * protocols or formats require the coordinates to be encoded using the
|
||
184 | * official order.
|
||
185 | *
|
||
186 | * @param dimension
|
||
187 | * @return
|
||
188 | * @throws IndexOutOfBoundsException
|
||
189 | */
|
||
190 | CoordinateSystemAxis getAxisInternal(int dimension) throws IndexOutOfBoundsException; |
||
191 | |||
192 | 793 | cmartinez | /**
|
193 | 794 | cmartinez | * For derived CRSs, it returns the base coordinate reference system.
|
194 | 793 | cmartinez | *
|
195 | 794 | cmartinez | * @return the base coordinate reference system or null if the CRS is not
|
196 | * derived
|
||
197 | * @see CRSType#isDerived()
|
||
198 | * @see CRSType#ProjectedCRSType
|
||
199 | * @see CRSType#OtherDerivedCRSType
|
||
200 | */
|
||
201 | CRSDefinition getBaseCRS(); |
||
202 | |||
203 | /**
|
||
204 | * For derived CRSs, it returns the conversion from the {@linkplain #getBaseCRS() base CRS}
|
||
205 | * to this CRS.
|
||
206 | 793 | cmartinez | *
|
207 | 794 | cmartinez | * @return the conversion from the base CRS or null if the CRS is not derived
|
208 | *
|
||
209 | * @see CRSType#isDerived()
|
||
210 | * @see CRSType#ProjectedCRSType
|
||
211 | * @see CRSType#OtherDerivedCRSType
|
||
212 | 793 | cmartinez | */
|
213 | 794 | cmartinez | TransformationDefinition getConversionFromBase(); |
214 | |||
215 | /**
|
||
216 | * Returns the datum associated directly or indirectly to this CRS.
|
||
217 | * In the case of a derived CRS, this method returns the
|
||
218 | * datum of the {@linkplain #getBaseCRS() base CRS}. In the case of
|
||
219 | * a compound CRS, it returns the datum associated to the horizontal component.
|
||
220 | *
|
||
221 | * @return the datum
|
||
222 | */
|
||
223 | Datum getDatum(); |
||
224 | 793 | cmartinez | } |