Revision 1395

View differences:

org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/pom.xml
1
<?xml version="1.0" encoding="UTF-8"?>
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
    <groupId>org.gvsig</groupId>
5
    <artifactId>org.gvsig.projection.api</artifactId>
6
    <version>2.0.56</version>
7
    <packaging>jar</packaging>
8
    <name>${project.artifactId}</name>
9

  
10
    <licenses>
11
        <license>
12
            <name>GPLv3</name>
13
            <url>http://www.gnu.org/licenses/gpl.html</url>
14
            <distribution>repo</distribution>
15
            <comments>
16
                "GPL" stands for "General Public License". The most widespread such
17
                license is the GNU General Public License, or GNU GPL for short.
18
                This can be further shortened to "GPL", when it is understood that
19
                the GNU GPL is the one intended.
20
            </comments>
21
        </license>
22
    </licenses>
23

  
24
    <organization>
25
        <name>gvSIG Association</name>
26
        <url>http://www.gvsig.com/</url>
27
    </organization>
28

  
29
    <scm>
30
        <connection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56</connection>
31
        <developerConnection>scm:svn:https://devel.gvsig.org/svn/gvsig-jcrs/org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56</developerConnection>
32
        <url>https://devel.gvsig.org/redmine/projects/gvsig-jcrs/repository/show/org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56</url>
33
    </scm>
34

  
35
    <repositories>
36
        <repository>
37
            <id>gvsig-public-http-repository</id>
38
            <name>gvSIG maven public HTTP repository</name>
39
            <url>http://devel.gvsig.org/m2repo/j2se</url>
40
            <releases>
41
                <enabled>true</enabled>
42
                <updatePolicy>daily</updatePolicy>
43
                <checksumPolicy>warn</checksumPolicy>
44
            </releases>
45
            <snapshots>
46
                <enabled>true</enabled>
47
                <updatePolicy>daily</updatePolicy>
48
                <checksumPolicy>warn</checksumPolicy>
49
            </snapshots>
50
        </repository>
51
    </repositories>
52

  
53
    <distributionManagement>
54
        <site>
55
            <id>gvsig-repository</id>
56
            <url>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</url>
57
        </site>
58
        <repository>
59
            <id>gvsig-repository</id>
60
            <name>gvSIG maven repository</name>
61
            <url>dav:https://devel.gvsig.org/m2repo/j2se</url>
62
            <uniqueVersion>false</uniqueVersion>
63
        </repository>
64
        <snapshotRepository>
65
            <id>gvsig-repository</id>
66
            <name>gvSIG maven repository</name>
67
            <url>dav:https://devel.gvsig.org/m2repo/j2se</url>
68
            <uniqueVersion>false</uniqueVersion>
69
        </snapshotRepository>
70
    </distributionManagement>
71

  
72
    <issueManagement>
73
        <system>redmine</system>
74
        <url>https://devel.gvsig.org/redmine/projects/gvsig-jcrs</url>
75
    </issueManagement>
76

  
77

  
78
    <mailingLists>
79
        <mailingList>
80
            <name>User List</name>
81
            <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</subscribe>
82
            <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_usuarios</unsubscribe>
83
            <post>gvsig_usuarios@listserv.gva.es</post>
84
            <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
85
            <otherArchives>
86
                <otherArchive>http://www.mail-archive.com/gvsig_usuarios@runas.cap.gva.es</otherArchive>
87
                <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
88
            </otherArchives>
89
        </mailingList>
90
        <mailingList>
91
            <name>Developer List</name>
92
            <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</subscribe>
93
            <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_desarrolladores</unsubscribe>
94
            <post>gvsig_desarrolladores@listserv.gva.es</post>
95
            <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
96
            <otherArchives>
97
                <otherArchive>http://www.mail-archive.com/gvsig_desarrolladores@runas.cap.gva.es</otherArchive>
98
                <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
99
            </otherArchives>
100
        </mailingList>
101
        <mailingList>
102
            <name>International List</name>
103
            <subscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</subscribe>
104
            <unsubscribe>http://listserv.gva.es/cgi-bin/mailman/listinfo/gvsig_internacional</unsubscribe>
105
            <post>gvsig_internacional@listserv.gva.es</post>
106
            <archive>http://www.gvsig.org/web/community/mailing-lists/gvsig-nabble</archive>
107
            <otherArchives>
108
                <otherArchive>http://www.mail-archive.com/gvsig_internacional@runas.cap.gva.es</otherArchive>
109
                <otherArchive>http://dir.gmane.org/index.php?prefix=gmane.comp.gis.gvsig</otherArchive>
110
            </otherArchives>
111
        </mailingList>
112
    </mailingLists>
113

  
114
    <developers>
115
        <developer>
116
            <id>jjdelcerro</id>
117
            <name>Joaquín José del Cerro</name>
118
            <email>jjdelcerro@gvsig.com</email>
119
            <roles>
120
                <role>Architect</role>
121
                <role>Developer</role>
122
            </roles>
123
        </developer>
124
        <developer>
125
            <id>cordinayana</id>
126
            <name>Cèsar Ordiñana</name>
127
            <email>cordinyana@gvsig.com</email>
128
            <roles>
129
                <role>Architect</role>
130
                <role>Developer</role>
131
            </roles>
132
        </developer>
133
    </developers>
134

  
135
    <dependencyManagement>
136
        <dependencies>
137
            <dependency>
138
                <groupId>junit</groupId>
139
                <artifactId>junit</artifactId>
140
                <version>3.8.1</version>
141
            </dependency>
142
            <dependency>
143
                <groupId>org.gvsig</groupId>
144
                <artifactId>org.gvsig.tools.lib</artifactId>
145
                <version>${gvsig.tools.version}</version>
146
            </dependency>
147

  
148
        </dependencies>
149
    </dependencyManagement>
150

  
151
    <dependencies>
152
        <dependency>
153
            <groupId>org.gvsig</groupId>
154
            <artifactId>org.gvsig.tools.lib</artifactId>
155
        </dependency>
156
        <dependency>
157
            <groupId>junit</groupId>
158
            <artifactId>junit</artifactId>
159
            <scope>test</scope>
160
        </dependency>            
161
    </dependencies>
162

  
163

  
164
    <build>
165
        <extensions>
166
            <extension>
167
                <groupId>org.apache.maven.wagon</groupId>
168
                <artifactId>wagon-webdav-jackrabbit</artifactId>
169
                <version>${wagon.webdav.jackrabbit.version}</version>
170
            </extension>
171
        </extensions>
172
        <pluginManagement>
173
            <plugins>
174

  
175
                <plugin>
176
                    <groupId>org.apache.maven.plugins</groupId>
177
                    <artifactId>maven-surefire-plugin</artifactId>
178
                    <version>${maven.surefire.plugin.version}</version>
179
                    <configuration>
180
                        <forkMode>once</forkMode>
181
                    </configuration>
182
                </plugin>
183
                <plugin>
184
                    <groupId>org.apache.maven.plugins</groupId>
185
                    <artifactId>maven-compiler-plugin</artifactId>
186
                    <version>${maven.compiler.plugin.version}</version>
187
                    <configuration>
188
                        <source>${java.version}</source>
189
                        <target>${java.version}</target>
190
                        <encoding>${encoding}</encoding>
191
                    </configuration>
192
                </plugin>
193

  
194
                <plugin>
195
                    <groupId>org.apache.maven.plugins</groupId>
196
                    <artifactId>maven-resources-plugin</artifactId>
197
                    <version>${maven.resources.plugin.version}</version>
198
                    <configuration>
199
                        <encoding>${encoding}</encoding>
200
                    </configuration>
201
                </plugin>
202

  
203
                <plugin>
204
                    <groupId>org.apache.maven.plugins</groupId>
205
                    <artifactId>maven-javadoc-plugin</artifactId>
206
                    <version>${maven.javadoc.plugin.version}</version>
207
                    <configuration>
208
                        <docTitle>${project.name} ${project.version}</docTitle>
209
                        <encoding>${encoding}</encoding>
210
                        <footer />
211
                        <header />
212
                        <keywords>true</keywords>
213
                        <detectLinks>true</detectLinks>
214
                        <javaApiLinks>
215
                            <property>
216
                                <name>api_1.4</name>
217
                                <value>http://download.oracle.com/javase/1.4.2/docs/api/</value>
218
                            </property>
219
                            <property>
220
                                <name>api_1.5</name>
221
                                <value>http://download.oracle.com/javase/1.5.0/docs/api/</value>
222
                            </property>
223
                            <property>
224
                                <name>api_1.6</name>
225
                                <value>http://download.oracle.com/javase/6/docs/api/</value>
226
                            </property>
227
                        </javaApiLinks>
228
                    </configuration>
229
                </plugin>
230

  
231
                <plugin>
232
                    <groupId>org.apache.maven.plugins</groupId>
233
                    <artifactId>maven-site-plugin</artifactId>
234
                    <version>${maven.site.plugin.version}</version>
235
                    <configuration>
236
                        <chmod>true</chmod>
237
                        <chmodMode>a+rwX</chmodMode>
238
                    </configuration>
239
                </plugin>
240

  
241
                <plugin>
242
                    <groupId>org.apache.maven.plugins</groupId>
243
                    <artifactId>maven-jar-plugin</artifactId>
244
                    <version>${maven.jar.plugin.version}</version>
245
                    <configuration>
246
                        <archive>
247
                            <manifestEntries>
248
                                <Built-By>gvSIG Team</Built-By>
249
                            </manifestEntries>
250
                        </archive>
251
                    </configuration>
252
                </plugin>
253

  
254
                <plugin>
255
                    <groupId>org.codehaus.mojo</groupId>
256
                    <artifactId>properties-maven-plugin</artifactId>
257
                    <version>${properties.maven.plugin.version}</version>
258
                </plugin>
259

  
260
                <plugin>
261
                    <groupId>org.codehaus.gmaven</groupId>
262
                    <artifactId>gmaven-plugin</artifactId>
263
                    <version>${gmaven.plugin.version}</version>
264
                </plugin>
265

  
266
                <plugin>
267
                    <groupId>org.apache.maven.plugins</groupId>
268
                    <artifactId>maven-antrun-plugin</artifactId>
269
                    <version>${maven.antrun.plugin.version}</version>
270
                </plugin>
271

  
272
                <plugin>
273
                    <groupId>org.codehaus.mojo</groupId>
274
                    <artifactId>animal-sniffer-maven-plugin</artifactId>
275
                    <version>${animal.sniffer.maven.plugin.version}</version>
276
                </plugin>
277

  
278
                <plugin>
279
                    <groupId>org.apache.maven.plugins</groupId>
280
                    <artifactId>maven-release-plugin</artifactId>
281
                    <version>${maven.release.plugin.version}</version>
282
                </plugin>
283

  
284
                <plugin>
285
                    <groupId>org.apache.maven.plugins</groupId>
286
                    <artifactId>maven-assembly-plugin</artifactId>
287
                    <version>${maven.assembly.plugin.version}</version>
288
                </plugin>
289

  
290
                <plugin>
291
                    <groupId>org.apache.maven.plugins</groupId>
292
                    <artifactId>maven-clean-plugin</artifactId>
293
                    <version>${maven.clean.plugin.version}</version>
294
                </plugin>
295

  
296
                <plugin>
297
                    <groupId>org.codehaus.mojo</groupId>
298
                    <artifactId>exec-maven-plugin</artifactId>
299
                    <version>${exec.maven.plugin.version}</version>
300
                </plugin>
301

  
302
                <plugin>
303
                    <!-- invoke as "mvn license:format" to fix the header -->
304
                    <!-- invoke as "mvn license:check" to check the header -->
305
                    <!-- See http://code.google.com/p/maven-license-plugin/wiki/Configuration -->
306
                    <groupId>com.mycila.maven-license-plugin</groupId>
307
                    <artifactId>maven-license-plugin</artifactId>
308
                    <version>${maven.license.plugin.version}</version>
309
                    <configuration>
310
                        <header>/src/main/config/header.txt</header>
311
                        <failIfMissing>false</failIfMissing>
312
                        <aggregate>false</aggregate>
313
                        <strictCheck>true</strictCheck>
314
                        <encoding>${encoding}</encoding>
315
                        <quiet>false</quiet>
316
                        <excludes>
317
                            <exclude>**/*.properties</exclude>
318
                            <exclude>**/*.txt</exclude>
319
                            <exclude>**/*.jpg</exclude>
320
                            <exclude>**/*.jpeg</exclude>
321
                            <exclude>**/*.svg</exclude>
322
                            <exclude>**/*.png</exclude>
323
                            <exclude>**/*.gvssym</exclude>
324
                            <exclude>**/*.def</exclude>
325
                            <exclude>**/*.msg</exclude>
326
                        </excludes>
327
                    </configuration>
328
                </plugin>
329

  
330
                <plugin>
331
                    <groupId>org.apache.maven.plugins</groupId>
332
                    <artifactId>maven-source-plugin</artifactId>
333
                    <version>${maven.source.plugin.version}</version>
334
                </plugin>
335
                <plugin>
336
                    <groupId>org.codehaus.mojo</groupId>
337
                    <artifactId>versions-maven-plugin</artifactId>
338
                    <version>2.8.1</version>
339
                    <configuration>
340
                        <allowSnapshots>false</allowSnapshots>
341
                        <excludeProperties>
342
                            maven.deploy.plugin.version,
343
                            maven.surefire.plugin.version,
344
                            maven.compiler.plugin.version,
345
                            maven.resources.plugin.version,
346
                            maven.javadoc.plugin.version,
347
                            maven.site.plugin.version,
348
                            maven.jar.plugin.version,
349
                            properties.maven.plugin.version,
350
                            gmaven.plugin.version,
351
                            maven.antrun.plugin.version,
352
                            maven.release.plugin.version,
353
                            maven.assembly.plugin.version,
354
                            maven.clean.plugin.version,
355
                            exec.maven.plugin.version,
356
                            maven.license.plugin.version,
357
                            maven.source.plugin.version,
358
                            maven.scm.plugin.version,
359
                            maven.checkstyle.plugin.version,
360
                            animal.sniffer.maven.plugin.version,
361
                            maven.project.info.reports.plugin.version,
362
                            maven.jxr.plugin.version,
363
                            findbugs.maven.plugin.version,
364
                            wagon.webdav.jackrabbit.version,
365
                        </excludeProperties>
366
                    </configuration>
367
                </plugin>
368
            </plugins>
369
        </pluginManagement>
370

  
371
        <plugins>
372
<!--            <plugin>
373
                <groupId>org.codehaus.mojo</groupId>
374
                <artifactId>versions-maven-plugin</artifactId>
375
                <version>2.8.1</version>
376
                <configuration>
377
                    <allowSnapshots>false</allowSnapshots>
378
                    <properties>
379
                        <property>
380
                            <name>gvsig.tools.version</name>
381
                            <banSnapshots>true</banSnapshots>
382
                            <autoLinkDependencies>false</autoLinkDependencies>
383
                        </property>
384
                    </properties>
385
                </configuration>
386
            </plugin>-->
387
                  
388
            <plugin>
389
                <groupId>org.apache.maven.plugins</groupId>
390
                <artifactId>maven-jar-plugin</artifactId>
391
                <configuration>
392
                </configuration>
393
                <executions>
394
                    <!-- Generates a jar file only with the test classes -->
395
                    <execution>
396
                        <goals>
397
                            <goal>test-jar</goal>
398
                        </goals>
399
                    </execution>
400
                </executions>
401
            </plugin>
402

  
403
            <plugin>
404
                <groupId>org.apache.maven.plugins</groupId>
405
                <artifactId>maven-release-plugin</artifactId>
406
                <configuration>
407
                    <tagBase>https://devel.gvsig.org/svn/gvsig-jcrs/${gvsig.projection.svnroot}/tags/</tagBase>
408
                    <!-- This is a 2.0 beta 6 bug. By default the goals are 'clean verify', so the modules
409
                    are not installed, so the dependencies between modules are not met. With this configuration
410
                    we force the module installation. -->
411
                    <preparationGoals>clean install</preparationGoals>
412
                    <autoVersionSubmodules>true</autoVersionSubmodules>
413
                </configuration>
414
            </plugin>
415

  
416
            <plugin>
417
                <!-- to continue building  when test fail -->
418
                <groupId>org.apache.maven.plugins</groupId>
419
                <artifactId>maven-surefire-plugin</artifactId>
420
                <configuration>
421
                    <testFailureIgnore>true</testFailureIgnore>
422
                </configuration>
423
            </plugin>
424
        </plugins>
425
    </build>
426

  
427
    <reporting>
428
        <excludeDefaults>true</excludeDefaults>
429
        <plugins>
430
            <plugin>
431
                <groupId>org.apache.maven.plugins</groupId>
432
                <artifactId>maven-project-info-reports-plugin</artifactId>
433
                <version>${maven.project.info.reports.plugin.version}</version>
434
            </plugin>
435
            <plugin>
436
                <groupId>org.apache.maven.plugins</groupId>
437
                <artifactId>maven-javadoc-plugin</artifactId>
438
                <version>${maven.javadoc.plugin.version}</version>
439
            </plugin>
440
            <plugin>
441
                <groupId>org.apache.maven.plugins</groupId>
442
                <artifactId>maven-jxr-plugin</artifactId>
443
                <version>${maven.jxr.plugin.version}</version>
444
                <configuration>
445
                    <linkJavadoc>true</linkJavadoc>
446
                </configuration>
447
            </plugin>
448
        </plugins>
449
    </reporting>
450

  
451
    <properties>
452
        <!-- Maven plugins versions -->    
453
        <maven.deploy.plugin.version>2.7</maven.deploy.plugin.version>
454
        <maven.surefire.plugin.version>3.0.0-M3</maven.surefire.plugin.version>
455
        <maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
456
        <maven.resources.plugin.version>3.2.0</maven.resources.plugin.version>
457
        <maven.javadoc.plugin.version>3.2.0</maven.javadoc.plugin.version>
458
        <maven.site.plugin.version>3.3</maven.site.plugin.version>
459
        <maven.jar.plugin.version>3.2.0</maven.jar.plugin.version>
460
        <properties.maven.plugin.version>1.0.0</properties.maven.plugin.version>
461
        <gmaven.plugin.version>1.5</gmaven.plugin.version>
462
        <maven.antrun.plugin.version>1.7</maven.antrun.plugin.version>
463
        <maven.release.plugin.version>2.5.3</maven.release.plugin.version>
464
        <maven.assembly.plugin.version>2.2-beta-5</maven.assembly.plugin.version>
465
        <maven.clean.plugin.version>2.5</maven.clean.plugin.version>
466
        <exec.maven.plugin.version>3.0.0</exec.maven.plugin.version>
467
        <maven.license.plugin.version>1.10.b1</maven.license.plugin.version>
468
        <maven.source.plugin.version>3.2.1</maven.source.plugin.version>
469
        <maven.scm.plugin.version>1.11.2</maven.scm.plugin.version>
470
        <maven.checkstyle.plugin.version>3.1.2</maven.checkstyle.plugin.version>
471
        <animal.sniffer.maven.plugin.version>1.17</animal.sniffer.maven.plugin.version>
472

  
473
        <maven.project.info.reports.plugin.version>2.7</maven.project.info.reports.plugin.version>
474
        <maven.jxr.plugin.version>2.3</maven.jxr.plugin.version>
475
        <findbugs.maven.plugin.version>2.5.2</findbugs.maven.plugin.version>
476
        <wagon.webdav.jackrabbit.version>2.4</wagon.webdav.jackrabbit.version>
477

  
478
        <encoding>ISO-8859-1</encoding>
479
        <java.version>1.8</java.version>
480
        
481
        <localRepository>${user.home}/.m2/repository</localRepository>
482
        <site-repository>dav:https://devel.gvsig.org/sites/${project.artifactId}/${project.version}</site-repository>
483

  
484
        <gvsig.projection.svnroot>org.gvsig.projection</gvsig.projection.svnroot>
485
        <gvsig.tools.version>3.0.273</gvsig.tools.version>
486

  
487
    </properties>
488

  
489
</project>
490

  
0 491

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/resources/META-INF/services/org.gvsig.tools.library.Library
1
org.cresques.ProjectionLibrary
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/CRSFactoryNotRegisteredException.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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
 * AUTHORS (In addition to CIT):
26
 * 2008 {DiSiD Technologies}   {Create a base Locator implementation}
27
 */
28
package org.cresques;
29

  
30
import org.gvsig.tools.exception.BaseRuntimeException;
31

  
32
/**
33
 * Exception for errors related to the initialization of a Library.
34
 * 
35
 * @author <a href="mailto:cordin@disid.com">C?sar Ordi?ana</a>
36
 */
37
public class CRSFactoryNotRegisteredException extends BaseRuntimeException {
38

  
39
	private static final long serialVersionUID = 7354573543115812224L;
40

  
41
	private static final String KEY = "_CRSFactoryNotRegisteredException";
42

  
43
    private static final String MESSAGE = "An instance of ICRSFactory has not " +
44
    		"been registered in the CRSFactory";
45

  
46
    public CRSFactoryNotRegisteredException() {
47
        super(MESSAGE, KEY, serialVersionUID);
48
    }
49
}
0 50

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/DataTypes.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.cresques;
25

  
26
/**
27
 * @author gvSIG Team
28
 * @version $Id$
29
 * 
30
 */
31
public interface DataTypes extends org.gvsig.tools.dataTypes.DataTypes {
32

  
33
    /*
34
	 * 
35
	 */
36
    public static final int CRS = OBJECT + 1;
37
}
0 38

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/coerce/CoerceToString.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.cresques.coerce;
25

  
26
import org.cresques.cts.IProjection;
27
import org.gvsig.tools.dataTypes.AbstractCoercion;
28
import org.gvsig.tools.dataTypes.CoercionException;
29
import org.gvsig.tools.dataTypes.Coercion;
30
import org.gvsig.tools.dataTypes.CoercionContext;
31

  
32
/**
33
 * Convert a Projection to String.
34
 * 
35
 * Support convert:
36
 * - Projection to String (do nothing)
37
 * 
38
 * @author gvSIG Team
39
 * @version $Id$
40
 * 
41
 */
42
public class CoerceToString extends AbstractCoercion {
43

  
44
	public CoerceToString() {
45
		// Do nothing
46
	}
47
	
48
	public Object coerce(Object value, CoercionContext context) throws CoercionException {
49
    if( value == null || value instanceof String ) {
50
      return value;
51
    }
52
		try {
53
			if( value instanceof IProjection ) {
54
				return ((IProjection)value).getFullCode();
55
			}
56
		} catch (Exception e) {
57
			throw new CoercionException(e);
58
		}
59
		throw new CoercionException();
60
	}
61

  
62
}
0 63

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/coerce/CoerceToCRS.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 gvSIG Association.
5
 *
6
 * This program is free software; you can redistribute it and/or modify it under
7
 * the terms of the GNU General Public License as published by the Free Software
8
 * Foundation; either version 3 of the License, or (at your option) any later
9
 * version.
10
 *
11
 * This program is distributed in the hope that it will be useful, but WITHOUT
12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
13
 * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
14
 * details.
15
 *
16
 * You should have received a copy of the GNU General Public License along with
17
 * this program; if not, write to the Free Software Foundation, Inc., 51
18
 * Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
19
 *
20
 * For any additional information, do not hesitate to contact us at info AT
21
 * gvsig.com, or visit our website www.gvsig.com.
22
 */
23
package org.cresques.coerce;
24

  
25
import org.cresques.cts.IProjection;
26
import org.gvsig.fmap.crs.CRSFactory;
27
import org.gvsig.tools.dataTypes.AbstractCoercion;
28
import org.gvsig.tools.dataTypes.CoercionException;
29
import org.gvsig.tools.dataTypes.CoercionContext;
30

  
31
/**
32
 * Convert a string value of projection code to IProjection
33
 *
34
 * @author gvSIG Team
35
 * @version $Id$
36
 *
37
 */
38
public class CoerceToCRS extends AbstractCoercion {
39

  
40
    public Object coerce(Object value, CoercionContext context) throws CoercionException {
41
        if (value == null || value instanceof IProjection) {
42
            return value;
43
        }
44
        try {
45
            Object proj = CRSFactory.getCRS(value.toString());
46
            if (proj == null) {
47
                throw new CoercionException("Can't convert value '" + getValueAsString(value) + "' to IProjection. Probably not a valid format for a projection.");
48
            }
49
            return proj;
50
        } catch (Exception e) {
51
            throw new CoercionException("Can't convert value '" + getValueAsString(value) + "' to IProjection. Probably not a valid format for a projection.", e);
52
        }
53

  
54
    }
55

  
56
    private String getValueAsString(Object value) {
57
        try {
58
            return value.toString();
59
        } catch (Exception e) {
60
            return "(unknow)";
61
        }
62
    }
63

  
64
}
0 65

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/ProjectionLibrary.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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
/* gvSIG. Geographic Information System of the Valencian Government
25
*
26
* Copyright (C) 2007-2008 Infrastructures and Transports Department
27
* of the Valencian Government (CIT)
28
*
29
* This program is free software; you can redistribute it and/or
30
* modify it under the terms of the GNU General Public License
31
* as published by the Free Software Foundation; either version 2
32
* of the License, or (at your option) any later version.
33
*
34
* This program is distributed in the hope that it will be useful,
35
* but WITHOUT ANY WARRANTY; without even the implied warranty of
36
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
37
* GNU General Public License for more details.
38
*
39
* You should have received a copy of the GNU General Public License
40
* along with this program; if not, write to the Free Software
41
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
42
* MA  02110-1301, USA.
43
*
44
*/
45
package org.cresques;
46

  
47
import org.cresques.coerce.CoerceToCRS;
48
import org.cresques.coerce.CoerceToString;
49
import org.cresques.cts.IProjection;
50
import org.gvsig.fmap.crs.CRSFactory;
51
import org.gvsig.fmap.crs.persistence.CoordTransPersistenceFactory;
52
import org.gvsig.fmap.crs.persistence.ProjectionPersistenceFactory;
53
import org.gvsig.tools.ToolsLibrary;
54
import org.gvsig.tools.ToolsLocator;
55
import org.gvsig.tools.dataTypes.DataTypesManager;
56
import org.gvsig.tools.library.AbstractLibrary;
57
import org.gvsig.tools.library.LibraryException;
58
import org.slf4j.Logger;
59
import org.slf4j.LoggerFactory;
60

  
61
public class ProjectionLibrary extends AbstractLibrary {
62

  
63
	private static final Logger logger = LoggerFactory.getLogger(ProjectionLibrary.class);
64
	
65
    public void doRegistration() {
66
        registerAsAPI(ProjectionLibrary.class);
67
        require(ToolsLibrary.class);
68
    }
69

  
70
	protected void doInitialize() throws LibraryException {
71
	}
72

  
73
	protected void doPostInitialize() throws LibraryException {
74
		if (CRSFactory.getCRSFactory()==null) {
75
			logger.warn("has not registered an implementation of " + this.getClass().getName()+".");
76
		}
77

  
78
		DataTypesManager dataTypesManager = ToolsLocator.getDataTypesManager();
79
    dataTypesManager.addtype(
80
        DataTypes.CRS, 
81
        "CRS", 
82
        "CRS",
83
        IProjection.class, 
84
        new CoerceToCRS()
85
    );
86
    dataTypesManager.addCoercion(DataTypes.STRING, new CoerceToString());
87

  
88
		// Register the PersistenceFactory to be able to persist 
89
		// IProjection objects
90
		ToolsLocator.getPersistenceManager().registerFactory(
91
				new ProjectionPersistenceFactory());
92
		ToolsLocator.getPersistenceManager().registerFactory(
93
            new CoordTransPersistenceFactory());
94
	}
95

  
96
}
0 97

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/Messages.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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
package org.cresques;
26

  
27
import org.gvsig.tools.ToolsLocator;
28
import org.gvsig.tools.i18n.I18nManager;
29

  
30
/**
31
* Bridge class to provide internationalization services to the library.
32
* It uses the gvsig-i18n library as a backend, and includes its
33
* necessary initialization.
34
* 
35
*/
36
public class Messages {
37
	private static I18nManager manager = null;
38
	/**
39
	 * Loads the translations in the dictionary. It initializes the backend
40
	 * gvsig-i18n library
41
	 *
42
	 */
43
	private static void init() {
44
		manager = ToolsLocator.getI18nManager(); 
45
		manager.addResourceFamily("org.cresques.resources.i18n.text", Messages.class.getClassLoader(), Messages.class.getClass().getName());
46
	}
47
	
48
	/**
49
	 * Gets the translation associated with the provided translation key.
50
	 * 
51
	 * @param key The translation key which identifies the target text
52
	 * @return The translation associated with the provided translation key.
53
	 */
54
	public static String getText(String key) {
55
		if (manager == null ) {
56
			init();
57
		}
58
		return manager.getTranslation(key);
59
	}
60

  
61
}
62

  
0 63

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/px/Extent.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.cresques.px;
25

  
26
import java.awt.geom.Point2D;
27
import java.awt.geom.Rectangle2D;
28
import java.text.DecimalFormat;
29

  
30
/**
31
 *	Clase que getiona el extent de una imagen
32
 *	
33
 *  @author Luis W.Sevilla (sevilla_lui@gva.es)
34
 */
35
public class Extent {
36
    Point2D min = null;
37
    Point2D max = null;
38

  
39
    /**
40
     * Constructor sin par?metros
41
     */
42
    public Extent() {
43
        min = new Point2D.Double(999999999.0, 999999999.0);
44
        max = new Point2D.Double(-999999999.0, -999999999.0);
45
    }
46

  
47
    /**
48
     * Constructor 
49
     * @param pt1	punto que representa la esquina superior izquierda
50
     * @param pt2	punto que representa la esquina inferior derecha
51
     */
52
    public Extent(Point2D pt1, Point2D pt2) {
53
        newExtent(pt1.getX(), pt1.getY(), pt2.getX(), pt2.getY());
54
    }
55

  
56
    /**
57
     * Contructor
58
     * @param x1 punto que representa la coordenada X de la esquina superior izquierda
59
     * @param y1 punto que representa la coordenada Y de la esquina superior izquierda
60
     * @param x2 punto que representa la coordenada X de la esquina inferior derecha
61
     * @param y2 punto que representa la coordenada Y de la esquina inferior derecha
62
     */
63
    public Extent(double x1, double y1, double x2, double y2) {
64
        newExtent(x1, y1, x2, y2);
65
    }
66

  
67
    /**
68
     * Constructor
69
     * @param r	Rectangulo 2D
70
     */
71
    public Extent(Rectangle2D r) {
72
        newExtent(r.getX(), r.getY(), r.getX() + r.getWidth(),
73
                  r.getY() + r.getHeight());
74
    }
75

  
76
    /**
77
     * Constructor de copia
78
     * @param ext	Objeto Extent
79
     */
80
    public Extent(Extent ext) {
81
        newExtent(ext.minX(), ext.minY(), ext.maxX(), ext.maxY());
82
    }
83

  
84
    /**
85
     * Crea un objeto extent identico y lo retorna
86
     * @return Objeto extent
87
     */
88
    public Object clone() {
89
        Extent e = (Extent) clone();
90
        e.min = (Point2D) min.clone();
91
        e.max = (Point2D) max.clone();
92

  
93
        return e;
94
    }
95

  
96
    private void newExtent(double x1, double y1, double x2, double y2) {
97
        min = new Point2D.Double(Math.min(x1, x2), Math.min(y1, y2));
98
        max = new Point2D.Double(Math.max(x1, x2), Math.max(y1, y2));
99
    }
100

  
101
    /**
102
     * Obtiene la coordenada X m?nima
103
     * @return valor de la coordenada X m?nima
104
     */
105
    public double minX() {
106
        return min.getX();
107
    }
108

  
109
    /**
110
     * Obtiene la coordenada Y m?nima
111
     * @return valor de la coordenada X m?nima
112
     */
113
    public double minY() {
114
        return min.getY();
115
    }
116

  
117
    /**
118
     * Obtiene la coordenada X m?xima
119
     * @return valor de la coordenada X m?xima
120
     */
121
    public double maxX() {
122
        return max.getX();
123
    }
124

  
125
    /**
126
     * Obtiene la coordenada Y m?xima
127
     * @return valor de la coordenada Y m?xima
128
     */
129
    public double maxY() {
130
        return max.getY();
131
    }
132
    
133
    /**
134
     * Obtiene el punto m?nimo
135
     * @return m?nimo
136
     */
137
    public Point2D getMin() {
138
        return min;
139
    }
140

  
141
    /**
142
     * Obtiene el punto m?ximo
143
     * @return m?ximo
144
     */
145
    public Point2D getMax() {
146
        return max;
147
    }
148

  
149
    public boolean isAt(Point2D pt) {
150
        if (pt.getX() < minX()) {
151
            return false;
152
        }
153

  
154
        if (pt.getX() > maxX()) {
155
            return false;
156
        }
157

  
158
        if (pt.getY() < minY()) {
159
            return false;
160
        }
161

  
162
        if (pt.getY() > maxY()) {
163
            return false;
164
        }
165

  
166
        return true;
167
    }
168

  
169
    public double width() {
170
        return Math.abs(maxX() - minX());
171
    }
172

  
173
    public double height() {
174
        return Math.abs(maxY() - minY());
175
    }
176

  
177
    /**
178
     * Verifica un punto, y modifica el extent si no est? incluido
179
     */
180
    public void add(Point2D pt) {
181
        if (pt == null) {
182
            return;
183
        }
184

  
185
        min.setLocation(Math.min(pt.getX(), minX()), Math.min(pt.getY(), minY()));
186
        max.setLocation(Math.max(pt.getX(), maxX()), Math.max(pt.getY(), maxY()));
187
    }
188

  
189
    public void add(Extent ext) {
190
        if (ext == null) {
191
            return;
192
        }
193

  
194
        min.setLocation(Math.min(ext.minX(), minX()),
195
                        Math.min(ext.minY(), minY()));
196
        max.setLocation(Math.max(ext.maxX(), maxX()),
197
                        Math.max(ext.maxY(), maxY()));
198
    }
199

  
200
    /**
201
     * Obtiene la escala
202
     * @param width	Ancho
203
     * @param height	Alto
204
     * @return
205
     */
206
    public double[] getScale(int width, int height) {
207
        return getScale((double) width, (double) height);
208
    }
209

  
210
    public double[] getScale(double width, double height) {
211
        double[] scale = new double[2];
212
        scale[0] = ((float) width) / width();
213
        scale[1] = ((float) height) / height();
214

  
215
        return scale;
216
    }
217

  
218
    public Rectangle2D toRectangle2D() {
219
        return new Rectangle2D.Double(minX(), minY(), width(), height());
220
    }
221

  
222
    public String toString() {
223
        DecimalFormat format = new DecimalFormat("####.000");
224

  
225
        return "Extent: (" + format.format(minX()) + "," +
226
               format.format(minY()) + "), (" + format.format(maxX()) + "," +
227
               format.format(maxY()) + ")";
228
    }
229

  
230
    public interface Has {
231
        public Extent getExtent();
232
    }
233
}
0 234

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/px/.cvsignore
1
*.dfPackage
2
*.wmf
0 3

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/px/package.html
1
<!--
2

  
3
    gvSIG. Desktop Geographic Information System.
4

  
5
    Copyright (C) 2007-2013 gvSIG Association.
6

  
7
    This program is free software; you can redistribute it and/or
8
    modify it under the terms of the GNU General Public License
9
    as published by the Free Software Foundation; either version 3
10
    of the License, or (at your option) any later version.
11

  
12
    This program is distributed in the hope that it will be useful,
13
    but WITHOUT ANY WARRANTY; without even the implied warranty of
14
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15
    GNU General Public License for more details.
16

  
17
    You should have received a copy of the GNU General Public License
18
    along with this program; if not, write to the Free Software
19
    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
20
    MA  02110-1301, USA.
21

  
22
    For any additional information, do not hesitate to contact us
23
    at info AT gvsig.com, or visit our website www.gvsig.com.
24

  
25
-->
26
<html>
27
	<body>Pixel: Clases para dibujar.
28
</body>
29
</html>
0 30

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/cts/CoordTransRuntimeException.java
1
/* gvSIG. Desktop Geographic Information System.
2
 *
3
 * Copyright ? 2007-2015 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.cresques.cts;
24

  
25
/**
26
 * @author fdiaz
27
 *
28
 */
29
public class CoordTransRuntimeException extends RuntimeException {
30

  
31
    /**
32
     *
33
     */
34
    private static final long serialVersionUID = 1348981767734366776L;
35
    IProjection source;
36
    IProjection target;
37
    double x;
38
    double y;
39

  
40
    /**
41
     *
42
     */
43
    public CoordTransRuntimeException(IProjection source, IProjection target, double x, double y, Throwable cause) {
44
        super("Error reprojecting point (" + x + "," + y + ") from " + source.getAbrev() + " to " + target.getAbrev()
45
            + ".", cause);
46
        this.source = source;
47
        this.target = target;
48
        this.x = x;
49
        this.y = y;
50
    }
51

  
52
    /**
53
    *
54
    */
55
    public CoordTransRuntimeException(IProjection source, IProjection target, double x, double y) {
56
        this(source, target, x, y, null);
57
    }
58

  
59
    /**
60
     * @return the source
61
     */
62
    public IProjection getSource() {
63
        return source;
64
    }
65

  
66
    /**
67
     * @return the target
68
     */
69
    public IProjection getTarget() {
70
        return target;
71
    }
72

  
73
    /**
74
     * @return the x
75
     */
76
    public double getX() {
77
        return x;
78
    }
79

  
80
    /**
81
     * @return the y
82
     */
83
    public double getY() {
84
        return y;
85
    }
86

  
87
}
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/cts/IDatum.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.cresques.cts;
25

  
26

  
27
/**
28
 * @author "Luis W. Sevilla" (sevilla_lui@gva.es)
29
 */
30
public interface IDatum {
31
    /**
32
     * Semieje Mayor del elipsoide.
33
     * @return
34
     */
35
    public double getESemiMajorAxis();
36

  
37
    /**
38
     * Aplanamiento del elipsoide.
39
     * @return
40
     */
41
    public double getEIFlattening();
42
}
0 43

  
org.gvsig.projection/tags/org.gvsig.projection.api-2.0.56/src/main/java/org/cresques/cts/IProjection.java
1
/**
2
 * gvSIG. Desktop Geographic Information System.
3
 *
4
 * Copyright (C) 2007-2013 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 3
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.cresques.cts;
25

  
26
import java.awt.Color;
27
import java.awt.Graphics2D;
28
import java.awt.geom.Point2D;
29
import java.awt.geom.Rectangle2D;
30

  
31
import org.cresques.geo.ViewPortData;
32

  
33
import org.gvsig.tools.lang.Cloneable;
34

  
35
/**
36
 *
37
 * @author "Luis W. Sevilla" (sevilla_lui@gva.es)
38
 */
39
public interface IProjection extends Cloneable{
40

  
41
    /**
42
     * Return the string representation of projection in the format.
43
     *
44
     * Return null if can't export to format
45
     *
46
     * @param format
47
     * @return
48
     */
49
    public String export(String format);
50

  
51
    public IDatum getDatum();
52

  
53
    public Point2D createPoint(double x, double y);
54

  
55
    // TODO Quitar si no son necesarias.
56
    public String getAbrev();
57

  
58
    /**
59
     * Devuelve getAbrev() mas los parametros de transformacion si los hay
60
     * ej.: (EPSG:23030:proj@+proj...@...)
61
     *
62
     * @return getAbrev() o getAbrev()+parametros
63
     */
64
    public String getFullCode();
65

  
66
    public void drawGrid(Graphics2D g, ViewPortData vp);
67

  
68
    public void setGridColor(Color c);
69

  
70
    public Color getGridColor();
71

  
72
    /**
73
     * Crea un ICoordTrans para transformar coordenadas
74
     * desde el IProjection actual al dest.
75
     * @param dest
76
     * @return
77
     */
78

  
79
    public ICoordTrans getCT(IProjection dest);
80

  
81
    public Point2D toGeo(Point2D pt);
82

  
83
    public Point2D fromGeo(Point2D gPt, Point2D mPt);
84

  
85
    public boolean isProjected();
86

  
87
    /**
88
     * First two parameters must be in meters.
89
     * This should be changed (map units should be used) and then
90
     * change the places where this method is used.
91
     *
92
     * @param minX in meters
93
     * @param maxX in meters
94
     * @param width in pixels (dots)
95
     * @param dpi dots per inch
96
     * @return Scale denominator ( the "X" in "1 : X" )
97
     */
98
    public double getScale(double minX, double maxX, double width, double dpi);
99

  
100
    public Rectangle2D getExtent(Rectangle2D extent,double scale,double wImage,double hImage,double mapUnits,double distanceUnits,double dpi);
101
}
0 102

  
... This diff was truncated because it exceeds the maximum size that can be displayed.

Also available in: Unified diff