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 / TransformationDefinition.java @ 852
History | View | Annotate | Download (8.23 KB)
1 | 794 | 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 | 794 | cmartinez | |
26 | import java.util.Set; |
||
27 | |||
28 | 807 | cmartinez | import org.gvsig.proj.catalog.exception.NoninvertibleTransformException; |
29 | 829 | cmartinez | import org.gvsig.proj.catalog.exception.UnsupportedFormatException; |
30 | import org.gvsig.proj.catalog.exception.UnsupportedTransformationException; |
||
31 | 852 | cmartinez | import org.gvsig.proj.catalog.extent.Extent; |
32 | 794 | cmartinez | |
33 | /**
|
||
34 | * Definition of a coordinate operation, a mathematical operation on coordinates that
|
||
35 | * calculates the equivalent coordinates on a different coordinate reference system.
|
||
36 | *
|
||
37 | * Despite its name, this interface describes transformations (a particular kind of
|
||
38 | * operation which requires empirically derived parameters, for instance a datum
|
||
39 | * change) and also other kinds of operations: concatenated operations, projection
|
||
40 | * operations, etc.
|
||
41 | *
|
||
42 | * @author Cesar Martinez Izquierdo
|
||
43 | * @author gvSIG Team
|
||
44 | */
|
||
45 | public interface TransformationDefinition { |
||
46 | /**
|
||
47 | 817 | cmartinez | * Returns the definition of the source CRS
|
48 | 794 | cmartinez | *
|
49 | 817 | cmartinez | * @return the definition of the source CRS, or {@code null} if not available.
|
50 | 794 | cmartinez | */
|
51 | 817 | cmartinez | CRSDefinition getSourceDefinition(); |
52 | 794 | cmartinez | |
53 | /**
|
||
54 | 817 | cmartinez | * Returns the definition of the target CRS
|
55 | 794 | cmartinez | *
|
56 | 817 | cmartinez | * @return the definition of the target CRS, or {@code null} if not available.
|
57 | 794 | cmartinez | */
|
58 | 817 | cmartinez | CRSDefinition getTargetDefinition(); |
59 | 794 | cmartinez | |
60 | /**
|
||
61 | * A common name for this coordinate operation
|
||
62 | *
|
||
63 | 838 | cmartinez | * @return The human-readable name of the operation. This method should never return null
|
64 | 794 | cmartinez | */
|
65 | String getName();
|
||
66 | |||
67 | /**
|
||
68 | * Gets a code that references an unambiguous definition of this coordinate operation
|
||
69 | * for some authority. Examples: "EPSG:1633", "EPSG:1632".
|
||
70 | *
|
||
71 | * @return the identifier which was used to instantiate the object, or the
|
||
72 | * identifier that more closely matches the information used to instantiate
|
||
73 | 838 | cmartinez | * the object (e.g. if derived from an WKT definition), or <code>null</code> if an identifier is
|
74 | * not available
|
||
75 | 794 | cmartinez | */
|
76 | String getIdentifier();
|
||
77 | |||
78 | /**
|
||
79 | * Gets the list of identifiers which describe this coordinate reference system
|
||
80 | * definition.
|
||
81 | *
|
||
82 | * @return the list of object identifiers, or an empty collection if there is none.
|
||
83 | */
|
||
84 | Set<String> getIdentifiers(); |
||
85 | 805 | cmartinez | |
86 | /**
|
||
87 | * Gets the authority which defines this coordinate operation
|
||
88 | * (e.g. "EPSG", "ESRI", "USER"...).
|
||
89 | *
|
||
90 | * If this transformation is defined by several
|
||
91 | * authorities, it returns the authority which was used to instantiate
|
||
92 | * the object, or the authority that more closely matches the information
|
||
93 | * used to instantiate the object (e.g. if derived from an WKT definition)
|
||
94 | *
|
||
95 | 838 | cmartinez | * @return The authority name, or {@code null} if not available.
|
96 | 805 | cmartinez | */
|
97 | String getAuthorityName();
|
||
98 | 794 | cmartinez | |
99 | /**
|
||
100 | * Version of the coordinate transformation (i.e., instantiation due to the stochastic
|
||
101 | * nature of the parameters). Mandatory when describing a transformation, and should not
|
||
102 | * be supplied for a conversion.
|
||
103 | *
|
||
104 | 838 | cmartinez | * @return the coordinate operation version, or {@code null} if none.
|
105 | 794 | cmartinez | */
|
106 | String getOperationVersion();
|
||
107 | |||
108 | /**
|
||
109 | * Area or region or timeframe in which this coordinate operation is valid.
|
||
110 | *
|
||
111 | * @return the coordinate operation valid domain, or {@code null} if not available.
|
||
112 | */
|
||
113 | Extent getDomainOfValidity(); |
||
114 | |||
115 | /**
|
||
116 | * Textual description of the coordinate reference system, including remarks
|
||
117 | * and its scope.
|
||
118 | *
|
||
119 | * @return the description, or {@code null} if none.
|
||
120 | */
|
||
121 | String getDescription();
|
||
122 | |||
123 | /**
|
||
124 | 817 | cmartinez | * Gets the definition of the inverse of this coordinate operation.
|
125 | 794 | cmartinez | *
|
126 | * @throws NoninvertibleTransformException if the inverse of this operation
|
||
127 | * is not defined
|
||
128 | 829 | cmartinez | * @throws UnsupportedTransformationException
|
129 | 794 | cmartinez | */
|
130 | 829 | cmartinez | TransformationDefinition getInverseDefinition() throws NoninvertibleTransformException, UnsupportedTransformationException; |
131 | 823 | cmartinez | |
132 | 796 | cmartinez | /**
|
133 | * Returns a <cite>Well-Known Text</cite> (WKT) definition for this object.
|
||
134 | * Note that there are different versions of the WKT specification
|
||
135 | * (the older WKT defined by OGC 01-009 and the newer one, defined by OGC 12-063r5
|
||
136 | * and ISO 19162). Also note that ESRI uses different names to refer to CRSs, datums,
|
||
137 | * ellipsoids, etc. compared to OGC, so OGC and ESRI WKTs can be considered as different
|
||
138 | 823 | cmartinez | * dialects. Use
|
139 | * {@link #toString(org.gvsig.proj.catalog.TextSerialization.WKTConvention, int)}
|
||
140 | * if a particular format and/or convention is required.
|
||
141 | 796 | cmartinez | *
|
142 | * Whenever possible, this method will return a WKT following the same specification and
|
||
143 | * dialect that the one used to instantiate this CRSDefinition. If the original
|
||
144 | * specification or dialect are unknown, implementations are encouraged to format according
|
||
145 | * to the most recent standard and following OGC dialect.
|
||
146 | *
|
||
147 | * @return the Well-Known Text (WKT) definition for this object.
|
||
148 | * @throws UnsupportedOperationException if this object can not be formatted as WKT.
|
||
149 | 823 | cmartinez | * @see #toString(org.gvsig.proj.catalog.TextSerialization.WKTConvention, int)
|
150 | 796 | cmartinez | */
|
151 | String toWKT() throws UnsupportedOperationException; |
||
152 | 823 | cmartinez | |
153 | /**
|
||
154 | * Returns a text serialization of this definition (such as a WKT string), using the
|
||
155 | * specified {@link TextSerialization.Format} and trying to convert names to the
|
||
156 | * specified {@link TextSerialization.WKTConvention}.
|
||
157 | *
|
||
158 | * @param format The {@link TextSerialization.Format} used to serialize this definition.
|
||
159 | * This method must fail if the requested format is not supported by a particular
|
||
160 | * implementation
|
||
161 | *
|
||
162 | * @return A serialized version of this definition.
|
||
163 | * @throws UnsupportedOperationException if the requested format is not supported
|
||
164 | * or if this is object can not be formatted using that format.
|
||
165 | 829 | cmartinez | * @throws UnsupportedFormatException
|
166 | 823 | cmartinez | * @see #toString(org.gvsig.proj.catalog.TextSerialization.WKTConvention, int)
|
167 | */
|
||
168 | 829 | cmartinez | String toString(TextSerialization.Format format) throws UnsupportedOperationException, UnsupportedFormatException; |
169 | 823 | cmartinez | |
170 | /**
|
||
171 | * Returns a text serialization of this definition (such as a WKT string), using the
|
||
172 | * specified {@link TextSerialization.Format} and trying to convert names to the
|
||
173 | * specified {@link TextSerialization.WKTConvention}.
|
||
174 | *
|
||
175 | * @param format The {@link TextSerialization.Format} used to serialize this definition.
|
||
176 | * This method must fail if the requested format is not supported by a particular
|
||
177 | * implementation
|
||
178 | * @param convention The preferred {@link TextSerialization.WKTConvention} used to
|
||
179 | * encode projection names, datum names, units, etc. This is only a hint,
|
||
180 | * implementations can ignore this hint if they are not able to convert this object
|
||
181 | * to the requested convention.
|
||
182 | * @param indentation The amount of spaces to use in indentation. Use 0 to produce
|
||
183 | * a single line serialization.
|
||
184 | *
|
||
185 | * @return A serialized version of this definition.
|
||
186 | * @throws UnsupportedOperationException if the requested format is not supported
|
||
187 | * or if this is object can not be formatted using that format.
|
||
188 | 829 | cmartinez | * @throws UnsupportedFormatException
|
189 | 823 | cmartinez | * @see #toString(org.gvsig.proj.catalog.TextSerialization.WKTConvention)
|
190 | */
|
||
191 | 829 | cmartinez | String toString(TextSerialization.Format format, TextSerialization.WKTConvention convention, int indentation) throws UnsupportedOperationException, UnsupportedFormatException; |
192 | 823 | cmartinez | |
193 | 794 | cmartinez | } |