Fix handling of lon/lat coordinates on CRS with prime meridian != 0 #447
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
For a long time we have used a shortcut when transforming lon/lat area coordinates to generic "lon/lat degrees" by checking if the CRS of that area is "geographic" and returning the original input coordinates. This is really only correct in the cases where the CRSes are the same. This shortcut was causing issues in nearest (and other) resamplers where if you resampled to an AreaDefinition with a shifted prime meridian (ex. at 180/-180). In these cases the resampling was using the non-shifted lon/lat coordinates which usually meant you got a black image as a result of resampling. This PR removes this shortcut.
By removing this shortcut this means that the utility/custom Proj class in
pyresample/_spatial_mp.py
is no longer needed as it doesn't actually do anything any more. I will remove this utility class shortly.git diff origin/main **/*py | flake8 --diff