Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Proj4 warnings #757

Merged
merged 3 commits into from
Apr 20, 2016
Merged

Update Proj4 warnings #757

merged 3 commits into from
Apr 20, 2016

Conversation

QuLogic
Copy link
Member

@QuLogic QuLogic commented Apr 6, 2016

Fix a small problem with the Robinson check that could trigger the warning on multi-digit versions in the future.

Add a warning for Azimuthal Equidistant to indicate the issue with > 90 degree transforms. Closes #568.

@QuLogic QuLogic added this to the 0.14 milestone Apr 6, 2016
@@ -1454,7 +1454,7 @@ def __init__(self, central_longitude=0, globe=None):
# 40 deg N introduced by incomplete fix to issue #113 (see
# https://trac.osgeo.org/proj/ticket/113).
import re
match = re.search(r"\d\.\d", PROJ4_RELEASE)
match = re.search(r"\d+\.\d+", PROJ4_RELEASE)
if match is not None:
proj4_version = float(match.group())
if 4.8 <= proj4_version < 4.9:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 for switching to \d+ (although in this specific case it's unlikely to cause a problem - it won't affect the subsequent version check until we hit 4.80 or greater), but this still isn't correct because of the float conversion: float('4.80') == 4.8.

How about factoring out the PROJ4_RELEASE-to-tuple code and sharing it with the azimuthal equidistant code? This comparison would then become (4, 8, 0) <= proj4_version < (4, 9, 0).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point about the float. Actually, there are a couple more cases of this in the tests that I need to fix as well.

@pelson
Copy link
Member

pelson commented Apr 11, 2016

Thanks for this @QuLogic.
Some good suggestions from @rhattersley, but other than that 👍

Single digit regex matches will erroneously match versions such as 4.10
as 4.1 or 14.8 as 4.8, which may trigger the Robinson projection warning
even for new-and-fixed proj4 releases.
Old proj.4 has an issue with the AzimuthalEquidistant transformation
past 90 degrees.
@QuLogic
Copy link
Member Author

QuLogic commented Apr 11, 2016

I think I've handled all the comments.

@pelson pelson merged commit d1e1a69 into SciTools:v0.14.x Apr 20, 2016
@QuLogic QuLogic deleted the proj4-warnings branch April 20, 2016 20:46
@QuLogic QuLogic modified the milestones: 0.14, 0.14.2 Apr 21, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants