Examples of ReferenceIdentifier


Examples of org.opengis.referencing.ReferenceIdentifier

     * Returns a hash code value for this object.
     */
    @Override
    public int hashCode() {
        int code = (int) serialVersionUID;
        final ReferenceIdentifier id = referenceSystemIdentifier;
        if (id != null) {
            code ^= id.hashCode();
        }
        return code;
    }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

     */
    @Override
    public String toString() {
        final String code, codespace;
        final Citation authority;
        final ReferenceIdentifier id = referenceSystemIdentifier;
        if (id != null) {
            code      = id.getCode();
            codespace = id.getCodeSpace();
            authority = id.getAuthority();
        } else {
            code      = null;
            codespace = null;
            authority = null;
        }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

     * @return The metadata to be marshalled.
     */
    @XmlElementRef
    public ImmutableIdentifier getElement() {
        if (skip()) return null;
        final ReferenceIdentifier metadata = this.metadata;
        if (metadata instanceof ImmutableIdentifier) {
            return (ImmutableIdentifier) metadata;
        } else {
            return new ImmutableIdentifier(metadata);
        }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

    return result;
  }

  public static String getCRSDescription(CoordinateReferenceSystem crs) {
    if (crs != null) {
      ReferenceIdentifier name = crs.getName();
      return name.getCode();
    } else {
      return "Unknown";
    }
  }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

                LOG.log(Level.WARNING, "Unable to determine srs from crs: " + crs, e);
            }
        }
       
        if (crs != null && crs.getName() != null) {
            ReferenceIdentifier name = crs.getName();
            if (name instanceof GenericName) {
                obj.put("title", ((GenericName) name).tip().toString());
            } else {
                obj.put("title", name.toString());
            }
        }
       
        if (srs != null) {
            obj.put("srs", srs);
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        ensureNonNull("axes", axes);
        this.axes = axes = axes.clone();
        for (int i=0; i<axes.length; i++) {
            final CoordinateSystemAxis axis = axes[i];
            ensureNonNullElement("axes", i, axis);
            final ReferenceIdentifier name = axis.getName();
            ensureNonNullElement("axes[#].name", i, name);
            final AxisDirection direction = axis.getDirection();
            ensureNonNullElement("axes[#].direction", i, direction);
            final Unit<?> unit = axis.getUnit();
            ensureNonNullElement("axes[#].unit", i, unit);
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

        ArgumentChecks.ensureNonNull("object",     object);
        ArgumentChecks.ensureNonNull("toAppendTo", toAppendTo);
        final boolean isSummary = contentLevel == ContentLevel.NAME_SUMMARY;
        final ParameterDescriptorGroup descriptor;
        final ParameterValueGroup      values;
        final ReferenceIdentifier      name;
        if (object instanceof ParameterValueGroup) {
            values     = (ParameterValueGroup) object;
            descriptor = values.getDescriptor();
            name       = descriptor.getName();
        } else if (object instanceof ParameterDescriptorGroup) {
            descriptor = (ParameterDescriptorGroup) object;
            values     = null;
            name       = descriptor.getName();
        } else if (object instanceof OperationMethod) {
            final OperationMethod operation = (OperationMethod) object;
            descriptor = operation.getParameters();
            values     = null;
            name       = operation.getName();
        } else if (isSummary && object instanceof IdentifiedObject[]) {
            formatSummary((IdentifiedObject[]) object, toAppendTo);
            return;
        } else {
            throw new IllegalArgumentException(Errors.getResources(displayLocale)
                    .getString(Errors.Keys.UnsupportedType_1, object.getClass()));
        }
        if (isSummary) {
            final List<GeneralParameterDescriptor> parameters = descriptor.descriptors();
            formatSummary(parameters.toArray(new IdentifiedObject[parameters.size()]), toAppendTo);
        } else {
            format(name.getCode(), descriptor, values, toAppendTo);
        }
    }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

             * Put the first identifier in the first column. If no identifier has a codespace in the list
             * supplied by the user, then we will use the first identifier (any codespace) as a fallback.
             */
            final Set<ReferenceIdentifier> identifiers = object.getIdentifiers();
            if (identifiers != null) { // Paranoiac check.
                ReferenceIdentifier identifier = null;
                for (final ReferenceIdentifier candidate : identifiers) {
                    if (candidate != null) { // Paranoiac check.
                        if (isPreferredCodespace(candidate.getCodeSpace())) {
                            identifier = candidate;
                            break; // Format now.
                        }
                        if (identifier == null) {
                            identifier = candidate; // To be used as a fallback if we find nothing better.
                        }
                    }
                }
                if (identifier != null) {
                    row[0] = IdentifiedObjects.toString(identifier);
                    hasIdentifiers = true;
                }
            }
            /*
             * If the name's codespace is in the list of codespaces asked by the user, add that name
             * in the current row and clear the 'name' locale variable. Otherwise, keep the 'name'
             * locale variable in case we found no alias to format.
             */
            ReferenceIdentifier name = object.getName();
            if (name != null) { // Paranoiac check.
                final String codespace = name.getCodeSpace();
                if (isPreferredCodespace(codespace)) {
                    row = putIfAbsent(resources, row, columnIndices, codespace, name.getCode());
                    name = null;
                }
            }
            /*
             * Put all aliases having a codespace in the list asked by the user.
             */
            final Collection<GenericName> aliases = object.getAlias();
            if (aliases != null) { // Paranoiac check.
                for (final GenericName alias : aliases) {
                    if (alias != null) { // Paranoiac check.
                        final String codespace = NameToIdentifier.getCodespaceOrAuthority(alias, displayLocale);
                        if (isPreferredCodespace(codespace)) {
                            row = putIfAbsent(resources, row, columnIndices, codespace,
                                    alias.tip().toInternationalString().toString(displayLocale));
                            name = null;
                        }
                    }
                }
            }
            /*
             * If no name and no alias have a codespace in the list of codespaces asked by the user,
             * force the addition of primary name regardless its codespace.
             */
            if (name != null) {
                row = putIfAbsent(resources, row, columnIndices, name.getCodeSpace(), name.getCode());
            }
            rows.add(row);
        }
        /*
         * Writes the table. The header will contain one column for each codespace in the order declared
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

     */
    public static ReferenceIdentifier getIdentifier(final IdentifiedObject object, final Citation authority) {
        if (object != null) {
            final Iterator<ReferenceIdentifier> it = iterator(object.getIdentifiers());
            if (it != null) while (it.hasNext()) {
                final ReferenceIdentifier identifier = it.next();
                if (identifier != null) { // Paranoiac check.
                    if (authority == null || identifierMatches(authority, identifier.getAuthority())) {
                        return identifier;
                    }
                }
            }
        }
View Full Code Here

Examples of org.opengis.referencing.ReferenceIdentifier

     * @param  object The identified object, or {@code null}.
     * @return The first name, alias or identifier which is a valid Unicode identifier, or {@code null} if none.
     */
    public static String getUnicodeIdentifier(final IdentifiedObject object) {
        if (object != null) {
            ReferenceIdentifier identifier = object.getName();
            if (identifier != null) { // Paranoiac check.
                final String code = identifier.getCode();
                if (CharSequences.isUnicodeIdentifier(code)) {
                    return code;
                }
            }
            final Iterator<GenericName> it = iterator(object.getAlias());
            if (it != null) while (it.hasNext()) {
                GenericName alias = it.next();
                if (alias != null && (alias = alias.tip()) != null) {
                    final String code = alias.toString();
                    if (CharSequences.isUnicodeIdentifier(code)) {
                        return code;
                    }
                }
            }
            final Iterator<ReferenceIdentifier> id = iterator(object.getIdentifiers());
            if (id != null) while (id.hasNext()) {
                identifier = id.next();
                if (identifier != null) { // Paranoiac check.
                    final String code = identifier.getCode();
                    if (CharSequences.isUnicodeIdentifier(code)) {
                        return code;
                    }
                }
            }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.