Subject: | mgrs_to_utm function southern hemisphere |
Date: | Wed, 23 Jan 2013 15:42:53 +1000 |
To: | bug-Geo-Coordinates-UTM [...] rt.cpan.org |
From: | David Steele <dave.steele [...] gmail.com> |
It seems there is an issue with the mgrs_to_utm function when converting
locations in the southern hemisphere.
For example passing latitude -19.4574 longtitude 146.4264 to
the latlon_to_mgrs function correctly returns the MGRS of 55KDU3979548461.
However feeding this MGRS back into the mgrs_to_latlon function
returns -1.3709 146.4588.
I've found that commenting out line 384 of the module which is advancing
$tmpNorth by one in the mgrs_to_utm function corrects this. As I don't
fully understand the math of this conversion I'm not sure if this solution
will work for all zone letters, but hopefully can point in the right
direction for a fix.