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 / catalogue / CRSCatalogueManager.java @ 793

History | View | Annotate | Download (7.13 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.catalogue;
25

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

    
29
import org.gvsig.tools.dynobject.DynObject;
30

    
31
/**
32
 * This class is responsible of the management of the CoordinateReferenceSystem
33
 * library's business logic.
34
 * It is the library's main entry point, and provides all the services to manage
35
 * {@link CoordinateReferenceSystem}s.
36
 * 
37
 * @author gvSIG team
38
 * @version $Id$
39
 */
40
public interface CRSCatalogueManager {
41

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

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

    
57
        /**
58
         * Returns a List of String values with the codes available for a given
59
         * Authority,
60
         * 
61
         * @param authorityName
62
         *            name of the authority to get the codes of
63
         * @return the list of available codes, using the AUTHORITY:CODE format
64
         */
65
        List<String> getCodes(String authorityName);
66
        
67
        /**
68
         * Returns a list of codes that match the provided search string.
69
         * Examples of valid searchString: "4326", "EPSG:4326", "ESRI:4326", etc.
70
         * Depending on the implementation of the catalogue, it may search only
71
         * codes or it may search on several CRS fields (name, description,
72
         * area description, etc)
73
         * 
74
         * @param searchString
75
         * @return
76
         */
77
        List<String> search(String searchString);
78
        
79
        /**
80
         * Returns a list of codes that match the provided search string.
81
         * Examples of valid searchString: "4326", "EPSG:4326", "ESRI:4326", etc.
82
         * Depending on the implementation of the catalog, it may only search for
83
         * codes or it may search on several CRS fields (name, description,
84
         * area description, etc)
85
         * 
86
         * @param searchString
87
         * @return
88
         */
89
        List<String> search(String authority, String searchString);
90
        
91
        /**
92
         * Gets the CRSDefinition for the provided code
93
         * @param code The CRS code (e.g. "EPSG:4326", "ESRI:4326")
94
         * 
95
         * @return
96
         */
97
        CRSDefinition getCRSDefinition(String code);
98
        
99
        
100
        /**
101
         * Parses the provided WKT CRS definition to create a
102
         * CRSDefinition object 
103
         * @param wkt The WKT CRS definition
104
         * 
105
         * @return
106
         */
107
        CRSDefinition getCRSDefinitionFromWKT(String wkt);
108
        
109
        /**
110
         * Gets the CoordinateOperationDefinition for the provided code
111
         * @param code The operation code (e.g. "EPSG:1633", "EPSG:1632")
112
         * 
113
         * @return
114
         */
115
        CoordinateOperationDefinition getCSDefinition(String code);
116

    
117
        /**
118
         * Register a user-defined CRS.
119
         * 
120
         * @param crs an instance of the CRS to register
121
         * @param description A human-readable description of the CRS
122
         * @return The code assigned to the registered CRS on the USER
123
         * namespace
124
         */
125
/*        String registerCoordinateReferenceSystem(CoordinateReferenceSystem crs, String description);
126
*/
127
        /**
128
         * Register a user-defined CRS from an WKT definition
129
         * 
130
         * @param wktDefinition The WKT definition of the CRS to register
131
         * @param description A human-readable description of the CRS
132
         * @return The code assigned to the registered CRS on the USER
133
         * namespace
134
         */
135
        String registerCoordinateReferenceSystem(String wktDefinition, String description);
136
        
137
        /**
138
         * Register a user-defined coordinate operation
139
         * 
140
         * @param wktDefinition The WKT definition of the operation to register
141
         * @param description A human-readable description of the CRS
142
         * @return The code assigned to the registered CRS on the USER
143
         * namespace
144
         */
145
        String registerCoordinateOperation(String wktDefinition, String description);
146
        
147
        /**
148
         * Register a user-defined coordinate transformation using the Position
149
         * Vector Transformation method
150
         * 
151
         * @param definition The WKT definition of the operation to register
152
         * @return The code assigned to the registered CRS on the USER
153
         * namespace
154
         * @see #registerCoordinateTransformationCFR(String, String, String, float, float, float, float, float, float, float)
155
         */
156
        String registerCoordinateTransformationPVT(String sourceCRS, String targetCRS,
157
                        String description,
158
                        float xTraslation, float yTraslation, float zTraslation,
159
                        float xRotation, float yRotation, float zRotation,
160
                        float scaleDifference);
161

    
162
        /**
163
         * Register a user-defined coordinate transformation using the Coordinate
164
         * Frame Rotation method
165
         * 
166
         * @param definition The WKT definition of the operation to register
167
         * @return The code assigned to the registered CRS on the USER
168
         * namespace
169
         * @see #registerCoordinateTransformationPVT(String, String, String, float, float, float, float, float, float, float)
170
         */
171
        String registerCoordinateTransformationCFR(String sourceCRS, String targetCRS,
172
                        String description,
173
                        float xTraslation, float yTraslation, float zTraslation,
174
                        float xRotation, float yRotation, float zRotation,
175
                        float scaleDifference);
176
        
177
        /**
178
         * Register a user-defined coordinate transformation using a
179
         * transformation grid in NTv2 format
180
         * 
181
         * @param definition The WKT definition of the operation to register
182
         * @return The code assigned to the registered CRS on the USER
183
         * namespace
184
         */
185
        String registerCoordinateTransformation(String sourceCRS, String targetCRS,
186
                        String description, File ntv2Grid);
187
        
188
        
189
        /**
190
         * Gets the list of available CoordinatesOperations to transform or
191
         * convert coordinates from the source CoordinateReferenceSystem to
192
         * the target one. 
193
         * @param source
194
         * @param target
195
         * @return
196
         */
197
        List<CoordinateOperationDefinition> getCoordinateOperations(CRSDefinition source, CRSDefinition target);
198

    
199
        /**
200
         * Gets the list of available CoordinatesOperations to transform or
201
         * convert coordinates from the source CoordinateReferenceSystem to
202
         * the target one.
203
         * 
204
         * @param source The code of the source CRS (e.g. "ESPG:25830")
205
         * @param target The code of the target CRS (e.g. "ESPG:4230")
206
         * @return
207
         */
208
        List<CoordinateOperationDefinition> getCoordinateOperations(String source, String target);
209
        
210
        /**
211
         * Creates the parameters needed to initialize the manager.
212
         * 
213
         * @return the initialization parameters
214
         */
215
        DynObject createParameters();
216

    
217
        /**
218
         * Initializes the manager with the given parameters.
219
         * 
220
         * @param parameters
221
         *            to initialize the manager
222
         */
223
        void initialize(DynObject parameters);
224
}