Package org.opengis.metadata

Examples of org.opengis.metadata.Identifier


        }
        /*
         * Maybe the user overridden some object creation
         * methods with a value for the supplied code.
         */
        final Identifier identifier = createObject(code).getName();
        if (identifier instanceof GenericName) {
            return ((GenericName) identifier).toInternationalString();
        }
        return new SimpleInternationalString(identifier.getCode());
    }
View Full Code Here


                    where      = "ELLIPSOID_CODE";
                } else {
                    return super.getCodeCandidates(object);
                }
                dependency = buffered.getIdentifiedObjectFinder(dependency.getClass()).find(dependency);
                Identifier id = AbstractIdentifiedObject.getIdentifier(dependency, getAuthority());
                if (id == null || (code = id.getCode()) == null) {
                    return super.getCodeCandidates(object);
                }
            }
            String sql = "SELECT " + select + " FROM " + from + " WHERE " + where + "='" + code + '\'';
            sql = adaptSQL(sql);
View Full Code Here

        String asString = identifiers.toString();
        assertTrue(asString, identifiers.contains(new NamedIdentifier(Citations.ESRI, "30591")));
        assertTrue(asString, identifiers.contains(new NamedIdentifier(Citations.EPSG, "30591")));

        final Iterator iterator = identifiers.iterator();
        Identifier identifier;

        // Checks the first identifier.
        assertTrue(iterator.hasNext());
        identifier = (Identifier) iterator.next();
        assertTrue(identifier instanceof NamedIdentifier);
        assertEquals(Citations.ESRI, identifier.getAuthority());
        assertEquals("30591", identifier.getCode());
        assertEquals("ESRI:30591", identifier.toString());

        // Checks the second identifier.
        assertTrue(iterator.hasNext());
        identifier = (Identifier) iterator.next();
        assertTrue(identifier instanceof NamedIdentifier);
        assertEquals(Citations.EPSG, identifier.getAuthority());
        assertEquals("30591", identifier.getCode());
        assertEquals("EPSG:30591", identifier.toString());
    }
View Full Code Here

    // looking for an EPSG code
    final Set<? extends Identifier> identifiers = obj.getIdentifiers();
    final Iterator<? extends Identifier> it = identifiers.iterator();
    String code = "";
    while (it.hasNext()) {
      final Identifier identifier = it.next();
      final Citation cite = identifier.getAuthority();
      if (Citations.identifierMatches(cite, "EPSG")) {
        code = identifier.getCode();
        break;
      }
    }

    try {
View Full Code Here

            }
            /*
             * Format the element name, including all alias (if any).
             * Each alias will be formatted on its own line.
             */
            final Identifier identifier = generalDescriptor.getName();
            table.write(identifier.getCode());
            alias = generalDescriptor.getAlias();
            if (alias != null) {
                for (final GenericName a : alias) {
                    if (!identifier.equals(a)) {
                        table.write(lineSeparator);
                        table.write(a.tip().toInternationalString().toString(locale));
                    }
                }
            }
View Full Code Here

        }
        if (value instanceof Identifier[]) {
            final Identifier[] values = (Identifier[]) value;
            final GenericName[] names = new GenericName[values.length];
            for( int i=0; i<values.length; i++) {
                final Identifier v = values[i];
                names[i] = (v instanceof GenericName) ? (GenericName)v : create(v.getCode());
            }
            return names;
        }
        // TODO: localize
        throw new ClassCastException("Cannot convert " + Classes.getShortClassName(value) + " to GenericName[]");
View Full Code Here

    Iterator<? extends Identifier> idents = identObj.getIdentifiers().iterator();
    if (!idents.hasNext()) {
        System.out.println("    no extra identifiers");
    } else {
        for (int i = 0; idents.hasNext(); i++) {
            Identifier ident = idents.next();
            System.out.println("    identifier(" + i + ").getCode() - " + ident.getCode());
            System.out
                    .println("    identifier(" + i + ").getAuthority() - " + ident.getAuthority());
        }
    }
}
View Full Code Here

        /*
         * Now performs the real work.
         */
        final CoordinateOperationAuthorityFactory authorityFactory = getAuthorityFactory();
        final Citation  authority = authorityFactory.getAuthority();
        final Identifier sourceID = AbstractIdentifiedObject.getIdentifier(sourceCRS, authority);
        if (sourceID == null) {
            return null;
        }
        final Identifier targetID = AbstractIdentifiedObject.getIdentifier(targetCRS, authority);
        if (targetID == null) {
            return null;
        }
        final String sourceCode = sourceID.getCode().trim();
        final String targetCode = targetID.getCode().trim();
        if (sourceCode.equals(targetCode)) {
            /*
             * NOTE: This check is mandatory because this method may be invoked in some situations
             *       where (sourceCode == targetCode) but (sourceCRS != targetCRS). Such situation
             *       should be illegal  (or at least the MathTransform from sourceCRS to targetCRS
View Full Code Here

    /**
     * Implementation of {@link #getName(Citation)}.
     */
    private static String getName0(final IdentifiedObject info, final Citation authority) {
        Identifier identifier = info.getName();
        if (authority == null) {
            return identifier.getCode();
        }
        String name = null;
        Citation infoAuthority = identifier.getAuthority();
        if (infoAuthority != null) {
            if (Citations.identifierMatches(authority, infoAuthority)) {
                name = identifier.getCode();
            } else {
                for (final GenericName alias : info.getAlias()) {
                    if (alias instanceof Identifier) {
                        identifier = (Identifier) alias;
                        infoAuthority = identifier.getAuthority();
                        if (infoAuthority != null) {
                            if (Citations.identifierMatches(authority, infoAuthority)) {
                                name = identifier.getCode();
                                break;
                            }
                        }
                    } else {
                        final GenericName scope = alias.scope().name();
View Full Code Here

     * @since 2.5
     */
    public String getName() {
        final ParameterDescriptorGroup descriptor = getParameterDescriptors();
        if (descriptor != null) {
            final Identifier identifier = descriptor.getName();
            if (identifier != null) {
                final String code = identifier.getCode();
                if (code != null) {
                    return code;
                }
            }
        }
View Full Code Here

TOP

Related Classes of org.opengis.metadata.Identifier

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.