Search in sources :

Example 1 with AbstractSingleCRS

use of org.geotools.referencing.crs.AbstractSingleCRS 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

ArrayList (java.util.ArrayList)1 AbstractSingleCRS (org.geotools.referencing.crs.AbstractSingleCRS)1 Datum (org.opengis.referencing.datum.Datum)1 GenericName (org.opengis.util.GenericName)1 InternationalString (org.opengis.util.InternationalString)1