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
Unexpected Oblique Mercator (omerc) inverse proj result when alpha is between 90 and 270 #331
Comments
I compared the implementation with the reference at http://www.ihsenergy.com/epsg/guid7.pdf, on page 34, there is
In PJ_omerc.c, the code is using atan2 which is giving different results when alpha is greater than 90 degrees, I tried replacing the atan2 with the atan from the reference and I now get correct results in my test case (I've not tested anything else)
I'm not sure why atan2 is being used here, I think it could be an issue, but changing it might break something else relying on this behavior. |
Probably a bug. Can you bring this issue up to the mailing list and see if anyone can provide some guidance for us? |
Sorry that I haven't looked at this for a bit, I did look through the archives and found a message that is essentially the same issue that I ran into: http://lists.maptools.org/pipermail/proj/2012-June/006331.html I have a workaround for the moment, I subtract 180 degrees from the alpha and inverse the sign on easting/northing. |
I believe this issue was not correctly resolved. My recent attempts to perform omerc transforms with pyproj when +alpha is between 90 and 270 degrees are not working correctly (see issue https://github.com/pyproj4/pyproj/issues/1247). After investigating the issue with OSGeo via the shell, I believe there to be an existing problem within OSGeo/PROJ that pyproj is inheriting. Varying the +alpha value an equal offset from the 90 or 270 degrees provides the same coordinate transform.
|
I have attempted to search code to figure out how the "omerc" transform is calculated, but the all searches in the code of this repository do not show up with a github search. Any idea what is going on? I also attempted to find the file PJ_omerc.c where this bug was located in an earlier comment on this subject, but I could not located this file in the repository. Was this file possibly removed with a version change and the same problem re-inherited from a new source? |
==> https://github.com/OSGeo/PROJ/blob/master/src/projections/omerc.cpp |
Yes, you're right - the search function does not work at all on the PROJ repo, which is quite annoying. Unfortunately, I do not have the slightest idea of why, but perhaps the widespread wrapping of everything into the anonymous namespace has to do with this? @rouault could this be the reason or do you have any other suggestions? (perhaps I should open a separate issue on this) |
?!? I don't see the connection.
to github itself. I don't see what we can do on our side. |
But this appears to be specific to the PROJ repo, so not a generic Github thing, but something relating to "whatever is unique to PROJ", so prior to opening an issue with github herself, it might be nice to have an list of PROJ specifics that might trigger the problem |
basically nothing works. I've tried "main", "proj_create", "proj_trans", etc. |
So have I, and I'm puzzled: Apparently this only happens in our repo, thus my suspicion it had to do with something PROJ specific |
I have opened a bug report on https://support.github.com/contact/bug-report, cf. https://support.github.com/ticket/personal/0/2069797 |
The GitHub "search" feature seams to work now, so it must have been a glitch. A better "search" in a local git clone is with git-grep, e.g. |
In that case it must have been a many-months-long glitch :-) I first noticed it some time last fall. But nice to hear it works now! |
Sorry, @mwtoews - should have been "last spring" at your latitudes. Probably I should have said "some time in October or November of 2022 current epoch" |
PROJ.4 version : v4.9.2, 08 September 2015
I was working on a module to allow a user to specify a local grid using the 'omerc', basically following what was suggested here:
http://gis.stackexchange.com/questions/83861/using-customized-coordinate-system-for-archaeological-site-data
This appears to work fine when the alpha angle is 270 to 360 and 0 to 90. If I specify an alpha greater than 90 but less than 270, I get strange results, see my test case below:
I would expect that proj should be able to handle this because reversing the angle from 91 to 271 does return the correct answer.
Is this a bug or is it expected behavior? is there a way to adjust the parameters to get the behavior I'm looking for?
The text was updated successfully, but these errors were encountered: