root / org.gvsig.projection.jcrs / trunk / org.gvsig.projection.jcrs / org.gvsig.projection.jcrs.lib / src / main / java / org / gvsig / crs / repository / Iau2000RepositoryGT.java @ 229
History | View | Annotate | Download (1.11 KB)
1 | 147 | jjdelcerro | package org.gvsig.crs.repository; |
---|---|---|---|
2 | |||
3 | import org.geotools.referencing.CRS; |
||
4 | import org.opengis.referencing.FactoryException; |
||
5 | import org.opengis.referencing.NoSuchAuthorityCodeException; |
||
6 | import org.opengis.referencing.crs.CoordinateReferenceSystem; |
||
7 | import org.slf4j.Logger; |
||
8 | import org.slf4j.LoggerFactory; |
||
9 | |||
10 | import org.gvsig.crs.CrsGT; |
||
11 | import org.gvsig.crs.ICrs; |
||
12 | |||
13 | public class Iau2000RepositoryGT implements ICrsRepository { |
||
14 | |||
15 | 229 | jjdelcerro | private static final Logger LOG |
16 | = LoggerFactory.getLogger(Iau2000RepositoryGT.class); |
||
17 | |||
18 | public ICrs getCrs(String code) { |
||
19 | CrsGT crsGT = null;
|
||
20 | try {
|
||
21 | CoordinateReferenceSystem crs = CRS.decode("IAU2000:" + code);
|
||
22 | crsGT = new CrsGT(crs);
|
||
23 | } catch (NoSuchAuthorityCodeException e) {
|
||
24 | LOG.debug("Can't get the CRS '"+code+"' authority 'IAU2000' in GT repository. No such authority code"); |
||
25 | return null; |
||
26 | } catch (FactoryException e) {
|
||
27 | LOG.debug("Can't get the CRS '"+code+"' authority 'IAU2000' in GT repository", e); |
||
28 | return null; |
||
29 | } |
||
30 | return crsGT;
|
||
31 | } |
||
32 | |||
33 | 147 | jjdelcerro | } |