ExtendedImagingParameterDescriptors( String operationName, RegistryElementDescriptor operation, Collection<ParameterDescriptor> extension) { super(operation, extension); this.operationName = new NamedIdentifier(Citations.JAI, operationName); }
NamedIdentifier identifier = new NamedIdentifier(properties); assertEquals("code", "This is a code", identifier.getCode()); assertEquals( "authority", "This is an authority", identifier.getAuthority().getTitle().toString()); assertEquals("version", "This is a version", identifier.getVersion()); assertEquals( "remarks", "There is remarks", identifier.getRemarks().toString(Locale.ENGLISH)); assertEquals( "remarks_fr", "Voici des remarques", identifier.getRemarks().toString(Locale.FRENCH)); assertEquals( "remarks_fr_CA", "Pareil", identifier.getRemarks().toString(Locale.CANADA_FRENCH)); assertEquals( "remarks_fr_BE", "Voici des remarques", identifier.getRemarks().toString(new Locale("fr", "BE"))); identifier = new NamedIdentifier(properties); assertEquals( "authority", "An other authority", identifier.getAuthority().getTitle().toString(Locale.ENGLISH)); identifier = new NamedIdentifier(properties); fail(); } catch (InvalidParameterValueException exception) {
private void writeCrsLegacy(final GeoJSONBuilder jsonWriter, CoordinateReferenceSystem crs) { // Coordinate Reference System, currently only if the namespace is // EPSG if (crs != null) { Set<ReferenceIdentifier> ids = crs.getIdentifiers(); // WKT defined crs might not have identifiers at all if (ids != null && ids.size() > 0) { NamedIdentifier namedIdent = (NamedIdentifier) ids.iterator().next(); String csStr = namedIdent.getCodeSpace().toUpperCase(); if (csStr.equals("EPSG")) { jsonWriter.key("crs"); jsonWriter.object(); jsonWriter.key("type").value(csStr); jsonWriter.key("properties"); jsonWriter.object(); jsonWriter.key("code"); jsonWriter.value(namedIdent.getCode()); jsonWriter.endObject(); // end properties jsonWriter.endObject(); // end crs } } } }
ensureNonNull("properties", properties); Object code = null; Object codespace = null; codespace = getCodeSpace((Citation) authority); throw e; ensureNonNull(CODE_KEY, code);
SRID = 4326; } else { String code = ((NamedIdentifier) ident.toArray()[0]).getCode(); SRID = Integer.parseInt(code);
public static ReferenceIdentifier[] getIdentifiers(final String nameIdentifier) { if (nameIdentifier.equalsIgnoreCase("WGS84")) { final ReferenceIdentifier[] identifiers = { new NamedIdentifier(Citations.OGC, "WGS84"), new NamedIdentifier(Citations.ORACLE, "WGS 84"), new NamedIdentifier(null, "WGS_84"), new NamedIdentifier(null, "WGS 1984"), new NamedIdentifier(Citations.EPSG, "WGS_1984"), new NamedIdentifier(Citations.ESRI, "D_WGS_1984"), new NamedIdentifier(Citations.EPSG, "World Geodetic System 1984") }; return identifiers; } // TODO: Handle mores return null; }
/** Constructs a new provider. */ public Provider_SouthOrientated() { super( createDescriptorGroup( new NamedIdentifier[] { new NamedIdentifier( Citations.EPSG, "Transverse Mercator (South Orientated)"), new NamedIdentifier(Citations.EPSG, "9808") })); }
/** * Constructs a parameter group from a name and an authority. This parameter group will be * required exactly once. * * @param authority The authority (e.g. {@link org.geotools.metadata.iso.citation.Citations#OGC * OGC}). * @param name The parameter group name. * @param parameters The {@linkplain #descriptors() parameter descriptors} for this group. * @since 2.2 */ public DefaultParameterDescriptorGroup( final Citation authority, final String name, final GeneralParameterDescriptor[] parameters) { this(Collections.singletonMap(NAME_KEY, new NamedIdentifier(authority, name)), parameters); }
static Map<String, Object> buildProperties(String name, Citation authority, String code) { Map<String, Object> props = new HashMap<String, Object>(); props.put(IdentifiedObject.NAME_KEY, name); props.put(IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier(authority, code)); return props; }
static Map<String, ?> buildProperties(String name, Citation authority, String code) { Map<String, Object> props = new HashMap<String, Object>(); props.put(IdentifiedObject.NAME_KEY, name); props.put(IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier(authority, code)); return props; }
/** Constructs the parameters group. */ static ParameterDescriptorGroup createDescriptorGroup( final String ogc, final String epsgName, final String epsgCode, final int geotools) { return createDescriptorGroup( new NamedIdentifier[] { new NamedIdentifier(Citations.OGC, ogc), new NamedIdentifier(Citations.EPSG, epsgName), new NamedIdentifier(Citations.EPSG, epsgCode), new NamedIdentifier( Citations.GEOTOOLS, Vocabulary.formatInternational(geotools)) }, new ParameterDescriptor[] {SEMI_MAJOR, SEMI_MINOR, DIM}); }
/** Creates a parameters group. */ static ParameterDescriptorGroup createDescriptorGroup( final String name, final String code) { return createDescriptorGroup( new NamedIdentifier[] { new NamedIdentifier(Citations.EPSG, name), new NamedIdentifier(Citations.EPSG, code) }, new ParameterDescriptor[] { DX, DY, DZ, EX, EY, EZ, PPM, SRC_SEMI_MAJOR, SRC_SEMI_MINOR, TGT_SEMI_MAJOR, TGT_SEMI_MINOR, SRC_DIM, TGT_DIM }); }
/** Add the authority code to the specified properties, if not already present. */ @Override protected Map<String, Object> alterProperties(Map<String, Object> properties) { Object candidate = properties.get(IdentifiedObject.IDENTIFIERS_KEY); if (candidate == null && code != null) { properties = new HashMap<String, Object>(properties); code = trimAuthority(code); final Object identifiers; if (authorities.length <= 1) { identifiers = new NamedIdentifier(authority, code); } else { final NamedIdentifier[] ids = new NamedIdentifier[authorities.length]; for (int i = 0; i < ids.length; i++) { ids[i] = new NamedIdentifier(authorities[i], code); } identifiers = ids; } properties.put(IdentifiedObject.IDENTIFIERS_KEY, identifiers); } return super.alterProperties(properties); } }
/** * Returns the TM_ReferenceSystem associated with this TM_TemporalPosition, if not specified, it * is assumed to be an association to the Gregorian calendar and UTC. * * @return */ public TemporalReferenceSystem getFrame() { if (frame == null) { frame = new DefaultTemporalReferenceSystem( new NamedIdentifier( Citations.CRS, new SimpleInternationalString("Gregorian calendar")), null); } return frame; }
IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier[] { new NamedIdentifier(authority, text), new NamedIdentifier(authority, PREFIX + text) }); final CoordinateReferenceSystem crs =
/** * Returns the properties to be given to an identified object derived from the specified one. * This method is typically used for creating a new CRS identical to an existing one except for * axis units. This method returns the same properties than the supplied argument (as of <code> * {@linkplain #getProperties(IdentifiedObject) getProperties}(info)</code>), except for the * following: * * <p> * * <ul> * <li>The {@linkplain #getName() name}'s authority is replaced by the specified one. * <li>All {@linkplain #getIdentifiers identifiers} are removed, because the new object to be * created is probably not endorsed by the original authority. * </ul> * * <p>This method returns a mutable map. Consequently, callers can add their own identifiers * directly to this map if they wish. * * @param info The identified object to view as a properties map. * @param authority The new authority for the object to be created, or {@code null} if it is not * going to have any declared authority. * @return An view of the identified object as a mutable map. */ public static Map<String, Object> getProperties( final IdentifiedObject info, final Citation authority) { final Map<String, Object> properties = new HashMap<String, Object>(getProperties(info)); properties.put(NAME_KEY, new NamedIdentifier(authority, info.getName().getCode())); properties.remove(IDENTIFIERS_KEY); return properties; }
final Citation authority = getAuthority(); if (name != null) { properties.put(IdentifiedObject.NAME_KEY, new NamedIdentifier(authority, name.trim())); properties.put( IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier(authority, code.trim(), version));
final Citation authority = getAuthority(); if (name != null) { properties.put(IdentifiedObject.NAME_KEY, new NamedIdentifier(authority, name.trim())); properties.put( IdentifiedObject.IDENTIFIERS_KEY, new NamedIdentifier(authority, code.trim(), version));
@Before public void setUp() { NamedIdentifier name1 = new NamedIdentifier(Citations.CRS, "Ordinal1"); NamedIdentifier name2 = new NamedIdentifier(Citations.CRS, "Ordinal2"); ordinalReferenceSystem1 = new DefaultOrdinalReferenceSystem(name1, null, null); ordinalReferenceSystem2 = new DefaultOrdinalReferenceSystem(name2, null, null); }
@Before public void setUp() { NamedIdentifier name1 = new NamedIdentifier(Citations.CRS, "Gregorian calendar"); NamedIdentifier name2 = new NamedIdentifier(Citations.CRS, "Julian calendar"); calendar1 = new DefaultCalendar(name1, null); calendar2 = new DefaultCalendar(name2, null); }