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 docstrings #225
Comments
@mullenkamp, would you mind providing specific code examples? |
Reference to my assumption reasoning:OSGeo/PROJ#1301 |
No problem.
These produce the desired output. Reverse them to see strange output (i.e. inf or incorrect coords). Thanks! |
This entirely depend on how the source and destination CRS's are defined. By chance, both your source and destination are defined as having the first coordinate component point in a northerly direction. A general rule of thumb is that a CRS in geographic coordinates has an axis ordering of (latitude, longitude) where as most projected CRS's has axis on ordering of (easting, northing).
Note the |
Thank you very much for the explanation. I do understand how this works now. But unfortunately that still does mean that the x and y order in pyproj is totally dependent on the crs definition rather than the class and method itself. I'm happy to help in anyway I can by the way. |
This is definitely an issue that will need some thought and careful consideration. I am not sure if this should be handled in pyproj or in PROJ. But, as you mentioned, this should definitely be documented at a minimum. If you have ideas for handling this, feel free to comment below. My main idea is to use the |
First of all, I would say that |
That will be useful. |
Can anyone think of a particular use-case when someone is building upon pyproj for a universal crs transformer in their application that they would want the axis order to vary? |
Anyone who wants to represent a given CRS as the local authority intended. Or really, if you want to claim that something is CRS xyz then you should represent it as CRS xyz is defined, and not how you think it should be defined. This can seem as useless nitpicking on the surface, but once you dig a bit deeper the real problems begin to show up. For most coordinates systems it makes much sense to put the east/west-component first because that looks like the x-axis in a normal coordinate system. The same for the north/south component that in most cases fit very well with the y-axis. But then we have coordinate systems that are rotated and have no obvious mapping to the usual x and y direction - what do you do then? Or geocentric cartesian coordinate systems which has an x, y and z axis where the z-axis points towards north? And then we have sailors (and many others) that will always give you a position as latitude then longitude. PROJ and pyproj respects that now, the previous behaviour did not. Personally I would really love to live in a world where this stuff was simple, but it isn't - sometimes for good reasons - and the best we can do is try to adapt and deal with it as best as possible. This is mostly a problem now because GIS was mostly invented by computer programmers and not geodesists and geographers. The geodesist and geographers are slowly catching up and this is what is now stirring the pond. Sorry for the inconvenience - everything will work out eventually :-) |
Thanks for the explanation on the background of CRS and proj4. |
If you would like to take a stab at it and make a PR to discuss it, that's fine with me 👍 |
Thanks @snowman2 . |
Docs already in progress: #229 |
@mullenkamp it seems PROJ already found a solution. It will be included in version 6.1.0. See #238. |
Does this mean I shouldn't make any changes, or try to implement version 6.1.0 into pyproj? |
If you would like to implement it from the 6.1.0 version, that would be great. |
@mullenkamp, I plan to start an implementation on this in the next couple of days so it can be in the next release. |
I have an implementation in #286. |
Thanks! Sorry that I haven't had time recently to make the implementation myself. |
No worries. I wasn't sure when you were planning on getting to it and was thinking it would be an important feature to include in the next release (that I thought was going to happen 3 days ago when I started on it :)). |
Closing as this has been merged into master. |
Hi,
Could you please update the docstring documentation for the Transformer class?
One minor typo is proj_from in the from_proj method, but the most important ones are the itransform and transform methods.
They both state that the input should be in the order of x, y when they actually are in the order of y, x. And the output is in the order of y, x. That got me quite confused for a while.
Thanks
The text was updated successfully, but these errors were encountered: