Revision 1314
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
|
3 |
<modelVersion>4.0.0</modelVersion> |
|
4 |
<artifactId>org.gvsig.proj</artifactId> |
|
5 |
<packaging>pom</packaging> |
|
6 |
<version>1.0.29</version> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<description>Coordinate reference system management library</description> |
|
9 |
|
|
10 |
|
|
11 |
<licenses> |
|
12 |
<license> |
|
13 |
<name>GPLv3</name> |
|
14 |
<url>http://www.gnu.org/licenses/gpl.html</url> |
|
15 |
<distribution>repo</distribution> |
|
16 |
<comments> |
|
17 |
"GPL" stands for "General Public License". The most widespread such |
|
18 |
license is the GNU General Public License, or GNU GPL for short. |
|
19 |
This can be further shortened to "GPL", when it is understood that |
|
20 |
the GNU GPL is the one intended. |
|
21 |
</comments> |
|
22 |
</license> |
|
23 |
</licenses> |
|
24 |
|
|
25 |
<organization> |
|
26 |
<name>gvSIG Association</name> |
|
27 |
<url>http://www.gvsig.com/</url> |
|
28 |
</organization> |
|
29 |
|
|
30 |
<url>http://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
31 |
|
|
32 |
<scm> |
|
33 |
<connection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.proj/tags/org.gvsig.proj-1.0.29</connection> |
|
34 |
<developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.proj/tags/org.gvsig.proj-1.0.29</developerConnection> |
|
35 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-jcrs/repository/show/org.gvsig.proj/tags/org.gvsig.proj-1.0.29</url> |
|
36 |
</scm> |
|
37 |
|
|
38 |
<repositories> |
|
39 |
<repository> |
|
40 |
<id>gvsig-public-http-repository</id> |
|
41 |
<name>gvSIG maven public HTTP repository</name> |
|
42 |
<url>http://devel.gvsig.org/m2repo/j2se</url> |
|
43 |
<releases> |
|
44 |
<enabled>true</enabled> |
|
45 |
<updatePolicy>daily</updatePolicy> |
|
46 |
<checksumPolicy>warn</checksumPolicy> |
|
47 |
</releases> |
|
48 |
<snapshots> |
|
49 |
<enabled>true</enabled> |
|
50 |
<updatePolicy>daily</updatePolicy> |
|
51 |
<checksumPolicy>warn</checksumPolicy> |
|
52 |
</snapshots> |
|
53 |
</repository> |
|
54 |
</repositories> |
|
55 |
|
|
56 |
<distributionManagement> |
|
57 |
<site> |
|
58 |
<id>gvsig-repository</id> |
|
59 |
<url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url> |
|
60 |
</site> |
|
61 |
<repository> |
|
62 |
<id>gvsig-repository</id> |
|
63 |
<name>gvSIG maven repository</name> |
|
64 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
65 |
<uniqueVersion>false</uniqueVersion> |
|
66 |
</repository> |
|
67 |
<snapshotRepository> |
|
68 |
<id>gvsig-repository</id> |
|
69 |
<name>gvSIG maven repository</name> |
|
70 |
<url>dav:https://devel.gvsig.org/m2repo/j2se</url> |
|
71 |
<uniqueVersion>false</uniqueVersion> |
|
72 |
</snapshotRepository> |
|
73 |
</distributionManagement> |
|
74 |
|
|
75 |
<issueManagement> |
|
76 |
<system>redmine</system> |
|
77 |
<url>https://devel.gvsig.org/redmine/projects/gvsig-jcrs</url> |
|
78 |
</issueManagement> |
|
79 |
|
|
80 |
|
|
81 |
<mailingLists> |
|
82 |
<mailingList> |
|
83 |
<name>User List</name> |
|
84 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</subscribe> |
|
85 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</unsubscribe> |
|
86 |
<post>gvsig_usuarios@listserv.gva.es</post> |
|
87 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
88 |
<otherArchives> |
|
89 |
<otherArchive>http://www.mail-archive.com/gvsig_usuarios@runas.cap.gva.es</otherArchive> |
|
90 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
91 |
</otherArchives> |
|
92 |
</mailingList> |
|
93 |
<mailingList> |
|
94 |
<name>Developer List</name> |
|
95 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</subscribe> |
|
96 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</unsubscribe> |
|
97 |
<post>gvsig_desarrolladores@listserv.gva.es</post> |
|
98 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
99 |
<otherArchives> |
|
100 |
<otherArchive>http://www.mail-archive.com/gvsig_desarrolladores@runas.cap.gva.es</otherArchive> |
|
101 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
102 |
</otherArchives> |
|
103 |
</mailingList> |
|
104 |
<mailingList> |
|
105 |
<name>International List</name> |
|
106 |
<subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</subscribe> |
|
107 |
<unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</unsubscribe> |
|
108 |
<post>gvsig_internacional@listserv.gva.es</post> |
|
109 |
<archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive> |
|
110 |
<otherArchives> |
|
111 |
<otherArchive>http://www.mail-archive.com/gvsig_internacional@runas.cap.gva.es</otherArchive> |
|
112 |
<otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive> |
|
113 |
</otherArchives> |
|
114 |
</mailingList> |
|
115 |
</mailingLists> |
|
116 |
|
|
117 |
<developers> |
|
118 |
<developer> |
|
119 |
<id>jjdelcerro</id> |
|
120 |
<name>Joaqu?n Jos? del Cerro</name> |
|
121 |
<email>jjdelcerro@gvsig.com</email> |
|
122 |
<roles> |
|
123 |
<role>Architect</role> |
|
124 |
<role>Developer</role> |
|
125 |
</roles> |
|
126 |
</developer> |
|
127 |
<developer> |
|
128 |
<id>cordinayana</id> |
|
129 |
<name>C?sar Ordi?ana</name> |
|
130 |
<email>cordinyana@gvsig.com</email> |
|
131 |
<roles> |
|
132 |
<role>Architect</role> |
|
133 |
<role>Developer</role> |
|
134 |
</roles> |
|
135 |
</developer> |
|
136 |
</developers> |
|
137 |
|
|
138 |
<dependencyManagement> |
|
139 |
<dependencies> |
|
140 |
<dependency> |
|
141 |
<groupId>org.gvsig</groupId> |
|
142 |
<artifactId>org.gvsig.tools</artifactId> |
|
143 |
<version>${gvsig.tools.version}</version> |
|
144 |
<type>pom</type> |
|
145 |
<scope>import</scope> |
|
146 |
</dependency> |
|
147 |
|
|
148 |
<dependency> |
|
149 |
<groupId>org.gvsig</groupId> |
|
150 |
<artifactId>org.gvsig.projection.api</artifactId> |
|
151 |
<version>${gvsig.projection.version}</version> |
|
152 |
</dependency> |
|
153 |
|
|
154 |
<dependency> |
|
155 |
<groupId>org.gvsig</groupId> |
|
156 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
157 |
<version>${gvsig.metadata.version}</version> |
|
158 |
</dependency> |
|
159 |
|
|
160 |
<dependency> |
|
161 |
<groupId>org.osgeo</groupId> |
|
162 |
<artifactId>proj4j</artifactId> |
|
163 |
<version>0.1.0</version> |
|
164 |
</dependency> |
|
165 |
|
|
166 |
<dependency> |
|
167 |
<groupId>org.gvsig</groupId> |
|
168 |
<artifactId>org.gvsig.proj.lib</artifactId> |
|
169 |
<version>1.0.29</version> |
|
170 |
</dependency> |
|
171 |
<dependency> |
|
172 |
<groupId>org.gvsig</groupId> |
|
173 |
<artifactId>org.gvsig.proj.main</artifactId> |
|
174 |
<version>1.0.1-SNAPSHOT</version> |
|
175 |
</dependency> |
|
176 |
<dependency> |
|
177 |
<groupId>org.gvsig</groupId> |
|
178 |
<artifactId>org.gvsig.proj.swing</artifactId> |
|
179 |
<version>1.0.29</version> |
|
180 |
</dependency> |
|
181 |
<dependency> |
|
182 |
<groupId>org.gvsig</groupId> |
|
183 |
<artifactId>org.gvsig.proj.lib.api</artifactId> |
|
184 |
<version>1.0.29</version> |
|
185 |
</dependency> |
|
186 |
<dependency> |
|
187 |
<groupId>org.gvsig</groupId> |
|
188 |
<artifactId>org.gvsig.proj.lib.api</artifactId> |
|
189 |
<version>1.0.29</version> |
|
190 |
<type>test-jar</type> |
|
191 |
<scope>test</scope> |
|
192 |
</dependency> |
|
193 |
<dependency> |
|
194 |
<groupId>org.gvsig</groupId> |
|
195 |
<artifactId>org.gvsig.proj.lib.proj4j</artifactId> |
|
196 |
<version>1.0.29</version> |
|
197 |
</dependency> |
|
198 |
<dependency> |
|
199 |
<groupId>org.gvsig</groupId> |
|
200 |
<artifactId>org.gvsig.proj.swing.api</artifactId> |
|
201 |
<version>1.0.29</version> |
|
202 |
</dependency> |
|
203 |
<dependency> |
|
204 |
<groupId>org.gvsig</groupId> |
|
205 |
<artifactId>org.gvsig.proj.swing.api</artifactId> |
|
206 |
<version>1.0.29</version> |
|
207 |
<type>test-jar</type> |
|
208 |
<scope>test</scope> |
|
209 |
</dependency> |
|
210 |
<dependency> |
|
211 |
<groupId>org.gvsig</groupId> |
|
212 |
<artifactId>org.gvsig.proj.swing.impl</artifactId> |
|
213 |
<version>1.0.29</version> |
|
214 |
</dependency> |
|
215 |
|
|
216 |
</dependencies> |
|
217 |
</dependencyManagement> |
|
218 |
<!-- |
|
219 |
<dependencies> |
|
220 |
<dependency> |
|
221 |
<groupId>junit</groupId> |
|
222 |
<artifactId>junit</artifactId> |
|
223 |
</dependency> |
|
224 |
</dependencies> |
|
225 |
--> |
|
226 |
<build> |
|
227 |
<extensions> |
|
228 |
<extension> |
|
229 |
<groupId>org.apache.maven.wagon</groupId> |
|
230 |
<artifactId>wagon-webdav-jackrabbit</artifactId> |
|
231 |
<version>2.4</version> |
|
232 |
</extension> |
|
233 |
</extensions> |
|
234 |
<pluginManagement> |
|
235 |
<plugins> |
|
236 |
|
|
237 |
<plugin> |
|
238 |
<groupId>org.apache.maven.plugins</groupId> |
|
239 |
<artifactId>maven-surefire-plugin</artifactId> |
|
240 |
<version>2.7.1</version> |
|
241 |
<configuration> |
|
242 |
<forkMode>once</forkMode> |
|
243 |
</configuration> |
|
244 |
</plugin> |
|
245 |
<plugin> |
|
246 |
<groupId>org.apache.maven.plugins</groupId> |
|
247 |
<artifactId>maven-compiler-plugin</artifactId> |
|
248 |
<version>2.3.2</version> |
|
249 |
<configuration> |
|
250 |
<source>1.7</source> |
|
251 |
<target>1.7</target> |
|
252 |
<encoding>ISO-8859-1</encoding> |
|
253 |
</configuration> |
|
254 |
</plugin> |
|
255 |
|
|
256 |
<plugin> |
|
257 |
<groupId>org.apache.maven.plugins</groupId> |
|
258 |
<artifactId>maven-resources-plugin</artifactId> |
|
259 |
<version>2.4.3</version> |
|
260 |
<configuration> |
|
261 |
<encoding>ISO-8859-1</encoding> |
|
262 |
</configuration> |
|
263 |
</plugin> |
|
264 |
|
|
265 |
<plugin> |
|
266 |
<groupId>org.apache.maven.plugins</groupId> |
|
267 |
<artifactId>maven-javadoc-plugin</artifactId> |
|
268 |
<version>2.9</version> |
|
269 |
<configuration> |
|
270 |
<docTitle>${project.name} ${project.version}</docTitle> |
|
271 |
<encoding>ISO-8859-1</encoding> |
|
272 |
<footer /> |
|
273 |
<header /> |
|
274 |
<keywords>true</keywords> |
|
275 |
<detectLinks>true</detectLinks> |
|
276 |
<javaApiLinks> |
|
277 |
<property> |
|
278 |
<name>api_1.4</name> |
|
279 |
<value>http://download.oracle.com/javase/1.4.2/docs/api/</value> |
|
280 |
</property> |
|
281 |
<property> |
|
282 |
<name>api_1.5</name> |
|
283 |
<value>http://download.oracle.com/javase/1.5.0/docs/api/</value> |
|
284 |
</property> |
|
285 |
<property> |
|
286 |
<name>api_1.6</name> |
|
287 |
<value>http://download.oracle.com/javase/6/docs/api/</value> |
|
288 |
</property> <property> |
|
289 |
<name>api_1.7</name> |
|
290 |
<value>http://download.oracle.com/javase/7/docs/api/</value> |
|
291 |
</property> |
|
292 |
</javaApiLinks> |
|
293 |
</configuration> |
|
294 |
</plugin> |
|
295 |
|
|
296 |
<plugin> |
|
297 |
<groupId>org.apache.maven.plugins</groupId> |
|
298 |
<artifactId>maven-site-plugin</artifactId> |
|
299 |
<configuration> |
|
300 |
<chmod>true</chmod> |
|
301 |
<chmodMode>a+rwX</chmodMode> |
|
302 |
</configuration> |
|
303 |
</plugin> |
|
304 |
|
|
305 |
<plugin> |
|
306 |
<groupId>org.apache.maven.plugins</groupId> |
|
307 |
<artifactId>maven-jar-plugin</artifactId> |
|
308 |
<version>2.3.1</version> |
|
309 |
<configuration> |
|
310 |
<archive> |
|
311 |
<manifestEntries> |
|
312 |
<Built-By>gvSIG Team</Built-By> |
|
313 |
</manifestEntries> |
|
314 |
</archive> |
|
315 |
</configuration> |
|
316 |
</plugin> |
|
317 |
|
|
318 |
<plugin> |
|
319 |
<groupId>org.codehaus.mojo</groupId> |
|
320 |
<artifactId>properties-maven-plugin</artifactId> |
|
321 |
<version>1.0-alpha-2</version> |
|
322 |
</plugin> |
|
323 |
|
|
324 |
<plugin> |
|
325 |
<groupId>org.codehaus.gmaven</groupId> |
|
326 |
<artifactId>gmaven-plugin</artifactId> |
|
327 |
<version>1.4</version> |
|
328 |
</plugin> |
|
329 |
|
|
330 |
<plugin> |
|
331 |
<groupId>org.apache.maven.plugins</groupId> |
|
332 |
<artifactId>maven-antrun-plugin</artifactId> |
|
333 |
<version>1.7</version> |
|
334 |
</plugin> |
|
335 |
<!-- |
|
336 |
<plugin> |
|
337 |
<groupId>org.codehaus.mojo</groupId> |
|
338 |
<artifactId>animal-sniffer-maven-plugin</artifactId> |
|
339 |
<version>1.9</version> |
|
340 |
</plugin> |
|
341 |
--> |
|
342 |
<plugin> |
|
343 |
<groupId>org.apache.maven.plugins</groupId> |
|
344 |
<artifactId>maven-release-plugin</artifactId> |
|
345 |
<version>2.1</version> |
|
346 |
</plugin> |
|
347 |
|
|
348 |
<plugin> |
|
349 |
<groupId>org.apache.maven.plugins</groupId> |
|
350 |
<artifactId>maven-assembly-plugin</artifactId> |
|
351 |
<version>2.2-beta-5</version> |
|
352 |
</plugin> |
|
353 |
|
|
354 |
<plugin> |
|
355 |
<groupId>org.apache.maven.plugins</groupId> |
|
356 |
<artifactId>maven-clean-plugin</artifactId> |
|
357 |
<version>2.4.1</version> |
|
358 |
</plugin> |
|
359 |
|
|
360 |
<plugin> |
|
361 |
<groupId>org.codehaus.mojo</groupId> |
|
362 |
<artifactId>exec-maven-plugin</artifactId> |
|
363 |
<version>1.2</version> |
|
364 |
</plugin> |
|
365 |
|
|
366 |
<plugin> |
|
367 |
<groupId>com.mycila.maven-license-plugin</groupId> |
|
368 |
<artifactId>maven-license-plugin</artifactId> |
|
369 |
<version>1.10.b1</version> |
|
370 |
</plugin> |
|
371 |
|
|
372 |
<plugin> |
|
373 |
<groupId>org.apache.maven.plugins</groupId> |
|
374 |
<artifactId>maven-source-plugin</artifactId> |
|
375 |
<version>2.2.1</version> |
|
376 |
</plugin> |
|
377 |
|
|
378 |
</plugins> |
|
379 |
</pluginManagement> |
|
380 |
|
|
381 |
<plugins> |
|
382 |
<plugin> |
|
383 |
<groupId>org.apache.maven.plugins</groupId> |
|
384 |
<artifactId>maven-jar-plugin</artifactId> |
|
385 |
<configuration> |
|
386 |
</configuration> |
|
387 |
<executions> |
|
388 |
<!-- Generates a jar file only with the test classes --> |
|
389 |
<execution> |
|
390 |
<goals> |
|
391 |
<goal>test-jar</goal> |
|
392 |
</goals> |
|
393 |
</execution> |
|
394 |
</executions> |
|
395 |
</plugin> |
|
396 |
|
|
397 |
<plugin> |
|
398 |
<groupId>org.apache.maven.plugins</groupId> |
|
399 |
<artifactId>maven-release-plugin</artifactId> |
|
400 |
<configuration> |
|
401 |
<tagBase>https://devel.gvsig.org/svn/gvsig-jcrs/${project.artifactId}/tags/</tagBase> |
|
402 |
<!-- This is a 2.0 beta 6 bug. By default the goals are 'clean verify', so the modules |
|
403 |
are not installed, so the dependencies between modules are not met. With this configuration |
|
404 |
we force the module installation. --> |
|
405 |
<preparationGoals>clean install</preparationGoals> |
|
406 |
<autoVersionSubmodules>true</autoVersionSubmodules> |
|
407 |
</configuration> |
|
408 |
</plugin> |
|
409 |
|
|
410 |
<plugin> |
|
411 |
<!-- to continue building when test fail --> |
|
412 |
<groupId>org.apache.maven.plugins</groupId> |
|
413 |
<artifactId>maven-surefire-plugin</artifactId> |
|
414 |
<configuration> |
|
415 |
<testFailureIgnore>true</testFailureIgnore> |
|
416 |
</configuration> |
|
417 |
</plugin> |
|
418 |
</plugins> |
|
419 |
</build> |
|
420 |
|
|
421 |
<reporting> |
|
422 |
<excludeDefaults>true</excludeDefaults> |
|
423 |
<plugins> |
|
424 |
<plugin> |
|
425 |
<groupId>org.apache.maven.plugins</groupId> |
|
426 |
<artifactId>maven-project-info-reports-plugin</artifactId> |
|
427 |
<version>2.7</version> |
|
428 |
</plugin> |
|
429 |
<plugin> |
|
430 |
<groupId>org.apache.maven.plugins</groupId> |
|
431 |
<artifactId>maven-javadoc-plugin</artifactId> |
|
432 |
<version>2.9</version> |
|
433 |
</plugin> |
|
434 |
<plugin> |
|
435 |
<groupId>org.apache.maven.plugins</groupId> |
|
436 |
<artifactId>maven-jxr-plugin</artifactId> |
|
437 |
<version>2.3</version> |
|
438 |
<configuration> |
|
439 |
<linkJavadoc>true</linkJavadoc> |
|
440 |
</configuration> |
|
441 |
</plugin> |
|
442 |
</plugins> |
|
443 |
</reporting> |
|
444 |
|
|
445 |
|
|
446 |
<properties> |
|
447 |
<project.build.sourceEncoding>ISO-8859-1</project.build.sourceEncoding> |
|
448 |
<localRepository>${user.home}/.m2/repository</localRepository> |
|
449 |
<site-repository>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</site-repository> |
|
450 |
|
|
451 |
|
|
452 |
<gvsig.tools.version>3.0.258</gvsig.tools.version> |
|
453 |
<gvsig.metadata.version>2.0.300</gvsig.metadata.version> |
|
454 |
<gvsig.projection.version>2.0.53</gvsig.projection.version> |
|
455 |
|
|
456 |
</properties> |
|
457 |
|
|
458 |
<modules> |
|
459 |
<module>org.gvsig.proj.lib</module> |
|
460 |
<module>org.gvsig.proj.swing</module> |
|
461 |
<!-- |
|
462 |
<module>org.gvsig.proj.main</module> |
|
463 |
--> |
|
464 |
</modules> |
|
465 |
<groupId>org.gvsig</groupId> |
|
466 |
</project> |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.main/src/main/java/org/gvsig/proj/main/Main.java | ||
---|---|---|
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.main; |
|
25 |
|
|
26 |
import java.awt.BorderLayout; |
|
27 |
import java.awt.Dimension; |
|
28 |
import java.awt.event.ActionEvent; |
|
29 |
|
|
30 |
import javax.swing.AbstractAction; |
|
31 |
import javax.swing.Action; |
|
32 |
import javax.swing.JButton; |
|
33 |
import javax.swing.JFrame; |
|
34 |
import javax.swing.JMenu; |
|
35 |
import javax.swing.JMenuBar; |
|
36 |
import javax.swing.JMenuItem; |
|
37 |
import javax.swing.JToolBar; |
|
38 |
import javax.swing.WindowConstants; |
|
39 |
|
|
40 |
import org.slf4j.Logger; |
|
41 |
import org.slf4j.LoggerFactory; |
|
42 |
|
|
43 |
import org.gvsig.proj.CoordinateReferenceSystem; |
|
44 |
import org.gvsig.proj.CoordinateReferenceSystemLocator; |
|
45 |
import org.gvsig.proj.CoordinateReferenceSystemManager; |
|
46 |
import org.gvsig.proj.CoordinateReferenceSystemNotFoundException; |
|
47 |
import org.gvsig.proj.swing.CoordinateReferenceSystemSelectorComponent; |
|
48 |
import org.gvsig.proj.swing.CoordinateReferenceSystemSwingLocator; |
|
49 |
import org.gvsig.proj.swing.CoordinateReferenceSystemSwingManager; |
|
50 |
import org.gvsig.tools.library.impl.DefaultLibrariesInitializer; |
|
51 |
import org.gvsig.tools.swing.api.windowmanager.WindowManager; |
|
52 |
|
|
53 |
/** |
|
54 |
* Main executable class for testing the CRS library. |
|
55 |
* |
|
56 |
* @author gvSIG Team |
|
57 |
* @version $Id$ |
|
58 |
*/ |
|
59 |
public class Main { |
|
60 |
|
|
61 |
private static final Logger LOG = LoggerFactory.getLogger(Main.class); |
|
62 |
|
|
63 |
private CoordinateReferenceSystemManager manager; |
|
64 |
private CoordinateReferenceSystemSwingManager swingManager; |
|
65 |
|
|
66 |
public static void main(String args[]) { |
|
67 |
new DefaultLibrariesInitializer().fullInitialize(); |
|
68 |
Main main = new Main(); |
|
69 |
main.show(); |
|
70 |
} |
|
71 |
|
|
72 |
@SuppressWarnings("serial") |
|
73 |
public void show() { |
|
74 |
manager = CoordinateReferenceSystemLocator.getManager(); |
|
75 |
swingManager = CoordinateReferenceSystemSwingLocator.getSwingManager(); |
|
76 |
|
|
77 |
Action showCRSSelector = new AbstractAction("Select a CRS") { |
|
78 |
|
|
79 |
public void actionPerformed(ActionEvent e) { |
|
80 |
showCRSSelector(manager); |
|
81 |
} |
|
82 |
}; |
|
83 |
|
|
84 |
Action exit = new AbstractAction("Exit") { |
|
85 |
|
|
86 |
public void actionPerformed(ActionEvent e) { |
|
87 |
System.exit(0); |
|
88 |
} |
|
89 |
}; |
|
90 |
|
|
91 |
JFrame frame = new JFrame("CRS example app"); |
|
92 |
frame.setDefaultCloseOperation(WindowConstants.EXIT_ON_CLOSE); |
|
93 |
|
|
94 |
// Create the menu bar. |
|
95 |
JMenuBar menuBar = new JMenuBar(); |
|
96 |
|
|
97 |
// Build the menu. |
|
98 |
JMenu menuFile = new JMenu("File"); |
|
99 |
menuFile.add(new JMenuItem(showCRSSelector)); |
|
100 |
menuFile.add(new JMenuItem(exit)); |
|
101 |
|
|
102 |
menuBar.add(menuFile); |
|
103 |
|
|
104 |
JToolBar toolBar = new JToolBar(); |
|
105 |
toolBar.add(new JButton(showCRSSelector)); |
|
106 |
toolBar.add(new JButton(exit)); |
|
107 |
|
|
108 |
frame.setPreferredSize(new Dimension(200, 100)); |
|
109 |
frame.setJMenuBar(menuBar); |
|
110 |
frame.add(toolBar, BorderLayout.PAGE_START); |
|
111 |
|
|
112 |
// Display the window. |
|
113 |
frame.pack(); |
|
114 |
frame.setVisible(true); |
|
115 |
} |
|
116 |
|
|
117 |
public void showCRSSelector(CoordinateReferenceSystemManager manager) { |
|
118 |
|
|
119 |
CoordinateReferenceSystemSelectorComponent crsSelectionComponent = |
|
120 |
swingManager.createCoordinateReferenceSystemSelectionComponent(); |
|
121 |
|
|
122 |
try { |
|
123 |
CoordinateReferenceSystem currentCRS = |
|
124 |
manager.getCoordinateReferenceSystem("EPSG", "23030"); |
|
125 |
crsSelectionComponent.setCoordinateReferenceSystem(currentCRS); |
|
126 |
} catch (CoordinateReferenceSystemNotFoundException e) { |
|
127 |
LOG.error("Error getting crs EPSG:23030", e); |
|
128 |
} |
|
129 |
|
|
130 |
swingManager.getWindowManager().showWindow( |
|
131 |
crsSelectionComponent.asJComponent(), "Proj", |
|
132 |
WindowManager.MODE.WINDOW); |
|
133 |
} |
|
134 |
|
|
135 |
} |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.main/src/main/java/org/gvsig/proj/main/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2012 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 2 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
28 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
29 |
<head> |
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
31 |
<title>org.gvsig.proj package documentation</title> |
|
32 |
</head> |
|
33 |
<body> |
|
34 |
|
|
35 |
<p>Proj library testing and demo application.</p> |
|
36 |
|
|
37 |
</body> |
|
38 |
</html> |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.main/src/main/resources/README.txt | ||
---|---|---|
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 |
|
|
25 |
Put into this folder the resources needed by your classes. |
|
26 |
|
|
27 |
This folder is added to the classpath, so you can load any resources |
|
28 |
through the ClassLoader. |
|
29 |
|
|
30 |
By default, in this folder you can find an example of log4j configuration, |
|
31 |
prepared to log messages through the console, so logging works when you |
|
32 |
run your classes. |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.main/src/main/resources/log4j.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2012 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 2 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd"> |
|
28 |
|
|
29 |
<!-- |
|
30 |
Log4J configuration file for unit tests execution. |
|
31 |
--> |
|
32 |
<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/"> |
|
33 |
|
|
34 |
<!-- Appender configuration to show logging messages through the console --> |
|
35 |
<appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender"> |
|
36 |
<layout class="org.apache.log4j.PatternLayout"> |
|
37 |
<param name="ConversionPattern" value="%d{HH:mm:ss,SSS} %-5p [%c{2}.%M()]\n %m%n" /> |
|
38 |
</layout> |
|
39 |
</appender> |
|
40 |
|
|
41 |
<!-- |
|
42 |
Activate logging messages of DEBUG level of higher only for the |
|
43 |
org.gvsig.tools packages. |
|
44 |
You can put full classes names or packages instead, to configure |
|
45 |
logging for all the classes and subpackages of the package. |
|
46 |
--> |
|
47 |
<category name="org.gvsig.tools"> |
|
48 |
<priority value="DEBUG" /> |
|
49 |
</category> |
|
50 |
<category name="org.gvsig.proj"> |
|
51 |
<priority value="DEBUG" /> |
|
52 |
</category> |
|
53 |
|
|
54 |
<!-- |
|
55 |
By default, show only logging messages of INFO level or higher, |
|
56 |
through the previously configured CONSOLE appender. |
|
57 |
--> |
|
58 |
<root> |
|
59 |
<priority value="INFO" /> |
|
60 |
<appender-ref ref="CONSOLE" /> |
|
61 |
</root> |
|
62 |
</log4j:configuration> |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.main/pom.xml | ||
---|---|---|
1 |
<?xml version="1.0" encoding="ISO-8859-1"?> |
|
2 |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
|
3 |
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
|
4 |
<modelVersion>4.0.0</modelVersion> |
|
5 |
<artifactId>org.gvsig.proj.main</artifactId> |
|
6 |
<packaging>jar</packaging> |
|
7 |
<name>${project.artifactId}</name> |
|
8 |
<parent> |
|
9 |
<groupId>org.gvsig</groupId> |
|
10 |
<artifactId>org.gvsig.proj</artifactId> |
|
11 |
<version>1.0.0-SNAPSHOT</version> |
|
12 |
</parent> |
|
13 |
|
|
14 |
<dependencyManagement> |
|
15 |
<dependencies> |
|
16 |
<dependency> |
|
17 |
<groupId>org.gvsig</groupId> |
|
18 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
19 |
<version>${gvsig.desktop.version}</version> |
|
20 |
</dependency> |
|
21 |
<dependency> |
|
22 |
<groupId>org.gvsig</groupId> |
|
23 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
24 |
<version>${gvsig.desktop.version}</version> |
|
25 |
</dependency> |
|
26 |
</dependencies> |
|
27 |
</dependencyManagement> |
|
28 |
|
|
29 |
<dependencies> |
|
30 |
<dependency> |
|
31 |
<groupId>org.gvsig</groupId> |
|
32 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
33 |
<scope>compile</scope> |
|
34 |
</dependency> |
|
35 |
<dependency> |
|
36 |
<groupId>org.gvsig</groupId> |
|
37 |
<artifactId>org.gvsig.tools.lib</artifactId> |
|
38 |
<type>test-jar</type> |
|
39 |
<scope>test</scope> |
|
40 |
</dependency> |
|
41 |
<dependency> |
|
42 |
<groupId>org.gvsig</groupId> |
|
43 |
<artifactId>org.gvsig.tools.swing.api</artifactId> |
|
44 |
<scope>compile</scope> |
|
45 |
</dependency> |
|
46 |
<!-- |
|
47 |
<dependency> |
|
48 |
<groupId>org.gvsig</groupId> |
|
49 |
<artifactId>org.gvsig.i18n</artifactId> |
|
50 |
<scope>compile</scope> |
|
51 |
</dependency> |
|
52 |
--> |
|
53 |
<dependency> |
|
54 |
<groupId>org.gvsig</groupId> |
|
55 |
<artifactId>org.gvsig.fmap.geometry.api</artifactId> |
|
56 |
<scope>compile</scope> |
|
57 |
</dependency> |
|
58 |
<dependency> |
|
59 |
<groupId>org.gvsig</groupId> |
|
60 |
<artifactId>org.gvsig.fmap.dal.api</artifactId> |
|
61 |
<scope>compile</scope> |
|
62 |
</dependency> |
|
63 |
<dependency> |
|
64 |
<groupId>org.gvsig</groupId> |
|
65 |
<artifactId>org.gvsig.metadata.lib.basic.api</artifactId> |
|
66 |
<scope>compile</scope> |
|
67 |
</dependency> |
|
68 |
<dependency> |
|
69 |
<groupId>org.gvsig</groupId> |
|
70 |
<artifactId>org.gvsig.proj.lib.api</artifactId> |
|
71 |
<scope>compile</scope> |
|
72 |
</dependency> |
|
73 |
<dependency> |
|
74 |
<groupId>org.gvsig</groupId> |
|
75 |
<artifactId>org.gvsig.proj.lib.proj4j</artifactId> |
|
76 |
<scope>runtime</scope> |
|
77 |
</dependency> |
|
78 |
<dependency> |
|
79 |
<groupId>org.gvsig</groupId> |
|
80 |
<artifactId>org.gvsig.proj.swing.api</artifactId> |
|
81 |
<scope>compile</scope> |
|
82 |
</dependency> |
|
83 |
<dependency> |
|
84 |
<groupId>org.gvsig</groupId> |
|
85 |
<artifactId>org.gvsig.proj.swing.impl</artifactId> |
|
86 |
<scope>runtime</scope> |
|
87 |
</dependency> |
|
88 |
</dependencies> |
|
89 |
|
|
90 |
<properties> |
|
91 |
<gvsig.desktop.version>2.0.10-SNAPSHOT</gvsig.desktop.version> |
|
92 |
</properties> |
|
93 |
</project> |
|
0 | 94 |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/DefaultEllipsoid.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2012 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.proj.proj4j; |
|
24 |
|
|
25 |
import java.util.HashMap; |
|
26 |
import java.util.Map; |
|
27 |
|
|
28 |
import org.gvsig.proj.Ellipsoid; |
|
29 |
|
|
30 |
/** |
|
31 |
* {@link Ellipsoid} implementation based on the Proj4J library. |
|
32 |
* |
|
33 |
* @author <a href="http://www.disid.com">DiSiD Technologies S.L.</a> |
|
34 |
* @version $Rev$ |
|
35 |
* @since 0.1.0 |
|
36 |
*/ |
|
37 |
public class DefaultEllipsoid implements Ellipsoid { |
|
38 |
|
|
39 |
private org.osgeo.proj4j.datum.Ellipsoid ellipsoid; |
|
40 |
|
|
41 |
private static final String[] SHORT_NAMES = new String[] { "intl", |
|
42 |
"bessel", "clrk66", "clrk80", "airy", "WGS60", "WGS66", "WGS72", |
|
43 |
"WGS84", "krass", "evrst30", "new_intl", "GRS80", "australian", |
|
44 |
"MERIT", "SGS85", "IAU76", "APL4.9", "NWL9D", "mod_airy", "andrae", |
|
45 |
"aust_SA", "GRS67", "bess_nam", "CPM", "delmbr", "engelis", "evrst48", |
|
46 |
"evrst56", "evrst69", "evrstSS", "fschr60", "fschr60m", "fschr68", |
|
47 |
"helmert", "hough", "intl", "kaula", "lerch", "mprts", "plessis", |
|
48 |
"SEasia", "walbeck", "NAD27", "NAD83", "sphere" }; |
|
49 |
|
|
50 |
private static final double[] FLATTENINGS = new double[] { 297.0, |
|
51 |
299.1528128, 0.0, 293.4663, 0.0, 298.3, 298.25, 298.26, 298.257223563, |
|
52 |
298.3, 300.8017, 0.0, 298.257222101, 298.25, 298.257, 298.257, 298.257, |
|
53 |
298.25, 298.25, 0.0, 300.0, 298.25, 298.2471674270, 299.1528128, |
|
54 |
334.29, 311.5, 298.2566, 300.8017, 300.8017, 300.8017, 300.8017, 298.3, |
|
55 |
298.3, 298.3, 298.3, 297.0, 297.0, 298.24, 298.257, 191.0, 0.0, 0.0, |
|
56 |
0.0, 293.4663, 298.257222101, 0.0 }; |
|
57 |
|
|
58 |
private static final Map ellipsoidFlattenings = new HashMap(); |
|
59 |
|
|
60 |
static { |
|
61 |
for (int i = 0; i < SHORT_NAMES.length; i++) { |
|
62 |
ellipsoidFlattenings |
|
63 |
.put(SHORT_NAMES[i], new Double(FLATTENINGS[i])); |
|
64 |
} |
|
65 |
} |
|
66 |
|
|
67 |
/** |
|
68 |
* Creates a new ellipsoid based on a Proj4J one. |
|
69 |
* |
|
70 |
* @param ellipsoid |
|
71 |
* the Proj4J ellipsoid |
|
72 |
*/ |
|
73 |
public DefaultEllipsoid(org.osgeo.proj4j.datum.Ellipsoid ellipsoid) { |
|
74 |
this.ellipsoid = ellipsoid; |
|
75 |
} |
|
76 |
|
|
77 |
public String getShortName() { |
|
78 |
return ellipsoid.getShortName(); |
|
79 |
} |
|
80 |
|
|
81 |
public String getName() { |
|
82 |
return ellipsoid.getName(); |
|
83 |
} |
|
84 |
|
|
85 |
public double getSemiMajorAxis() { |
|
86 |
return ellipsoid.getEquatorRadius(); |
|
87 |
} |
|
88 |
|
|
89 |
public double getSemiMinorAxis() { |
|
90 |
return ellipsoid.poleRadius; |
|
91 |
} |
|
92 |
|
|
93 |
public double getReciprocalFlattening() { |
|
94 |
Double flattening = (Double) ellipsoidFlattenings.get(getShortName()); |
|
95 |
return flattening == null ? 0.0d : flattening.doubleValue(); |
|
96 |
} |
|
97 |
|
|
98 |
} |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/Proj4jCoordinateReferenceSystemLibrary.java | ||
---|---|---|
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.proj4j; |
|
25 |
|
|
26 |
import org.gvsig.proj.CoordinateReferenceSystemLibrary; |
|
27 |
import org.gvsig.proj.CoordinateReferenceSystemLocator; |
|
28 |
import org.gvsig.tools.library.AbstractLibrary; |
|
29 |
import org.gvsig.tools.library.LibraryException; |
|
30 |
|
|
31 |
/** |
|
32 |
* Library to register the Proj4J based implementation of the org.gvsig.proj |
|
33 |
* API. |
|
34 |
* |
|
35 |
* @author gvSIG team |
|
36 |
* @version $Id$ |
|
37 |
*/ |
|
38 |
public class Proj4jCoordinateReferenceSystemLibrary extends AbstractLibrary { |
|
39 |
|
|
40 |
public void doRegistration() { |
|
41 |
registerAsImplementationOf(CoordinateReferenceSystemLibrary.class); |
|
42 |
} |
|
43 |
|
|
44 |
protected void doInitialize() throws LibraryException { |
|
45 |
CoordinateReferenceSystemLocator |
|
46 |
.registerManager(DefaultCoordinateReferenceSystemManager.class); |
|
47 |
} |
|
48 |
|
|
49 |
protected void doPostInitialize() throws LibraryException { |
|
50 |
// Do nothing |
|
51 |
} |
|
52 |
|
|
53 |
} |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/DefaultCoordinateReferenceSystemManager.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2012 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.proj.proj4j; |
|
24 |
|
|
25 |
import java.io.BufferedReader; |
|
26 |
import java.io.IOException; |
|
27 |
import java.io.InputStream; |
|
28 |
import java.io.InputStreamReader; |
|
29 |
import java.io.OutputStream; |
|
30 |
import java.io.PrintStream; |
|
31 |
import java.io.StreamTokenizer; |
|
32 |
import java.util.ArrayList; |
|
33 |
import java.util.Arrays; |
|
34 |
import java.util.Collections; |
|
35 |
import java.util.HashMap; |
|
36 |
import java.util.Iterator; |
|
37 |
import java.util.List; |
|
38 |
import java.util.Map; |
|
39 |
import java.util.Map.Entry; |
|
40 |
import java.util.Properties; |
|
41 |
import java.util.Set; |
|
42 |
|
|
43 |
import org.osgeo.proj4j.CRSFactory; |
|
44 |
import org.osgeo.proj4j.io.Proj4FileReader; |
|
45 |
import org.slf4j.Logger; |
|
46 |
import org.slf4j.LoggerFactory; |
|
47 |
|
|
48 |
import org.gvsig.proj.CoordinateReferenceSystem; |
|
49 |
import org.gvsig.proj.CoordinateReferenceSystemManager; |
|
50 |
import org.gvsig.proj.CoordinateReferenceSystemNotFoundException; |
|
51 |
import org.gvsig.tools.dynobject.DynObject; |
|
52 |
|
|
53 |
/** |
|
54 |
* Proj4J based {@link CoordinateReferenceSystemManager} implementation. |
|
55 |
* |
|
56 |
* @author gvSIG Team |
|
57 |
*/ |
|
58 |
public class DefaultCoordinateReferenceSystemManager implements |
|
59 |
CoordinateReferenceSystemManager { |
|
60 |
|
|
61 |
private static final Logger LOG = LoggerFactory |
|
62 |
.getLogger(DefaultCoordinateReferenceSystemManager.class); |
|
63 |
|
|
64 |
private final Map authorityCodes; |
|
65 |
|
|
66 |
private CRSFactory factory = new CRSFactory(); |
|
67 |
|
|
68 |
/** |
|
69 |
* Default constructor. |
|
70 |
*/ |
|
71 |
public DefaultCoordinateReferenceSystemManager() { |
|
72 |
authorityCodes = loadSupportedCRS(); |
|
73 |
} |
|
74 |
|
|
75 |
public List getAuthorityNames() { |
|
76 |
Set authCodeSet = authorityCodes.keySet(); |
|
77 |
Object[] codes = authCodeSet.toArray(); |
|
78 |
Arrays.sort(codes); |
|
79 |
return Collections.unmodifiableList(Arrays.asList(codes)); |
|
80 |
} |
|
81 |
|
|
82 |
public List getCodes(String authorityName) { |
|
83 |
return (List) authorityCodes.get(authorityName); |
|
84 |
} |
|
85 |
|
|
86 |
public void updateAllWorkingCodes() { |
|
87 |
|
|
88 |
} |
|
89 |
|
|
90 |
/** |
|
91 |
* Shows the list of working codes for each authority in the console. |
|
92 |
* |
|
93 |
* @throws IOException |
|
94 |
* if there is an error writing in the console output stream |
|
95 |
*/ |
|
96 |
public void showAllWorkingCodes() throws IOException { |
|
97 |
storeAllWorkingCodes(System.out); |
|
98 |
} |
|
99 |
|
|
100 |
/** |
|
101 |
* Stores the list of working codes for each authority in the |
|
102 |
* {@link OutputStream} in properties format. |
|
103 |
* |
|
104 |
* @param os |
|
105 |
* to show the list of working codes into. |
|
106 |
* @throws IOException |
|
107 |
* if there is an error writing in the stream |
|
108 |
*/ |
|
109 |
public void storeAllWorkingCodes(OutputStream os) throws IOException { |
|
110 |
String[] auths = |
|
111 |
new String[] { "EPSG", "ESRI", "WORLD", "NAD83", "NAD27" }; |
|
112 |
Properties properties = new Properties(); |
|
113 |
for (int i = 0; i < auths.length; i++) { |
|
114 |
List workingCodes = findWorkingCodes(auths[i]); |
|
115 |
StringBuffer buffer = new StringBuffer(); |
|
116 |
for (int j = 0; workingCodes != null && j < workingCodes.size(); j++) { |
|
117 |
buffer.append(workingCodes.get(j)); |
|
118 |
if (j < workingCodes.size() - 1) { |
|
119 |
buffer.append(","); |
|
120 |
} |
|
121 |
} |
|
122 |
properties.setProperty(auths[i], buffer.toString()); |
|
123 |
} |
|
124 |
properties.store(new PrintStream(os), "Created by calling " |
|
125 |
+ "DefaultCoordinateReferenceSystemManager.storeAllWorkingCodes()"); |
|
126 |
} |
|
127 |
|
|
128 |
/** |
|
129 |
* Looks for the list of codes currently working for an authority, |
|
130 |
* as the pro4j library CRS definition files usually provides more |
|
131 |
* than really supports. |
|
132 |
* |
|
133 |
* @param authority |
|
134 |
* to find the working codes from |
|
135 |
* @return the list of codes of the authority which might be used to get a |
|
136 |
* CRS |
|
137 |
*/ |
|
138 |
public List findWorkingCodes(String authority) { |
|
139 |
List codes; |
|
140 |
|
|
141 |
String filename = "/nad/" + authority.toLowerCase(); |
|
142 |
InputStream inStr = Proj4FileReader.class.getResourceAsStream(filename); |
|
143 |
if (inStr == null) { |
|
144 |
throw new IllegalStateException("Unable to access CRS file: " |
|
145 |
+ filename); |
|
146 |
} |
|
147 |
BufferedReader reader = |
|
148 |
new BufferedReader(new InputStreamReader(inStr)); |
|
149 |
try { |
|
150 |
codes = readAuthorityCodes(reader); |
|
151 |
} catch (IOException e) { |
|
152 |
throw new RuntimeException("Error reading the codes of authority: " |
|
153 |
+ authority, e); |
|
154 |
} finally { |
|
155 |
try { |
|
156 |
reader.close(); |
|
157 |
} catch (IOException e) { |
|
158 |
LOG.warn("Error closing BufferedReader on file " + filename, e); |
|
159 |
} |
|
160 |
} |
|
161 |
|
|
162 |
// Check if a projection might be really created with a given code |
|
163 |
// and remove from the list otherwise |
|
164 |
for (Iterator iterator = codes.iterator(); iterator.hasNext();) { |
|
165 |
String code = (String) iterator.next(); |
|
166 |
try { |
|
167 |
factory.createFromName(getCRSName(authority, code)); |
|
168 |
} catch (Throwable e) { |
|
169 |
iterator.remove(); |
|
170 |
LOG.debug("CRS with authority '" + authority + "' and code '" |
|
171 |
+ code + "' could not be loaded, removing from the list " |
|
172 |
+ "of codes of the authority", e); |
|
173 |
} |
|
174 |
} |
|
175 |
|
|
176 |
return codes; |
|
177 |
} |
|
178 |
|
|
179 |
private StreamTokenizer createTokenizer(BufferedReader reader) { |
|
180 |
StreamTokenizer t = new StreamTokenizer(reader); |
|
181 |
t.commentChar('#'); |
|
182 |
t.ordinaryChars('0', '9'); |
|
183 |
t.ordinaryChars('.', '.'); |
|
184 |
t.ordinaryChars('-', '-'); |
|
185 |
t.ordinaryChars('+', '+'); |
|
186 |
t.wordChars('0', '9'); |
|
187 |
t.wordChars('\'', '\''); |
|
188 |
t.wordChars('"', '"'); |
|
189 |
t.wordChars('_', '_'); |
|
190 |
t.wordChars('.', '.'); |
|
191 |
t.wordChars('-', '-'); |
|
192 |
t.wordChars('+', '+'); |
|
193 |
t.wordChars(',', ','); |
|
194 |
t.wordChars('@', '@'); |
|
195 |
return t; |
|
196 |
} |
|
197 |
|
|
198 |
private List readAuthorityCodes(BufferedReader reader) throws IOException { |
|
199 |
List codes = new ArrayList(); |
|
200 |
StreamTokenizer t = createTokenizer(reader); |
|
201 |
|
|
202 |
t.nextToken(); |
|
203 |
while (t.ttype == '<') { |
|
204 |
t.nextToken(); |
|
205 |
if (t.ttype != StreamTokenizer.TT_WORD) { |
|
206 |
throw new IOException(t.lineno() + ": Word expected after '<'"); |
|
207 |
} |
|
208 |
codes.add(t.sval); |
|
209 |
t.nextToken(); |
|
210 |
if (t.ttype != '>') |
|
211 |
throw new IOException(t.lineno() + ": '>' expected"); |
|
212 |
t.nextToken(); |
|
213 |
|
|
214 |
while (t.ttype != '<') { |
|
215 |
t.nextToken(); |
|
216 |
} |
|
217 |
t.nextToken(); |
|
218 |
if (t.ttype != '>') |
|
219 |
throw new IOException(t.lineno() + ": '<>' expected"); |
|
220 |
t.nextToken(); |
|
221 |
} |
|
222 |
return codes; |
|
223 |
} |
|
224 |
|
|
225 |
public CoordinateReferenceSystem getCoordinateReferenceSystem( |
|
226 |
String authority, String code) |
|
227 |
throws CoordinateReferenceSystemNotFoundException { |
|
228 |
int n = code.indexOf("("); |
|
229 |
if( n>0 ) { |
|
230 |
code = code.substring(0, n); |
|
231 |
} |
|
232 |
org.osgeo.proj4j.CoordinateReferenceSystem proj4jcrs = |
|
233 |
factory.createFromName(getCRSName(authority, code)); |
|
234 |
return new DefaultCoordinateReferenceSystem(authority, code, proj4jcrs); |
|
235 |
} |
|
236 |
|
|
237 |
private String getCRSName(String authority, String code) { |
|
238 |
String name = authority.concat(":").concat(code); |
|
239 |
return name; |
|
240 |
} |
|
241 |
|
|
242 |
public DynObject createParameters() { |
|
243 |
// Nothing to do, no parameters needed. |
|
244 |
return null; |
|
245 |
} |
|
246 |
|
|
247 |
public void initialize(DynObject parameters) { |
|
248 |
// Nothing to do |
|
249 |
} |
|
250 |
|
|
251 |
private Map loadSupportedCRS() { |
|
252 |
Properties supported = new Properties(); |
|
253 |
InputStream is = |
|
254 |
getClass().getResourceAsStream("supportedcrs.properties"); |
|
255 |
try { |
|
256 |
if (is == null) { |
|
257 |
throw new RuntimeException( |
|
258 |
"Supported crs property file not found in " |
|
259 |
+ getClass().getResource("supportedcrs.properties")); |
|
260 |
} else { |
|
261 |
supported.load(is); |
|
262 |
} |
|
263 |
} catch (IOException e) { |
|
264 |
throw new RuntimeException( |
|
265 |
"Error loading the supported crs property file from " |
|
266 |
+ getClass().getResource("supportedcrs.properties"), e); |
|
267 |
} |
|
268 |
|
|
269 |
Map authorityCodes = new HashMap(supported.size()); |
|
270 |
for (Iterator iterator = supported.entrySet().iterator(); iterator |
|
271 |
.hasNext();) { |
|
272 |
Entry entry = (Entry) iterator.next(); |
|
273 |
String authority = (String) entry.getKey(); |
|
274 |
String codesAsString = (String) entry.getValue(); |
|
275 |
List codes = |
|
276 |
Collections.unmodifiableList(Arrays.asList(codesAsString |
|
277 |
.split(","))); |
|
278 |
authorityCodes.put(authority, Collections.unmodifiableList(codes)); |
|
279 |
} |
|
280 |
return authorityCodes; |
|
281 |
} |
|
282 |
} |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/package.html | ||
---|---|---|
1 |
<?xml version="1.0" encoding="UTF-8" ?> |
|
2 |
<!-- |
|
3 |
|
|
4 |
gvSIG. Desktop Geographic Information System. |
|
5 |
|
|
6 |
Copyright (C) 2007-2012 gvSIG Association. |
|
7 |
|
|
8 |
This program is free software; you can redistribute it and/or |
|
9 |
modify it under the terms of the GNU General Public License |
|
10 |
as published by the Free Software Foundation; either version 2 |
|
11 |
of the License, or (at your option) any later version. |
|
12 |
|
|
13 |
This program is distributed in the hope that it will be useful, |
|
14 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
15 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
16 |
GNU General Public License for more details. |
|
17 |
|
|
18 |
You should have received a copy of the GNU General Public License |
|
19 |
along with this program; if not, write to the Free Software |
|
20 |
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
21 |
MA 02110-1301, USA. |
|
22 |
|
|
23 |
For any additional information, do not hesitate to contact us |
|
24 |
at info AT gvsig.com, or visit our website www.gvsig.com. |
|
25 |
|
|
26 |
--> |
|
27 |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
|
28 |
<html xmlns="http://www.w3.org/1999/xhtml"> |
|
29 |
<head> |
|
30 |
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /> |
|
31 |
<title>org.gvsig.proj package documentation</title> |
|
32 |
</head> |
|
33 |
<body> |
|
34 |
|
|
35 |
<p>Projection library API implementation based on the |
|
36 |
<a href="http://sourceforge.net/projects/jmapprojlib/">Java Map Projection Library</a>.</p> |
|
37 |
|
|
38 |
</body> |
|
39 |
</html> |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/DefaultDatum.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2012 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.proj.proj4j; |
|
24 |
|
|
25 |
import org.gvsig.proj.Datum; |
|
26 |
import org.gvsig.proj.Ellipsoid; |
|
27 |
|
|
28 |
|
|
29 |
/** |
|
30 |
* {@link Datum} implementation based on the Proj4J library. |
|
31 |
* |
|
32 |
* @author <a href="http://www.disid.com">DiSiD Technologies S.L.</a> |
|
33 |
* @version $Rev$ |
|
34 |
* @since 0.1.0 |
|
35 |
*/ |
|
36 |
public class DefaultDatum implements Datum { |
|
37 |
|
|
38 |
private org.osgeo.proj4j.datum.Datum datum; |
|
39 |
private Ellipsoid ellipsoid; |
|
40 |
|
|
41 |
/** |
|
42 |
* Creates a new datum based on a Proj4J datum. |
|
43 |
* |
|
44 |
* @param datum |
|
45 |
* the Proj4J Datum. |
|
46 |
*/ |
|
47 |
public DefaultDatum(org.osgeo.proj4j.datum.Datum datum) { |
|
48 |
this.datum = datum; |
|
49 |
this.ellipsoid = new DefaultEllipsoid(datum.getEllipsoid()); |
|
50 |
} |
|
51 |
|
|
52 |
public String getShortName() { |
|
53 |
return datum.getCode(); |
|
54 |
} |
|
55 |
|
|
56 |
public String getName() { |
|
57 |
return datum.getName(); |
|
58 |
} |
|
59 |
|
|
60 |
public Ellipsoid getEllipsoid() { |
|
61 |
return ellipsoid; |
|
62 |
} |
|
63 |
|
|
64 |
} |
org.gvsig.proj/tags/org.gvsig.proj-1.0.29/org.gvsig.proj.lib/org.gvsig.proj.lib.proj4j/src/main/java/org/gvsig/proj/proj4j/DefaultCoordinateReferenceSystem.java | ||
---|---|---|
1 |
/* gvSIG. Desktop Geographic Information System. |
|
2 |
* |
|
3 |
* Copyright ? 2007-2012 gvSIG Association |
|
4 |
* |
|
5 |
* This program is free software; you can redistribute it and/or |
|
6 |
* modify it under the terms of the GNU General Public License |
|
7 |
* as published by the Free Software Foundation; either version 2 |
|
8 |
* of the License, or (at your option) any later version. |
|
9 |
* |
|
10 |
* This program is distributed in the hope that it will be useful, |
|
11 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
12 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
13 |
* GNU General Public License for more details. |
|
14 |
* |
|
15 |
* You should have received a copy of the GNU General Public License |
|
16 |
* along with this program; if not, write to the Free Software |
|
17 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, |
|
18 |
* MA 02110-1301, USA. |
|
19 |
* |
|
20 |
* For any additional information, do not hesitate to contact us |
|
21 |
* at info AT gvsig.com, or visit our website www.gvsig.com. |
|
22 |
*/ |
|
23 |
package org.gvsig.proj.proj4j; |
|
24 |
|
|
25 |
import org.osgeo.proj4j.proj.LongLatProjection; |
|
26 |
|
|
27 |
import org.gvsig.proj.CoordinateReferenceSystem; |
|
28 |
import org.gvsig.proj.CoordinateTransformation; |
|
29 |
import org.gvsig.proj.Datum; |
|
30 |
|
|
31 |
/** |
|
32 |
* Proj4J based {@link CoordinateReferenceSystem} implementation. |
|
33 |
* |
|
34 |
* @author gvSIG Team |
|
35 |
*/ |
|
36 |
public class DefaultCoordinateReferenceSystem implements |
|
37 |
CoordinateReferenceSystem { |
|
38 |
|
|
39 |
private final org.osgeo.proj4j.CoordinateReferenceSystem crs; |
|
40 |
private final String authorityName; |
|
41 |
private final String code; |
|
42 |
private final Datum datum; |
|
43 |
|
|
44 |
/** |
|
45 |
* Constructor |
|
46 |
*/ |
|
47 |
public DefaultCoordinateReferenceSystem(String authorityName, String code, |
|
48 |
org.osgeo.proj4j.CoordinateReferenceSystem crs) { |
|
49 |
this.authorityName = authorityName; |
|
50 |
this.code = code; |
|
51 |
this.crs = crs; |
|
52 |
this.datum = new DefaultDatum(crs.getDatum()); |
|
53 |
} |
|
54 |
|
|
55 |
public String getAuthorityName() { |
|
56 |
return authorityName; |
|
57 |
} |
|
58 |
|
|
59 |
public String getCode() { |
|
60 |
return code; |
|
61 |
} |
|
62 |
|
|
63 |
public String getReference() { |
|
64 |
return authorityName.concat(":").concat(code); |
Also available in: Unified diff