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

spherical tmerc with negative northing gives inverted latitude #138

Closed
proj4-bot opened this Issue May 22, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@proj4-bot

proj4-bot commented May 22, 2015

Reported by dstahlke on 20 Jan 2012 20:32 UTC
It would seem the coordinate (0,-1) would give a result close to (lon_0,lat_0). However, the latitude is inverted in the case where northing is negative and the globe is spherical. If I make the globe elliptical, then it works fine.

~/Desktop/proj$ echo 0 -1 | invproj +proj=tmerc +lat_0=32.936 +lon_0=-117.038 +k=0.9996 +x_0=0 +y_0=0 +a=6378137 +b=6378137 +units=m +no_defs
117d2'16.8"W    32d56'9.568"S
~/Desktop/proj$ echo 0 -1 | invproj +proj=tmerc +lat_0=32.936 +lon_0=-117.038 +k=0.9996 +x_0=0 +y_0=0 +a=6378137 +b=6378136 +units=m +no_defs
117d2'16.8"W    32d56'9.568"N

I believe the problem is related to line 126 of PJ_tmerc.c where the test "xy.y < 0" is done. I don't know enough about proj.4 to give a proper fix.

As a workaround, the spherical function can be disabled and the elliptical version used always. On line 139 of PJ_tmerc.c, change "if(P->es)" to "if(1 || P->es)".

Migrated-From: https://trac.osgeo.org/proj/ticket/138

@proj4-bot

This comment has been minimized.

proj4-bot commented May 22, 2015

Comment by dstahlke on 24 Jan 2012 00:31 UTC
The formatting didn't come out properly for the workaround. It should read as follows: on line 139 of PJ_tmerc.c, change if(P->es) to if(1 || P->es).

@proj4-bot

This comment has been minimized.

proj4-bot commented May 22, 2015

Comment by warmerdam on 3 Mar 2012 22:29 UTC
I have confirmed this is not a regression since 4.7 and I'm not too confident of the suggested solution so I'm not going to take action before 4.8 but this is a fairly serious problem.

@proj4-bot

This comment has been minimized.

proj4-bot commented May 22, 2015

Modified by warmerdam on 3 Mar 2012 22:29 UTC

kbevers added a commit to kbevers/proj.4 that referenced this issue Oct 20, 2016

kbevers added a commit to kbevers/proj.4 that referenced this issue Oct 20, 2016

kbevers added a commit to kbevers/proj.4 that referenced this issue Oct 20, 2016

@kbevers kbevers closed this in #440 Oct 20, 2016

kbevers added a commit that referenced this issue Oct 20, 2016

@kbevers kbevers added this to the 4.10.0 milestone Oct 20, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment