/** * Creates a temporal datum from an enumerated type value. * * @param properties Name and other properties to give to the new object. * @param origin The date and time origin of this temporal datum. * @throws FactoryException if the object creation failed. */ public synchronized TemporalDatum createTemporalDatum( final Map<String, ?> properties, final Date origin) throws FactoryException { return getDatumFactory().createTemporalDatum(addAliases(properties), origin); }
/** * Constructs a new datum factory using the specified factory and the default alias table. * * @param factory The factory to use for datum creation. */ public DatumAliases(final DatumFactory factory) { this(); this.factory = factory; ensureNonNull("factory", factory); }
ensureNonNull("properties", properties); Object value = properties.get(IdentifiedObject.NAME_KEY); ensureNonNull("name", value); final String name; if (value instanceof Identifier) { name = value.toString(); GenericName[] aliases = getAliases(name); if (aliases != null) { if (value != null) { final Map<String, GenericName> merged = new LinkedHashMap<String, GenericName>(); putAll(NameFactory.toArray(value), merged); count -= putAll(aliases, merged); final Collection<GenericName> c = merged.values(); aliases = c.toArray(new GenericName[c.size()]);
if (aliasMap.isEmpty()) try { reload(); } catch (IOException exception) { log(exception); name = toCaseless(name); Object[] aliases = aliasMap.get(name); if (aliases == null) { reload(); } catch (IOException exception) { log(exception); for (int i = 0; i < names.length; i++) { final String alias = names[i].tip().toString(); final Object[] previous = aliasMap.put(toCaseless(alias), names); assert previous == names || Arrays.equals(aliases, previous) : alias;
String line = readLine(in); if (line != null) { final List<Object> elements = new ArrayList<Object>(); while ((line = readLine(in)) != null) { elements.clear(); canonical.clear(); for (int i = 0; i < names.length; i++) { final String name = names[i]; final String key = toCaseless(name); final Object[] previous = aliasMap.put(key, names); if (previous != null && previous != NEED_LOADING) {
switch (i) { case 0: factory = new DatumAliases(factory); break; case 1: break; case 2: ((DatumAliases) factory).freeUnused(); break; default: assertEquals(4, aliases.size()); ((DatumAliases) factory).freeUnused(); datum = factory.createGeodeticDatum(
/** * Creates an engineering datum. * * @param properties Name and other properties to give to the new object. * @throws FactoryException if the object creation failed. */ public synchronized EngineeringDatum createEngineeringDatum(final Map<String, ?> properties) throws FactoryException { return getDatumFactory().createEngineeringDatum(addAliases(properties)); }
/** * Constructs a new datum factory which delegates its work to the specified factory. The aliases * table is read from the specified URL. The fist line in this file most be the authority names. * All other names are aliases. * * @param factory The factory to use for datum creation. * @param aliasURL The url to the alias table. */ public DatumAliases(final DatumFactory factory, final URL aliasURL) { super(NORMAL_PRIORITY + 10); this.factory = factory; this.aliasURL = aliasURL; ensureNonNull("factory", factory); ensureNonNull("aliasURL", aliasURL); }
/** * Creates a vertical datum from an enumerated type value. * * @param properties Name and other properties to give to the new object. * @param type The type of this vertical datum (often “geoidal”). * @throws FactoryException if the object creation failed. */ public synchronized VerticalDatum createVerticalDatum( final Map<String, ?> properties, final VerticalDatumType type) throws FactoryException { return getDatumFactory().createVerticalDatum(addAliases(properties), type); }
/** * Creates an image datum. * * @param properties Name and other properties to give to the new object. * @param pixelInCell Specification of the way the image grid is associated with the image data * attributes. * @throws FactoryException if the object creation failed. */ public synchronized ImageDatum createImageDatum( final Map<String, ?> properties, final PixelInCell pixelInCell) throws FactoryException { return getDatumFactory().createImageDatum(addAliases(properties), pixelInCell); }
/** * Creates a prime meridian, relative to Greenwich. * * @param properties Name and other properties to give to the new object. * @param longitude Longitude of prime meridian in supplied angular units East of Greenwich. * @param angularUnit Angular units of longitude. * @throws FactoryException if the object creation failed. */ public synchronized PrimeMeridian createPrimeMeridian( final Map<String, ?> properties, final double longitude, final Unit<Angle> angularUnit) throws FactoryException { return getDatumFactory() .createPrimeMeridian(addAliases(properties), longitude, angularUnit); }
/** * Creates geodetic datum from ellipsoid and (optionaly) Bursa-Wolf parameters. * * @param properties Name and other properties to give to the new object. * @param ellipsoid Ellipsoid to use in new geodetic datum. * @param primeMeridian Prime meridian to use in new geodetic datum. * @throws FactoryException if the object creation failed. */ public synchronized GeodeticDatum createGeodeticDatum( final Map<String, ?> properties, final Ellipsoid ellipsoid, final PrimeMeridian primeMeridian) throws FactoryException { return getDatumFactory() .createGeodeticDatum(addAliases(properties), ellipsoid, primeMeridian); }
/** * Creates an ellipsoid from radius values. * * @param properties Name and other properties to give to the new object. * @param semiMajorAxis Equatorial radius in supplied linear units. * @param semiMinorAxis Polar radius in supplied linear units. * @param unit Linear units of ellipsoid axes. * @throws FactoryException if the object creation failed. */ public synchronized Ellipsoid createEllipsoid( final Map<String, ?> properties, final double semiMajorAxis, final double semiMinorAxis, final Unit<Length> unit) throws FactoryException { return getDatumFactory() .createEllipsoid(addAliases(properties), semiMajorAxis, semiMinorAxis, unit); }
/** * Creates an ellipsoid from an major radius, and inverse flattening. * * @param properties Name and other properties to give to the new object. * @param semiMajorAxis Equatorial radius in supplied linear units. * @param inverseFlattening Eccentricity of ellipsoid. * @param unit Linear units of major axis. * @throws FactoryException if the object creation failed. */ public synchronized Ellipsoid createFlattenedSphere( final Map<String, ?> properties, final double semiMajorAxis, final double inverseFlattening, final Unit<Length> unit) throws FactoryException { return getDatumFactory() .createFlattenedSphere( addAliases(properties), semiMajorAxis, inverseFlattening, unit); }