/** * Creates a {@linkplain VerticalDatum vertical datum} from a code. The default implementation * invokes <code>{@linkplain #createDatum createDatum}(code)</code>. * * @param code Value allocated by authority. * @return The datum for the given code. * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found. * @throws FactoryException if the object creation failed for some other reason. * @see #createVerticalCRS */ public VerticalDatum createVerticalDatum(final String code) throws NoSuchAuthorityCodeException, FactoryException { final Datum datum = createDatum(code); try { return (VerticalDatum) datum; } catch (ClassCastException exception) { throw noSuchAuthorityCode(VerticalDatum.class, code, exception); } }
/** * Creates a {@linkplain TemporalDatum temporal datum} from a code. The default implementation * invokes <code>{@linkplain #createDatum createDatum}(code)</code>. * * @param code Value allocated by authority. * @return The datum for the given code. * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found. * @throws FactoryException if the object creation failed for some other reason. * @see #createTemporalCRS */ public TemporalDatum createTemporalDatum(final String code) throws NoSuchAuthorityCodeException, FactoryException { final Datum datum = createDatum(code); try { return (TemporalDatum) datum; } catch (ClassCastException exception) { throw noSuchAuthorityCode(TemporalDatum.class, code, exception); } }
/** * Creates a {@linkplain EngineeringDatum engineering datum} from a code. The default * implementation invokes <code>{@linkplain #createDatum createDatum}(code)</code>. * * @param code Value allocated by authority. * @return The datum for the given code. * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found. * @throws FactoryException if the object creation failed for some other reason. * @see #createEngineeringCRS */ public EngineeringDatum createEngineeringDatum(final String code) throws NoSuchAuthorityCodeException, FactoryException { final Datum datum = createDatum(code); try { return (EngineeringDatum) datum; } catch (ClassCastException exception) { throw noSuchAuthorityCode(EngineeringDatum.class, code, exception); } }
/** * Creates a {@linkplain ImageDatum image datum} from a code. The default implementation invokes * <code>{@linkplain #createDatum createDatum}(code)</code>. * * @param code Value allocated by authority. * @return The datum for the given code. * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found. * @throws FactoryException if the object creation failed for some other reason. * @see #createImageCRS */ public ImageDatum createImageDatum(final String code) throws NoSuchAuthorityCodeException, FactoryException { final Datum datum = createDatum(code); try { return (ImageDatum) datum; } catch (ClassCastException exception) { throw noSuchAuthorityCode(ImageDatum.class, code, exception); } }
/** * Returns a {@linkplain GeodeticDatum geodetic datum} from a code. The default implementation * invokes <code>{@linkplain #createDatum createDatum}(code)</code>. * * @param code Value allocated by authority. * @return The datum for the given code. * @throws NoSuchAuthorityCodeException if the specified {@code code} was not found. * @throws FactoryException if the object creation failed for some other reason. * @see #createEllipsoid * @see #createPrimeMeridian * @see #createGeographicCRS * @see #createProjectedCRS */ public GeodeticDatum createGeodeticDatum(final String code) throws NoSuchAuthorityCodeException, FactoryException { final Datum datum = createDatum(code); try { return (GeodeticDatum) datum; } catch (ClassCastException exception) { throw noSuchAuthorityCode(GeodeticDatum.class, code, exception); } }
/** * Returns an arbitrary {@linkplain org.opengis.referencing.datum.Datum datum} from a code. * * @throws FactoryException if the object creation failed for all factories. */ @Override public org.opengis.referencing.datum.Datum createDatum(final String code) throws FactoryException { try { return super.createDatum(code); } catch (FactoryException exception) { notifyFailure("createDatum", exception); try { return fallback.createDatum(code); } catch (NoSuchAuthorityCodeException ignore) { throw exception; } } }
/** Returns an arbitrary datum from a code. */ @Override public synchronized Datum createDatum(final String code) throws FactoryException { final Datum datum; final String key = trimAuthority(code); final Object cached = objectCache.get(key); if (cached instanceof Datum) { datum = (Datum) cached; } else { datum = getBackingStore().createDatum(code); } objectCache.put(key, datum); return datum; }
/** * Returns an arbitrary datum from a code. * * @throws FactoryException if the object creation failed. */ @Override public synchronized Datum createDatum(final String code) throws FactoryException { final Datum datum; final String key = trimAuthority(code); final Object cached = get(key); if (cached instanceof Datum) { datum = (Datum) cached; } else { datum = getBackingStore().createDatum(code); } put(key, datum); return datum; }
return buffered.createCoordinateSystemAxis(code); case 3: return buffered.createDatum(code); case 4: return buffered.createEllipsoid(code);