Revision 832 org.gvsig.proj/branches/refactor2018/org.gvsig.proj/org.gvsig.proj.lib/org.gvsig.proj.lib.api/src/main/java/org/gvsig/proj/CoordinateReferenceSystemManager.java

View differences:

CoordinateReferenceSystemManager.java
27 27

  
28 28
import org.gvsig.proj.catalog.CRSCatalogManager;
29 29
import org.gvsig.proj.catalog.CRSDefinition;
30
import org.gvsig.proj.catalog.TextSerialization;
31 30
import org.gvsig.proj.catalog.TransformationDefinition;
32
import org.gvsig.proj.catalog.exception.UnsupportedTransformationException;
33 31
import org.gvsig.proj.catalog.exception.CoordinateReferenceSystemException;
34 32
import org.gvsig.proj.catalog.exception.UnsupportedCoordinateReferenceSystemException;
35
import org.gvsig.proj.catalog.exception.UnsupportedFormatException;
33
import org.gvsig.proj.catalog.exception.UnsupportedTransformationException;
36 34

  
37 35
/**
38 36
 * This class is responsible of the management of the CoordinateReferenceSystem
......
45 43
 */
46 44
public interface CoordinateReferenceSystemManager {
47 45
	/**
48
	 * Parses the provided CRS definition to create a {@link CoordinateReferenceSystem} object
49
	 *  
50
	 * @param def A string containing the definition to parse (e.g. a WKT
51
	 * CRS definition, a GML CRS definition, etc)
52
	 * @return A {@link CoordinateReferenceSystem} object
53
	 * @throws CoordinateReferenceSystemException if the reference system is not supported by
54
	 * this implementation
55
	 * @throws ParseException if the provided definition can't be parsed (for instance because it is not
56
	 * a valid document in any of the supported formats)
57
	 */
58
	CoordinateReferenceSystem parseCoordinateReferenceSystem(String def)
59
			throws UnsupportedCoordinateReferenceSystemException, ParseException;
60
	
61
	/**
62
	 * Parses the provided CRS definition to create a {@link CoordinateReferenceSystem} object
63
	 * 
64
	 * @param def A string containing the definition to parse (e.g. a WKT
65
	 * definition, a GML definition, etc)
66
	 * @param format The format of the definition to parse
67
	 * @return A {@link CoordinateReferenceSystem} object
68
	 * @throws UnsupportedCoordinateReferenceSystemException if the reference system is not supported by
69
	 * this implementation
70
	 * @throws ParseException if the provided string can't be parsed, for instance if the format is
71
	 * not supported or if the string is not valid
72
	 */
73
	CoordinateReferenceSystem parseCoordinateReferenceSystem(String def, TextSerialization.Format format)
74
			throws UnsupportedCoordinateReferenceSystemException, ParseException, UnsupportedFormatException;
75

  
76
	/**
77 46
	 * Returns a Coordinate Reference System.
78 47
	 * 
79 48
	 * @param definition
......
84 53
	CoordinateReferenceSystem getCoordinateReferenceSystem(
85 54
		CRSDefinition definition)
86 55
			throws UnsupportedCoordinateReferenceSystemException, ParseException;
87

  
88
	/**
89
	 * Parses the provided transformation definition to create a {@link CoordinateTransformation} object.
90
	 * Note that some {@link TextSerialization.Format formats} don't encode the source and target CRSs, so
91
	 * this method will fail for these formats. Use {@link #parseTransformationDefinition(String, String, String)
92
	 * or #parseTransformationDefinition(String, String, String, org.gvsig.proj.catalog.TextSerialization.Format)
93
	 * instead.
94
	 *  
95
	 * @param def A string containing the definition to parse (e.g. a WKT
96
	 * definition, a GML definition, etc)
97
	 * @return A {@link CoordinateTransformation} object
98
	 * @throws UnsupportedTransformationException if the transformation is not supported by
99
	 * this implementation
100
	 * @throws ParseException if the provided string can't be parsed (for instance because it is not
101
	 * a valid document in any of the supported formats)
102
	 * @throws CoordinateReferenceSystemException if the format does not provide enough information to
103
	 * construct the CRS. Use {@link #parseTransformationDefinition(String, String, String)} instead
104
	 */
105
	CoordinateTransformation parseCoordinateTransformation(String def)
106
			throws UnsupportedTransformationException, ParseException, CoordinateReferenceSystemException;
107 56
	
108 57
	/**
109
	 * Parses the provided transformation definition to create a {@link CoordinateTransformation} object.
110
	 * This method also requires the source and target CRSs of the operation, since some serialization
111
	 * formats don't encode this information (e.g. {@link TextSerialization.Format#WKT1} only encodes
112
	 * the math transform). 
113
	 *  
114
	 * @param def A string containing the definition to parse (e.g. a WKT
115
	 * definition, a GML definition, etc)
116
	 * @param sourceCRS the source CRS for this operation, encoded as a {@link CRSDefinition#getIdentifier() identifier}
117
	 * or as a WKT CRS string.
118
	 * @param targetCRS the target CRS for this operation, encoded as a {@link CRSDefinition#getIdentifier() identifier}
119
	 * or as a WKT CRS string.
120
	 * @return A {@link CoordinateTransformation} object
121
	 * @throws UnsupportedTransformationException if the transformation is not supported by
122
	 * this implementation
123
	 * @throws ParseException if the provided string can't be parsed (for instance because it is not
124
	 * a valid document in any of the supported formats)
125
	 */
126
	CoordinateTransformation parseCoordinateTransformation(String def, String sourceCRS, String targetCRS)
127
			throws UnsupportedTransformationException, ParseException;
128
	
129
	/**
130
	 * Parses the provided CRS definition to create a {@link TransformationDefinition} object.
131
	 * Note that some {@link TextSerialization.Format formats} don't encode the source and target CRSs, so
132
	 * this method will fail for these formats. Use {@link #parseTransformationDefinition(String, String, String)
133
	 * or #parseTransformationDefinition(String, String, String, org.gvsig.proj.catalog.TextSerialization.Format)
134
	 * instead.
135
	 * 
136
	 * @param def A string containing the definition to parse (e.g. a WKT
137
	 * definition, a GML definition, etc)
138
	 * @param format The format of the definition to parse
139
	 * @return A {@link TransformationDefinition} object
140
	 * @throws UnsupportedTransformationException if the transformation is not supported by
141
	 * this implementation
142
	 * @throws ParseException if the provided string can't be parsed, for instance if the format is
143
	 * not supported or if the string is not valid
144
	 * @throws UnsupportedFormatException if the format is not supported
145
	 * @throws CoordinateReferenceSystemException if the format does not provide enough information to
146
	 * construct the CRS.
147
	 * Use {@link #parseCoordinateTransformation(String, String, String, org.gvsig.proj.catalog.TextSerialization.Format)} instead
148
	 */
149
	CoordinateTransformation parseCoordinateTransformation(String def, TextSerialization.Format format)
150
			throws UnsupportedTransformationException, ParseException, UnsupportedFormatException, CoordinateReferenceSystemException;
151
	
152
	/**
153
	 * Parses the provided CRS definition to create a {@link TransformationDefinition} object.
154
	 * This method also requires the source and target CRSs of the operation, since some serialization
155
	 * formats don't encode this information (e.g. {@link TextSerialization.Format#WKT1} only encodes
156
	 * the math transform). 
157
	 * 
158
	 * @param def A string containing the definition to parse (e.g. a WKT
159
	 * definition, a GML definition, etc)
160
	 * @param sourceCRS the source CRS for this operation, encoded as a {@link CRSDefinition#getIdentifier() identifier}
161
	 * or as a WKT CRS string.
162
	 * @param targetCRS the target CRS for this operation, encoded as a {@link CRSDefinition#getIdentifier() identifier}
163
	 * or as a WKT CRS string.
164
	 * @param format The format of the definition to parse
165
	 * @return A {@link TransformationDefinition} object
166
	 * @throws UnsupportedTransformationException if the transformation is not supported by
167
	 * this implementation
168
	 * @throws ParseException if the provided string can't be parsed, for instance if the format is
169
	 * not supported or if the string is not valid
170
	 * @throws UnsupportedFormatException if the format is not supported
171
	 */
172
	CoordinateTransformation parseCoordinateTransformation(String def, String sourceCRS, String targetCRS, TextSerialization.Format format)
173
			throws UnsupportedTransformationException, ParseException, UnsupportedFormatException;
174
	
175
	/**
176 58
	 * Returns a Coordinate Transformation
177 59
	 * 
178 60
	 * @param definition

Also available in: Unified diff