Search in sources :

Example 46 with GenericName

use of org.opengis.util.GenericName in project collect by openforis.

the class GeoToolsCoordinateOperations method getDescription.

/**
 * It returns a concatenation of datum, aliases and scope
 */
private String getDescription(CoordinateReferenceSystem crs) {
    List<String> parts = new ArrayList<String>();
    // datum
    if (crs instanceof AbstractSingleCRS) {
        Datum datum = ((AbstractSingleCRS) crs).getDatum();
        String datumName = datum.getName().toString();
        parts.add(datumName);
    }
    // aliases
    for (GenericName genericName : crs.getAlias()) {
        parts.add(genericName.toString());
    }
    // scope
    InternationalString scope = crs.getScope();
    if (scope != null && StringUtils.isNotBlank(scope)) {
        parts.add(scope.toString());
    }
    String result = StringUtils.join(parts, "\n");
    return result;
}
Also used : GenericName(org.opengis.util.GenericName) Datum(org.opengis.referencing.datum.Datum) InternationalString(org.opengis.util.InternationalString) ArrayList(java.util.ArrayList) InternationalString(org.opengis.util.InternationalString) AbstractSingleCRS(org.geotools.referencing.crs.AbstractSingleCRS)

Aggregations

GenericName (org.opengis.util.GenericName)46 Test (org.junit.Test)11 ReferenceIdentifier (org.opengis.referencing.ReferenceIdentifier)9 InternationalString (org.opengis.util.InternationalString)9 ArrayList (java.util.ArrayList)5 IdentifiedObject (org.opengis.referencing.IdentifiedObject)5 NameFactory (org.opengis.util.NameFactory)5 Identifier (org.opengis.metadata.Identifier)4 ScopedName (org.opengis.util.ScopedName)4 HashMap (java.util.HashMap)3 DependsOnMethod (org.apache.sis.test.DependsOnMethod)3 IOException (java.io.IOException)2 UncheckedIOException (java.io.UncheckedIOException)2 Collection (java.util.Collection)2 IdentityHashMap (java.util.IdentityHashMap)2 LinkedHashMap (java.util.LinkedHashMap)2 Map (java.util.Map)2 AbstractIdentifiedType (org.apache.sis.feature.AbstractIdentifiedType)2 NameToIdentifier (org.apache.sis.internal.metadata.NameToIdentifier)2 TableAppender (org.apache.sis.io.TableAppender)2