* @return the transform or {@code null} if the layer's CRS is the same
* as that of the map content, or if either has no CRS defined
*/
protected MathTransform getContentToLayerTransform() {
if (transform == null && !transformFailed) {
MapContent content = getMapContent();
Layer layer = getLayer();
if (content != null && layer != null) {
CoordinateReferenceSystem contentCRS = content.getCoordinateReferenceSystem();
CoordinateReferenceSystem layerCRS =
layer.getFeatureSource().getSchema().getCoordinateReferenceSystem();
if (contentCRS != null && layerCRS != null) {
if (CRS.equalsIgnoreMetadata(contentCRS, layerCRS)) {