root / org.gvsig.jcrs / libJCRS / src / org / gvsig / crs / repository / Iau2000RepositoryGT.java @ 38
History | View | Annotate | Download (947 Bytes)
1 |
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 |
private static final Logger LOG = |
15 |
LoggerFactory.getLogger(Iau2000RepositoryGT.class); |
16 |
|
17 |
public ICrs getCrs(String code) { |
18 |
CrsGT crsGT = null;
|
19 |
try {
|
20 |
CoordinateReferenceSystem crs = CRS.decode("IAU2000:"+code);
|
21 |
crsGT = new CrsGT(crs);
|
22 |
} catch (NoSuchAuthorityCodeException e) {
|
23 |
LOG.error("Impossible to get the CRS", e);
|
24 |
return null; |
25 |
} catch (FactoryException e) {
|
26 |
LOG.error("Impossible to get the CRS", e);
|
27 |
return null; |
28 |
} |
29 |
return crsGT;
|
30 |
} |
31 |
|
32 |
} |