if (!Utilities.equalsIgnoreMetadata(cs.getAxis(0), xAxis) ||
!Utilities.equalsIgnoreMetadata(cs.getAxis(1), yAxis))
{
// We can not reuse the name of the existing CS, because it typically
// contains text about axes including the axis that we just dropped.
cs = new DefaultEllipsoidalCS(singletonMap(EllipsoidalCS.NAME_KEY, "Ellipsoidal 2D"), xAxis, yAxis);
}
return new DefaultGeographicCRS(IdentifiedObjects.getProperties(crs), ((GeographicCRS) crs).getDatum(), cs);
}
}
if (crs instanceof CompoundCRS) {