-
Notifications
You must be signed in to change notification settings - Fork 389
Changed default CRS for set_extent so it is no longer the geodetic version. #131
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
Conversation
|
This behaviour was intentional. If you want to set the limits of your map in native coordinates you can do all of that with the standard matplotlib The reason I did this in the first-place is that, 9 times out of 10, you know the extent of the map that you want in Lat Long, not in the (often arbitrarily unit-ed) coordinate system of the "native" map. As such, I would want to maintain the capability for users to easily set their extents in latitude/longitude. Pragmatically, On the other hand, I can see that |
|
@pelson - that is the unexpected behaviour I refer to. I actually like the pragmatic (as you put it) |
|
It's also worth noting the behaviour of get_extent() (despite what the docstring says) gives you the extent in the axes' projection if |
|
Added a commit that fixes the docstring for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The sentence was a little awkward in the first place, perhaps:
If not crs is given, the returned extent will be in this projection's native coordinate system.?
|
I'm surprised there are no tests depending on this. Would you mind adding one to |
|
Happy to. I have a growing collection of PRs that I need to add tests to after I've finished the feature artist work. |
|
😄 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this is such a common requirement, I'm tempted to ask to to expose a context manager which has the following syntax:
with assert_warns(UserWarning):
ax.get_extent()
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note: this does exist on python3: http://docs.python.org/3.3/library/unittest.html#unittest.TestCase.assertWarns
|
@esc24 - there has clearly been a lot of good work put into this PR. We fundamentally disagree on one line in this whole PR (line 535 in Cheers, |
When setting the extent of a plot with
GeoAxes.set_extent()the CRS of the provided coords currently defaults to a geodetic version ofself.projectionrather thanself.projection. I do not see the reason for this and in my opinion the behaviour is unexpected. I propose changing it so that if I set up an axes in projection X, any provided extent is assumed to be in that coordinate system unless I explicitly tell it otherwise through thecrsargument.