Revision 229 org.gvsig.projection.jcrs/trunk/org.gvsig.projection.jcrs/org.gvsig.projection.jcrs.lib/src/main/java/org/gvsig/crs/repository/EpsgRepositoryGT.java

View differences:

EpsgRepositoryGT.java
37 37
 *
38 38
 *   +34 967 599 200
39 39
 */
40

  
41 40
package org.gvsig.crs.repository;
42 41

  
43

  
44 42
import org.geotools.referencing.CRS;
45 43
import org.opengis.referencing.FactoryException;
46 44
import org.opengis.referencing.NoSuchAuthorityCodeException;
......
53 51

  
54 52
/**
55 53
 * Repositorio de CRSs de EPSG basado en Geotools.
56
 * 
54
 *
57 55
 * @author Diego Guerrero Sevilla (diego.guerrero@uclm.es)
58 56
 *
59 57
 */
60

  
61 58
public class EpsgRepositoryGT implements ICrsRepository {
62
    private static final Logger LOG =
63
        LoggerFactory.getLogger(EpsgRepositoryGT.class); 
64
    
65
	public ICrs getCrs(String code) {
66
		CrsGT crsGT = null;
67
		try {
68
			CoordinateReferenceSystem crs = CRS.decode("EPSG:"+code);
69
			crsGT = new CrsGT(crs);
70
		} catch (NoSuchAuthorityCodeException e) {
71
			LOG.info("CRS not found in GT repository: " + code);
72
			return null;			
73
		} catch (FactoryException e) {
74
            LOG.info("CRS not found in GT repository: " + code);
75
			return null;
76
		}
77
		return crsGT;
78
	}
79 59

  
60
    private static final Logger LOG
61
            = LoggerFactory.getLogger(EpsgRepositoryGT.class);
62

  
63
    public ICrs getCrs(String code) {
64
        CrsGT crsGT = null;
65
        try {
66
            CoordinateReferenceSystem crs = CRS.decode("EPSG:" + code);
67
            crsGT = new CrsGT(crs);
68
        } catch (NoSuchAuthorityCodeException e) {
69
            LOG.debug("Can't get the CRS '"+code+"', authority 'EPSG' in GT repository. No such authority code");
70
            return null;
71
        } catch (FactoryException e) {
72
            LOG.debug("Can't get the CRS '"+code+"', authority 'EPSG' in GT repository", e);
73
            return null;
74
        }
75
        return crsGT;
76
    }
77

  
80 78
}

Also available in: Unified diff