Statistics
| Revision:

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 / CRSCatalogManager.java @ 814

History | View | Annotate | Download (7.67 KB)

1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2012 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
package org.gvsig.proj.catalog;
25

    
26
import java.io.File;
27
import java.util.List;
28

    
29
import org.gvsig.proj.catalog.exception.CRSCatalogException;
30
import org.gvsig.proj.catalog.exception.CoordinateReferenceSystemNotFoundException;
31
import org.gvsig.proj.catalog.exception.IncompatibleDefinitionException;
32

    
33
/**
34
 * This class is responsible of the management of the CRSCatalog
35
 * library's business logic.
36
 * 
37
 * It is the library's main entry point, and provides all the services to manage
38
 * {@link CRSDefinition}s and {@link TransformationDefinition}s.
39
 * 
40
 * @author gvSIG team
41
 * @author Cesar Martinez Izquierdo
42
 */
43
public interface CRSCatalogManager {
44

    
45
        /**
46
         * Returns a List of String values with the available authority names.
47
         * 
48
         * @return the available authority names
49
         */
50
        List<String> getAuthorityNames();
51

    
52
        /**
53
         * Returns a List of String values with the codes available for all the
54
         * available authorities
55
         *
56
         * @return the list of available codes, using the AUTHORITY:CODE format
57
         */
58
        List<String> getCodes();
59

    
60
        /**
61
         * Returns a List of String values with the codes available for a given
62
         * Authority,
63
         * 
64
         * @param authorityName
65
         *            name of the authority to get the codes of
66
         * @return the list of available codes, using the AUTHORITY:CODE format
67
         */
68
        List<String> getCodes(String authorityName);
69
        
70
        /**
71
         * Returns a list of codes that match the provided search string.
72
         * Examples of valid searchString: "4326", "EPSG:4326", "ESRI:4326", etc.
73
         * Depending on the implementation of the catalogue, it may search only
74
         * codes or it may search on several CRS fields (name, description,
75
         * area description, etc)
76
         * 
77
         * @param searchString
78
         * @return
79
         */
80
        List<String> search(String searchString);
81
        
82
        /**
83
         * Returns a list of codes that match the provided search string.
84
         * Examples of valid searchString: "4326", "EPSG:4326", "ESRI:4326", etc.
85
         * Depending on the implementation of the catalog, it may only search for
86
         * codes or it may search on several CRS fields (name, description,
87
         * area description, etc)
88
         * 
89
         * @param searchString
90
         * @return
91
         */
92
        List<String> search(String authority, String searchString);
93
        
94
        /**
95
         * Gets the CRSDefinition for the provided code
96
         * @param code The CRS code (e.g. "EPSG:4326", "ESRI:4326")
97
         * 
98
         * @return
99
         * @throws CoordinateReferenceSystemNotFoundException 
100
         */
101
        CRSDefinition getCRSDefinition(String code) throws CoordinateReferenceSystemNotFoundException;
102
        
103
        
104
        /**
105
         * Parses the provided WKT CRS definition to create a
106
         * CRSDefinition object 
107
         * @param wkt The WKT CRS definition
108
         * 
109
         * @return
110
         * @throws CoordinateReferenceSystemNotFoundException 
111
         */
112
        CRSDefinition getCRSDefinitionFromWKT(String wkt) throws CoordinateReferenceSystemNotFoundException; // anyadir formato
113
        
114
        
115
        /**
116
         * Creates a compound CRS by combining the provided individual
117
         * CRSDefinitions. 
118
         * 
119
         * @param crsList The list of CRSDefinitions to compound
120
         * @return The definition of the compound CRS
121
         * @throws CRSCatalogException 
122
         * 
123
         * @see CRSType#CompoundCRSType
124
         * @see CRSDefinition#getComponents()
125
         * @see CRSDefinition#getType()
126
         */
127
        CRSDefinition getCompoundCRS(CRSDefinition... crsList) throws CRSCatalogException;
128
        
129
        /**
130
         * Gets the TransformationDefinition for the provided code
131
         * @param code The operation code (e.g. "EPSG:1633", "EPSG:1632")
132
         * 
133
         * @return
134
         */
135
        TransformationDefinition getTransformationDefinition(String code);
136
        
137
        /**
138
         * Parses the provided WKT transformation definition to create a
139
         * TransformationDefinition object
140
         * @param wkt The WKT coordinate operation definition
141
         * 
142
         * @return
143
         */
144
        TransformationDefinition getTransformationDefinitionFromWKT(String wkt);
145

    
146
        /**
147
         * Register a user-defined CRS from an WKT definition
148
         * 
149
         * @param wktDefinition The WKT definition of the CRS to register
150
         * @param description A human-readable description of the CRS
151
         * @return The code assigned to the registered CRS on the USER
152
         * namespace
153
         */
154
        String registerCoordinateReferenceSystem(String wktDefinition, String description);
155
        
156
        /**
157
         * Register a user-defined coordinate operation
158
         * 
159
         * @param wktDefinition The WKT definition of the operation to register
160
         * @param description A human-readable description of the CRS
161
         * @return The code assigned to the registered CRS on the USER
162
         * namespace
163
         */
164
        String registerTransformation(String wktDefinition, String description);
165
        
166
        /**
167
         * Register a user-defined coordinate transformation using the Position
168
         * Vector Transformation method
169
         * 
170
         * @param definition The WKT definition of the operation to register
171
         * @return The code assigned to the registered CRS on the USER
172
         * namespace
173
         * @see #registerCoordinateTransformationCFR(String, String, String, float, float, float, float, float, float, float)
174
         */
175
        String registerCoordinateTransformationPVT(String sourceCRS, String targetCRS,
176
                        String description,
177
                        float xTraslation, float yTraslation, float zTraslation,
178
                        float xRotation, float yRotation, float zRotation,
179
                        float scaleDifference);
180

    
181
        /**
182
         * Register a user-defined coordinate transformation using the Coordinate
183
         * Frame Rotation method
184
         * 
185
         * @param definition The WKT definition of the operation to register
186
         * @return The code assigned to the registered CRS on the USER
187
         * namespace
188
         * @see #registerCoordinateTransformationPVT(String, String, String, float, float, float, float, float, float, float)
189
         */
190
        String registerCoordinateTransformationCFR(String sourceCRS, String targetCRS,
191
                        String description,
192
                        float xTraslation, float yTraslation, float zTraslation,
193
                        float xRotation, float yRotation, float zRotation,
194
                        float scaleDifference);
195
        
196
        /**
197
         * Register a user-defined coordinate transformation using a
198
         * transformation grid in NTv2 format
199
         * 
200
         * @param definition The WKT definition of the operation to register
201
         * @return The code assigned to the registered CRS on the USER
202
         * namespace
203
         */
204
        String registerCoordinateTransformation(String sourceCRS, String targetCRS,
205
                        String description, File ntv2Grid);
206
        
207
        
208
        /**
209
         * Gets the list of available TransformationDefinition to transform or
210
         * convert coordinates from the source CoordinateReferenceSystem to
211
         * the target one. 
212
         * @param source
213
         * @param target
214
         * @return
215
         * @throws CRSCatalogException 
216
         */
217
        List<TransformationDefinition> getCoordinateTransformations(CRSDefinition source, CRSDefinition target) throws CRSCatalogException;
218

    
219
        /**
220
         * Gets the list of available TransformationDefinition to transform or
221
         * convert coordinates from the source CoordinateReferenceSystem to
222
         * the target one.
223
         * 
224
         * @param source The code of the source CRS (e.g. "ESPG:25830")
225
         * @param target The code of the target CRS (e.g. "ESPG:4230")
226
         * @return
227
         */
228
        List<TransformationDefinition> getCoordinateTransformations(String source, String target) throws CRSCatalogException;
229
}