This project is read-only.

MGRS to UTM conversion error


There seems to be a problem when converting UTM coordinates in the N band.
36N 565236 527266 converted to MGRS and then back to UTM results as 36N 565236 507266

The same issue occurs for other UTM zones in the N band.

The library is very useful, I hope you can fix this.

file attachments


soan wrote Oct 12, 2013 at 4:57 PM

Please send a sample for converting UTM to MGRS or LatLon to MGRS.

I need very urgent.

Please help.

Thanks in advance

wrote Oct 13, 2013 at 3:30 AM

rbdavison wrote Oct 13, 2013 at 3:30 AM

Attached is a test project that tests the examples on the home page.
There is also a test for this error and a test that creates a spreadsheet that illustrates the errors in conversion.
The basic flow of the test is
Geographic geo = new Geographic(lon, lat);
MGRS mgrs = (MGRS)geo;
Geographic result = (Geographic)mgrs;
double distance = DistanceBetweenPointsInMeters(geo, result);
if (distance > 1.0)
// Failed