if (!equalsIgnoreMetadata(that, RangeMeaning.WRAPAROUND.equals(this.getRangeMeaning()) &&
RangeMeaning.WRAPAROUND.equals(that.getRangeMeaning())))
{
return false;
}
ReferenceIdentifier name = that.getName();
if (name != UNNAMED) {
/*
* Checking the abbreviation is not sufficient. For example the polar angle and the
* spherical latitude have the same abbreviation (θ). Legacy names like "Longitude"
* (in addition to ISO 19111 "Geodetic longitude") bring more potential confusion.
* Furthermore, not all implementors use the greek letters. For example most CRS in
* WKT format use the "Lat" abbreviation instead of the greek letter φ.
* For comparisons without metadata, we ignore the unreliable abbreviation and check
* the axis name instead. These names are constrained by ISO 19111 specification
* (see class javadoc), so they should be reliable enough.
*
* Note: there is no need to execute this block if metadata are not ignored,
* because in this case a stricter check has already been performed by
* the 'equals' method in the superclass.
*/
final String thatCode = name.getCode();
if (!isHeuristicMatchForName(thatCode)) {
name = getName();
if (name != UNNAMED) {
/*
* The above test checked for special cases ("Lat" / "Lon" aliases, etc.).
* The next line may repeat the same check, so we may have a partial waste
* of CPU. But we do it anyway for checking the 'that' aliases, and also
* because the user may have overridden 'that.isHeuristicMatchForName(…)'.
*/
final String thisCode = name.getCode();
if (!IdentifiedObjects.isHeuristicMatchForName(that, thisCode)) {
// Check for the special case of "x" and "y" axis names.
if (!isHeuristicMatchForNameXY(thatCode, thisCode) &&
!isHeuristicMatchForNameXY(thisCode, thatCode))
{