Proj - bug in mercator projection

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Proj - bug in mercator projection

Robert Coup-2
Hi folks,

We've found a bug in the mercator implementation in Proj.js - it
incorrectly initialises one of the ellipsoid parameters (there's a
sqrt where there should be a square). When doing a mercator-to-latlon
conversion, this results in the latitudes being out by a small amount
(eg. +0.14 degrees at 36S using EPSG:54004). We found the solution by
comparing the mercator code to that used by Proj4, which returns what
we think is the correct answers.

I've attached a patch against HEAD that fixes the issue. Let me know
if you need any more information.

Regards,

Rob :)

--
One Track Mind Ltd.
PO Box 1604, Shortland St, Auckland, New Zealand
Phone +64-9-966 0433 Mobile +64-21-572 632
Web http://www.onetrackmind.co.nz

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
mapbuilder-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel

proj_mercator_bug.diff (692 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Proj - bug in mercator projection

Olivier Terral
Hi,

Thanks so much Rob .

A misatke when i've  adapted the gctcp library  ;)

Robert Coup a écrit :

> Hi folks,
>
> We've found a bug in the mercator implementation in Proj.js - it
> incorrectly initialises one of the ellipsoid parameters (there's a
> sqrt where there should be a square). When doing a mercator-to-latlon
> conversion, this results in the latitudes being out by a small amount
> (eg. +0.14 degrees at 36S using EPSG:54004). We found the solution by
> comparing the mercator code to that used by Proj4, which returns what
> we think is the correct answers.
>
> I've attached a patch against HEAD that fixes the issue. Let me know
> if you need any more information.
>
> Regards,
>
> Rob :)
>
> ------------------------------------------------------------------------
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> ------------------------------------------------------------------------
>
> _______________________________________________
> mapbuilder-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel
>  


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
mapbuilder-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/mapbuilder-devel