/** * Creates a cartesian coordinate system from a code. * * @throws FactoryException if the object creation failed. */ @Override public CartesianCS createCartesianCS(final String code) throws FactoryException { return (CartesianCS) replace(getCSAuthorityFactory(code).createCartesianCS(toBackingFactoryCode(code))); }
public CartesianCS createCartesianCS(String code) throws FactoryException { final String key = toKey(code); CartesianCS cs = (CartesianCS) cache.get(key); if (cs == null) { try { cache.writeLock(key); cs = (CartesianCS) cache.peek(key); if (cs == null) { cs = csAuthority.createCartesianCS(code); cache.put(key, cs); } } finally { cache.writeUnLock(key); } } return cs; }
@Override CartesianCS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { return csFactory(factory).createCartesianCS(code); } };
@Override CartesianCS createFromAPI(AuthorityFactory factory, String code) throws FactoryException { return csFactory(factory).createCartesianCS(code); } };
/** * 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#replaceLinearUnit(CoordinateSystem, Unit) */ private CartesianCS replaceLinearUnit(final CartesianCS cs, final Unit<Length> unit) throws FactoryException { final Integer epsg = CoordinateSystems.getEpsgCode(unit, CoordinateSystems.getAxisDirections(cs)); if (epsg != null) try { return getCSAuthorityFactory().createCartesianCS(epsg.toString()); } catch (NoSuchAuthorityCodeException e) { reader.owner.warning(null, e); } return (CartesianCS) CoordinateSystems.replaceLinearUnit(cs, unit); }
final GeographicCRS baseCRS = createGeographicCRS(false, angularUnit); final Conversion projection = createConversion(name, angularUnit, linearUnit); CartesianCS cs = getCSAuthorityFactory().createCartesianCS(String.valueOf(Constants.EPSG_PROJECTED_CS)); if (!Units.METRE.equals(linearUnit)) { cs = replaceLinearUnit(cs, linearUnit);