root / org.gvsig.sis.proj / trunk / org.gvsig.sis.proj / org.gvsig.sis.proj.lib.impl / src / main / java / org / gvsig / sis / proj / lib / SisCoordinateReferenceSystemManager.java @ 813
History | View | Annotate | Download (2.07 KB)
1 |
package org.gvsig.sis.proj.lib; |
---|---|
2 |
|
3 |
import java.text.ParseException; |
4 |
|
5 |
import org.apache.sis.io.wkt.WKTFormat; |
6 |
import org.gvsig.proj.CoordinateOperationNotFoundException; |
7 |
import org.gvsig.proj.CoordinateReferenceSystem; |
8 |
import org.gvsig.proj.CoordinateReferenceSystemException; |
9 |
import org.gvsig.proj.CoordinateReferenceSystemManager; |
10 |
import org.gvsig.proj.CoordinateTransformation; |
11 |
import org.gvsig.proj.catalog.CRSCatalogLocator; |
12 |
import org.gvsig.proj.catalog.CRSCatalogManager; |
13 |
import org.gvsig.proj.catalog.CRSDefinition; |
14 |
import org.gvsig.proj.catalog.TransformationDefinition; |
15 |
import org.opengis.referencing.operation.CoordinateOperation; |
16 |
|
17 |
public class SisCoordinateReferenceSystemManager implements CoordinateReferenceSystemManager { |
18 |
private CRSCatalogManager catalogManager = null; |
19 |
|
20 |
public SisCoordinateReferenceSystemManager() {
|
21 |
} |
22 |
|
23 |
@Override
|
24 |
public CoordinateReferenceSystem getCoordinateReferenceSystem(String wkt) |
25 |
throws CoordinateReferenceSystemException {
|
26 |
return new DefaultCoordinateReferenceSystem(wkt); |
27 |
} |
28 |
|
29 |
@Override
|
30 |
public CoordinateReferenceSystem getCoordinateReferenceSystem(CRSDefinition definition)
|
31 |
throws CoordinateReferenceSystemException {
|
32 |
return new DefaultCoordinateReferenceSystem(definition); |
33 |
|
34 |
} |
35 |
|
36 |
@Override
|
37 |
public CoordinateTransformation getCoordinateTransformation(String wkt) |
38 |
throws CoordinateOperationNotFoundException, ParseException { |
39 |
WKTFormat format = new WKTFormat(null, null); |
40 |
Object obj = format.parseObject(wkt);
|
41 |
CoordinateOperation operation = (CoordinateOperation) obj; |
42 |
return new DefaultCoordinateTransformation(operation); |
43 |
} |
44 |
|
45 |
@Override
|
46 |
public CoordinateTransformation getCoordinateTransformation(TransformationDefinition definition)
|
47 |
throws CoordinateReferenceSystemException, ParseException { |
48 |
return new DefaultCoordinateTransformation(definition); |
49 |
} |
50 |
|
51 |
@Override
|
52 |
public void setCatalogManager(CRSCatalogManager manager) { |
53 |
this.catalogManager = manager;
|
54 |
} |
55 |
|
56 |
public CRSCatalogManager getCatalogManager() {
|
57 |
if( this.catalogManager == null ) { |
58 |
this.catalogManager = CRSCatalogLocator.getManager();
|
59 |
} |
60 |
return this.catalogManager; |
61 |
} |
62 |
|
63 |
} |