Help needed with Lat/Long issue

Any Geo Guru's here who might ken' the answer to this problem:
I'm converting MGRS to Lat/Lon and am then plotting it. When an MGRS grid is in the western hemisphere (west of Greenwich) the resulting Longitude is negative. I need that to be a positive westing. I've Googled and found someone saying you need to multiply the equation for deg, min, sec by -1 to allow for Westings.
Is this correct?
Just treat a negative Longitude as West of Greenwich, and likewise a negative Latitude as South of the equator and you should be okay.

Once you have plotted one or two it should be apparent whether or not you are correct, gross errors should stand out quite quickly.
Cheers Hungwe. I've cracked it now:
The ugly DMS Eastings I was getting were like: E-0015058
which were then getting converted to decimal Lat/Long with
that Dec Lat/Long = A + (B + C /60) /60 formula.
I found that deducting my bad DMS from the number 15960 gave a figure which when split up correctly was the required Degs/Mins/Secs.
eg 15960 - 15058 = 000902 = 0 Degs, 9 Mins, 2 secs.
It works but I don't know why!
Anyone know whats significant about the number 15960? I found it by trial and error so am guessing it relates to the UTM system.
There seem to be a few options:

Your example of E-0015058 looks very like 1deg 50' 58"W, where the number follows the format ("E-" = W) DDDMMSS.

Try a few more examples, if you can, to see if the MM and SS figures ever exceed 59. If they do, then the number may be in DDD.DDDD format. If this is the case then remove the first three digits, these being the value in degrees, i.e. 001 degrees.

Take the rest of the number, precede it with a decimal point and multiply by 60. i.e. 0.5058 x 60 = 30.348

Remove the digits in front of the decimal point, these being minutes, and multiply the remainder by 60 to give seconds. i.e. 0.348 x 60 = 20.88 (roughly 21seconds).

Thus E-0015058 would represent 1 deg 30' 21"W

Alternatively, E-0015058 could represent 0.0015058 of 180degrees = 0.271044degrees = 16.26264minutes = 0deg 16' 16"W

My money would be on Option A.

Your calculations using 15960 seem odd. If it were a valid factor, it should be divisible by 60 and leave a sensible number. Although it can be divided cleanly by 60, the result is 266 - not a sensible number.

Are you sure that the number shouldn't be 1796000? This being 179deg 60min - or 180 degrees. Even then, I can't see the point of it, especially as it's not in a format that you can just plug into a calculator (unless you have DMS input).

If you want to make converting MGRS to lat/long easier, you could try this freebie bit of software:
Interesting. Thanks for the detailed response.
That (bad) example E-0015058 was DDMMSSS so 0 Deg 15' 6". Disregarding the superfluous 8 (don't ask!)
It's for some Visual Basic code I've just written. I'm pleased to say it works with that strange number, 15960. Which I'm prefixing with 10 (1015960) to make deducting large numbers from it return a positive integer.
I reckon there's multiple ways of reaching the same answer and I've just found one. I'm happy so long as it works, which it does now. :D
Didn't know about that MGRS convertor. I'm using a conversion function through Visual Basic for the MGRS to DDMMSS which comes as part of a mapping software package.
Thanks anyway.
If E-0015058 = 0 Deg 15' 6", then how would, say, 120deg W be represented? There aren't enough digits - three digits need to be allocated to degrees.

There isn't an extra zero at the front that you're not telling us about? That would make the whole thing very clear, giving you a seconds figure accurate to a tenth of a second i.e. E-00015058 = 0deg 15' 05.8"

Another thought comes to mind, thinking back to the early days of calculators. The display that you're reading from isn't restricted to 9 characters, by any chance? In which case, the "E-" is signifying an inability to display correctly and loses the first digit of the easting as a result.
It's more of a Visual Basic issue than a pure conversion thing.
I've had to create the code to handle all the different permutations of DDMMSS which my converter gives me. Some have - signs in which screwed things up, hence my cuffed solution.

Anyhow, thanks for the 3 digit tip. I've converted some grids in countries around the world and have it working in 280 degrees out of 360 so 78%.
Europe,Africa,Mid East,Asia, Eastern US, South America all work.
Western US ( > W99) up to mid pacific ( W180) fails.

I don't plan on using this program in the mid pacific :wink:
argh our friend the neg neg?? just saying good work. ME Svy here. I laughed that you wanted eastings as a pos westings at first.... reminds me of my days work with the RAF!!

keep it up my boy..

Similar threads

New Posts

Latest Threads