/ PROJ Public

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.

# spherical tmerc with negative northing gives inverted latitude#138

Closed
opened this issue May 22, 2015 · 3 comments · Fixed by #440
Closed

# spherical tmerc with negative northing gives inverted latitude #138

opened this issue May 22, 2015 · 3 comments · Fixed by #440
Labels
Milestone

### 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 The text was updated successfully, but these errors were encountered:

### 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 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 commented May 22, 2015

 Modified by warmerdam on 3 Mar 2012 22:29 UTC

added a commit to kbevers/PROJ that referenced this issue Oct 20, 2016
``` Fixes OSGeo#138 (spherical tmerc with negative northing gives inverte… ```
``` 5cc655f ```
`…d latitude)`
added a commit to kbevers/PROJ that referenced this issue Oct 20, 2016
``` Fixes OSGeo#138 (spherical tmerc with negative northing gives inverte… ```
``` 85d17f9 ```
`…d latitude)`
added a commit to kbevers/PROJ that referenced this issue Oct 20, 2016
``` Fixes OSGeo#138 (spherical tmerc with negative northing gives inverte… ```
``` e955373 ```
`…d latitude)`
mentioned this issue Oct 20, 2016
added a commit that referenced this issue Oct 20, 2016
``` Fixes #138 (spherical tmerc with negative northing gives inverted lat… ```
``` a8e73a5 ```
`…itude)`
added this to the 4.10.0 milestone Oct 20, 2016
mentioned this issue Nov 29, 2020
to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants