The functionality of this change has been done independently in a more robust and generic way
in a different class, namely IdentifiedObjects
. The SIS/Geotk method is:
public static String getIdentifierOrName(IdentifiedObject object);
Command line:
svn diff --extensions "--unified --ignore-space-change --ignore-all-space --ignore-eol-style" -r32190:32191 https://svn.osgeo.org/geotools/trunk/modules/library/referencing/src/main/java/org/geotools/referencing/CRS.java
Revision 32190 | Revision 33571 |
---|---|
*/ public static String toSRS(final CoordinateReferenceSystem crs) { if (crs != null) { final ReferenceIdentifier name = crs.getName(); if (name != null) { return name.toString(); } } return null; } |
*/ public static String toSRS(final CoordinateReferenceSystem crs) { if (crs != null) { final Set<ReferenceIdentifier> identifiers = crs.getIdentifiers(); if( identifiers.isEmpty() ){ // fallback unfortunately this often doesnt work final ReferenceIdentifier name = crs.getName(); if (name != null) { return name.toString(); } } else { return identifiers.iterator().next().toString(); } } return null; } |