return "CRS:84"; // WMS Authority definition DefaultGeographicCRS.WGS84
}
Set<ReferenceIdentifier> identifiers = crs.getIdentifiers();
if (identifiers.isEmpty()) {
// we got nothing to work with ... unfortunately this often does not work
final ReferenceIdentifier name = crs.getName();
if (name != null) {
return name.toString();
}
return null;
} else {
// check for an identifier to use as an srsName
for (ReferenceIdentifier identifier : crs.getIdentifiers()) {
String srs = identifier.toString();
if (srs.contains("EPSG:") || srs.contains("CRS:")) {
return srs; // handles prj files that supply EPSG code
}
}
// fallback unfortunately this often does not work
ReferenceIdentifier name = crs.getName();
if (name != null
&& (name.toString().contains("EPSG:") || name.toString().contains("CRS:"))) {
return name.toString();
}
// nothing was obviously an identifier .. so we grab the first
return identifiers.iterator().next().toString();
}
}