/** * Creates an ellipsoidal coordinate system from a code. * * @throws FactoryException if the object creation failed. */ @Override public EllipsoidalCS createEllipsoidalCS(final String code) throws FactoryException { return (EllipsoidalCS) replace( getCSAuthorityFactory(code) .createEllipsoidalCS(toBackingFactoryCode(code))); }
public EllipsoidalCS createEllipsoidalCS(String code) throws FactoryException { final String key = toKey(code); EllipsoidalCS cs = (EllipsoidalCS) cache.get(key); if (cs == null) { try { cache.writeLock(key); cs = (EllipsoidalCS) cache.peek(key); if (cs == null) { cs = csAuthority.createEllipsoidalCS(code); cache.put(key, cs); } } finally { cache.writeUnLock(key); } } return cs; }
@Override EllipsoidalCS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { return csFactory(factory).createEllipsoidalCS(code); } };
@Override EllipsoidalCS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { return csFactory(factory).createEllipsoidalCS(code); } };
/** Tries to creates the coordinate system from EPSG code. */ private boolean tryEPSG(final Decoder decoder) throws FactoryException { super.candidate(decoder); // Initialize the datum. final Integer epsg = epsgCandidate(Units.DEGREE); if (epsg != null) try { coordinateSystem = decoder.getCSAuthorityFactory().createEllipsoidalCS(epsg.toString()); return true; } catch (NoSuchAuthorityCodeException e) { recoverableException(e); } return false; }
/** * Returns a coordinate system (CS) with the same axis directions than the given CS but potentially different units. * If a coordinate system exists in the EPSG database with the requested characteristics, that CS will be returned * in order to have a richer set of metadata (name, minimal and maximal values, <i>etc</i>). Otherwise an CS with * an arbitrary name will be returned. * * @see CoordinateSystems#replaceAngularUnit(CoordinateSystem, Unit) */ private EllipsoidalCS replaceAngularUnit(final EllipsoidalCS cs, final Unit<Angle> unit) throws FactoryException { final Integer epsg = CoordinateSystems.getEpsgCode(unit, CoordinateSystems.getAxisDirections(cs)); if (epsg != null) try { return getCSAuthorityFactory().createEllipsoidalCS(epsg.toString()); } catch (NoSuchAuthorityCodeException e) { reader.owner.warning(null, e); } return (EllipsoidalCS) CoordinateSystems.replaceAngularUnit(cs, unit); }