/** * Return a list of supported codes according an registryName. * * @param registryName (ex : EPSG, IGNF, ESRI) */ public Set<String> getSupportedCodes(String registryName) throws RegistryException { return getRegistryManager().getRegistry(registryName).getSupportedCodes(); }
/** * Returns a {@link org.cts.crs.CoordinateReferenceSystem} corresponding to * an authority and a srid. * * @param authorityAndSrid the code of the desired CRS (for instance * EPSG:4326 or IGNF:LAMBE) * @return * @throws CRSException */ public CoordinateReferenceSystem getCRS(String authorityAndSrid) throws CRSException { CoordinateReferenceSystem crs = CRSPOOL.get(authorityAndSrid.toUpperCase()); if (crs == null) { try { String[] registryNameWithCode = splitRegistryNameAndCode(authorityAndSrid); String authority = registryNameWithCode[0]; String code = registryNameWithCode[1]; if (isRegistrySupported(authority)) { Registry registry = getRegistryManager().getRegistry(authority); crs = registry.getCoordinateReferenceSystem(new Identifier(authority, code, "")); if (crs != null) { CRSPOOL.put(authorityAndSrid.toUpperCase(), crs); } } } catch (RegistryException ex) { throw new CRSException("Cannot create the CRS", ex); } } return crs; }