Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Offline Windows latitude and longitude converter (DMS <-> DD <-> DdM)

224 views
Skip to first unread message

Bob J Jones

unread,
Mar 28, 2018, 1:52:18 AM3/28/18
to
Do you know of an offline Windows latitude and longitude converter
that will convert degrees minutes seconds to Degrees decimal Minutes?

Degrees Minutes Seconds <-> Decimal Degrees <-> Degrees decimal Minutes
(DMS <-> DD <-> DdM)

For example, these are equivalent:
DMS latitude 25d 15m, 0s longitude 110d 07m 30s
DD latitude 25.25d, longitude 110.125d
DdM latitude 25d 15.0000m, longitude 110d 7.5000m

The offline OziExplorer app requires DdM but USGS maps are in DMS.
So the hard part is finding a convert to Degrees decimal minutes.

Here are web sites that will convert from DMS to DdM.
http://jeeep.com/details/coord
http://rumkin.com/tools/gps/degrees.php
https://www.pgc.umn.edu/apps/convert

All these Excel macros only show conversion of DDM <-> DMS but not DdM.
https://support.microsoft.com/en-za/help/213449/how-to-convert-degrees-minutes-seconds-angles-to-or-from-decimal-angle
https://gist.github.com/valentinitnelav/ea94fea68227e05c453e13c4f7b7716b
https://www.fieldmuseum.org/science/blog/converting-dd-dms-excel

What is needed is an offline tool to convert to Degrees decimal minutes.

Do you know of an offline Windows latitude and longitude converter
that will convert degrees minutes seconds to Degrees decimal Minutes?

Andy Burns

unread,
Mar 28, 2018, 4:05:31 AM3/28/18
to
Bob J Jones wrote:

> Do you know of an offline Windows latitude and longitude converter
> that will convert degrees minutes seconds to Degrees decimal Minutes?

Eh? It's just multiplications by 60, or divisions by 60 with remainder.
Do you need to call this from a script (what language)? Or want
something a human can poke values into and see the result?


Bob J Jones

unread,
Mar 28, 2018, 4:27:27 AM3/28/18
to
In <news:fi10m8...@mid.individual.net>, Andy Burns
I don't really know what I want other than the goal is to be offline and,
there are so many places to make math mistakes, that a ready-made
calculator is what should be used offline (instead of hand calculations).

I just finished writing up a tutorial for installing an offline USGS
topographic map editor such that you can load in USGS maps and create and
edit and import and export tracks, where I used this online web page to
convert from the USGS Degrees Minutes Seconds to OziExplorer required
Degrees digital Minutes.
http://www.directionsmag.com/site/latlong-converter/

That worked fine to convert the four corners of the USGS map tiles from
degrees minutes seconds to degrees digital minutes, but what I'm hoping to
find is a ready-made spreadsheet or offline app that does the calculations
for you just like the web page above did.

In summary, it's best for everyone to have an offline program that can take
the lat/long of four corners of a USGS map tile and convert it from DMS to
DdM.

I'm writing up the tutorial right now and will post that tutorial to the
other thread, so I haven't worked on the degree conversion part yet.

Bob J Jones

unread,
Mar 28, 2018, 9:56:52 AM3/28/18
to
In <news:p9fuj5$8b7$1...@gioia.aioe.org>, Jeff <je...@ukra.com> wrote:

> Write an Excel spreadsheet to do the conversion. It is not hard!!

Did you see the Microsoft Excel Visual Basic macro to convert just from
Degrees Minutes Seconds to decimal degrees?
https://support.microsoft.com/en-za/help/213449/how-to-convert-degrees-minutes-seconds-angles-to-or-from-decimal-angle

It's horrific.

How to convert DD to DMS.
1. Start Microsoft Excel 2007.
2. Press ALT+F11 to start the Visual Basic editor.
3. On the Insert menu, click Module.
4. Enter the code for the Convert_Degree custom function into the module
sheet.
Function Convert_Degree(Decimal_Deg) As Variant
With Application
'Set degree to Integer of Argument Passed
Degrees = Int(Decimal_Deg)
'Set minutes to 60 times the number to the right
'of the decimal for the variable Decimal_Deg
Minutes = (Decimal_Deg - Degrees) * 60
'Set seconds to 60 times the number to the right of the
'decimal for the variable Minute
Seconds = Format(((Minutes - Int(Minutes)) * 60), "0")
'Returns the Result of degree conversion
'(for example, 10.46 = 10~ 27 ' 36")
Convert_Degree = " " & Degrees & "° " & Int(Minutes) & "' " _
& Seconds + Chr(34)
End With
End Function
5. Press ALT+F11 to return to excel.
6. In the Excel spreadsheet cell A1, type the DD of "10.46" (sans quotes).
7. In the Excell spreadsheet cell A2, type the following formula:
"=Convert_Degree(A1)" (sans quotes)
8. The formula returns the DMS of 10°27'36"
================
How to convert DMS to DD.
1. Start Microsoft Excel 2007.
2. Press ALT+F11 to start the Visual Basic editor.
3. On the Insert menu, click Module.
4. Enter the code for the Convert_Degree custom function into the module
sheet.
Function Convert_Decimal(Degree_Deg As String) As Double
' Declare the variables to be double precision floating-point.
Dim degrees As Double
Dim minutes As Double
Dim seconds As Double
' Set degree to value before "°" of Argument Passed.
degrees = Val(Left(Degree_Deg, InStr(1, Degree_Deg, "°") - 1))
' Set minutes to the value between the "°" and the "'"
' of the text string for the variable Degree_Deg divided by
' 60. The Val function converts the text string to a number.
minutes = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "°") + 2, _
InStr(1, Degree_Deg, "'") - InStr(1, Degree_Deg, _
"°") - 2)) / 60
' Set seconds to the number to the right of "'" that is
' converted to a value and then divided by 3600.
seconds = Val(Mid(Degree_Deg, InStr(1, Degree_Deg, "'") + _
2, Len(Degree_Deg) - InStr(1, Degree_Deg, "'") - 2)) _
/ 3600
Convert_Decimal = degrees + minutes + seconds
End Function
5. Press ALT+F11 to return to excel.
6. In the Excel spreadsheet cell A1, type the following formula:
=Convert_Decimal("10° 27' 36""")
7. The formula returns the DD of 10.46

Of course, they left out Degrees Minutes Seconds to decimal degrees as an
exercise for the reader! :)

Andy Burns

unread,
Mar 28, 2018, 10:07:14 AM3/28/18
to
Bob J Jones wrote:

> Did you see the Microsoft Excel Visual Basic macro to convert just from
> Degrees Minutes Seconds to decimal degrees?
>
> It's horrific.

Get a calculator app (or an actual calculator) that handles sexagesimals?

B. R. 'BeAr' Ederson

unread,
Mar 28, 2018, 1:11:15 PM3/28/18
to
On Wed, 28 Mar 2018 08:27:23 +0000 (UTC), Bob J Jones wrote:

>>> Do you know of an offline Windows latitude and longitude converter
>>> that will convert degrees minutes seconds to Degrees decimal Minutes?

The cs2cs command line converter does about any coordinate transformation:

http://proj4.org/apps/cs2cs.html

Input *can* be latitude/longitude, *standard* output is DMS for geographic
coordinates.

BeAr
--
===========================================================================
= What do you mean with: "Perfection is always an illusion"? =
===============================================================--(Oops!)===

VanguardLH

unread,
Mar 28, 2018, 2:09:52 PM3/28/18
to
Yeah, I was wondering if the OP was asking for something other than
simple math for the conversions. Seems simple enough to multiply or
divide by 60. The problem is with rounding errors screwing up
conversion from DMS to DdM and then back to DMS. 5 D 24 M 24 S gives
5.4066666666666666666666666666667 for DD. If the user rounded to 4
decimal digits to use 5.4067, conversion back to DMS results in 5D 24 M
24.12 S. Doesn't look like much error but if multiple conversions were
involved then the error compounds.

I just went to some download sites and searched on "longtitude latitude
converter" and found:

http://www.softpedia.com/dyn-search.php?search_term=longitude+latitude+converter
http://download.cnet.com/s/longitude-latitude-converter/free/

I'll let the OP do the reading on each offering to let him decide what
he wants in an offline converter too.

If those tools only convert between DMS to DD but don't cover Degrees
decimalMinutes (DdM), tis easy 'nuff to truncate off the Degree portion
(left of the decimal point) and multiply the remainder by 60 to get
decimal Minutes. If the OP starts with DD or used one of the tools to
covert DMS to DD, the OP can use the Calculator already included in
Windows to convert from DD to DdM (put the Calculator in scientific
mode, enter a value, and click the dms button). dms(25.25) = 25.15
which means 25 D 15 M.

There can still be rounding errors, especially if the minutes or seconds
are not divisible by 60 (the divisor) to give a fixed-length result, not
some non-terminating or non-repeating series of digits (irrational
number); else, you have to retain enough digits to ensure rounding gets
very close to the original dividend. This will be a problem no matter
what tool the OP uses if he reverses the conversion or doesn't keep
enough significant digits to be "close enough".

Bob J Jones

unread,
Mar 28, 2018, 3:15:21 PM3/28/18
to
In <news:p9gi7u$1doh$1...@gioia.aioe.org>, Jeff <je...@ukra.com> wrote:

> Put degrees into A1, minutes into B1, Seconds into C1 then in some other
> cell =A1&" "&B1+(C1/60)

Thanks for this information, as I don't know Excel at all, although I worry
about rounding errors causing problems inside the OziExplorer
geocalibration, which is explained here.
https://groups.google.com/d/msg/sci.geo.satellite-nav/yONNWAEx23Y/7LpakFp4BwAJ

Rounding errors aside, the suggested Excel formula worked today, bearing in
mind that it's also extensible to handle all 9 corners of a four-tile USGS
map, which is a good thing. http://i67.tinypic.com/2hs66iq.jpg

Thanks to your help, I'll add these steps to the tutorial located at:
https://groups.google.com/forum/#!forum/sci.geo.satellite-nav

Put the header "degrees" in cell A1 & USGS corner degrees in Excel cell A2.
Put the header "minutes" in cell B1 & USGS cornerminutes in Excel cell B2.
Put the header "seconds" in cell C1 & USGS corner seconds in Excel cell C2.
Put the header "DdM" in cell D1 and then put this formula in cell D2.
=A2&" "&B2+(C2/60)

If folks have rounding-error protection improvements, that would be great
since the whole point is geocalibration of USGS maps inside of a freeware
tool on Windows.

Even so, it still would be nice to see if there already is an existing
offline app for this that works offline on Windows outside of users having
to have a spreadsheet program, but this solves the problem well enough for
most of us.

Bob J Jones

unread,
Mar 28, 2018, 3:31:33 PM3/28/18
to
In <news:1uh0vmurpe7hn$.dlg@v.nguard.lh>, VanguardLH <V...@nguard.LH> wrote:

> Yeah, I was wondering if the OP was asking for something other than
> simple math for the conversions.

I readily admit I'm in this over my head, so I also admit I don't know
Excel, and I don't even know longitude and latitude conversion processes.

All I wanted was simply to be able to do offline what I do online here:
http://caltopo.com

What I do there, online, for free, is I draw a desired backcountry track on
the caltopo online topographic map, and then I save that track and load it
into my mobile device so that I can follow that drawn track.

Also, I do the reverse, which is I turn on my mobile device breadcrumbing
tracking, and then I go on a back country hike, where I load that resulting
GPX track into the online caltopo web site.

All I wanted was to be able to do that, offline, on Windows, for free.

I asked how, and nobody currently knew, but I found old articles (years
old) that explained the OziExplorer method that I documented more fully
here yesterday.
https://groups.google.com/d/msg/sci.geo.satellite-nav/yONNWAEx23Y/7LpakFp4BwAJ

I do admit that all this is way over my head, so I'm doing what I can with
your help!

> Seems simple enough to multiply or
> divide by 60. The problem is with rounding errors screwing up
> conversion from DMS to DdM and then back to DMS.

Thanks for bringing up the rounding errors that can happen with the
conversion.
http://i67.tinypic.com/2hs66iq.jpg

In practice, the only necessary coordinates are those on USGS quadrangle
maps, because the four corners of each map quadrangle are what we enter
into the OziExplorer app to "geocalibrate" the free USGS PDF maps to handle
tracks accurately offline on the Windows desktop computer.

If those coordinates don't have rounding problems, then we're safe, since
those four corners are the only coordinates I think we need to convert from
degrees minutes seconds to degrees decimal minutes.


> I just went to some download sites and searched on "longtitude latitude
> converter" and found:
>
> http://www.softpedia.com/dyn-search.php?search_term=longitude+latitude+converter
> http://download.cnet.com/s/longitude-latitude-converter/free/

I saw those too, but they looked dodgy. Don't they look dodgy to you?
I'd prefer a web page all by itself like most good freeware has.

> There can still be rounding errors, especially if the minutes or seconds
> are not divisible by 60 (the divisor) to give a fixed-length result, not
> some non-terminating or non-repeating series of digits (irrational
> number);

The only numbers that will matter will be the four corners of the USGS PDF
maps we download, because those four corners are the locations we use to
geocalibrate the free USGS PDF maps so that tracks will draw on them
accurately.

https://viewer.nationalmap.gov/launch/

Do you think the USGS PDFs will use corners that divide nicely by 60?

Bob J Jones

unread,
Mar 28, 2018, 3:38:14 PM3/28/18
to
In <news:1ll2oaf39qon7$.d...@br-ederson.eternal-september.org>, "B. R.
'BeAr' Ederson" <use.r...@this.is.invalid> wrote:

> The cs2cs command line converter does about any coordinate transformation:
>
> http://proj4.org/apps/cs2cs.html
>
> Input *can* be latitude/longitude, *standard* output is DMS for geographic
> coordinates.

Thanks for that potential offline freeware longitude/latitude converter,
where I note, like GPS Babel, it has Linux and Windows binaries, which
makes it a more general solution than was Microsoft Excel.
http://proj4.org/download.html#windows

I was asked by a friend if this process described below works for Linux in
addition to Windows.
https://groups.google.com/d/msg/sci.geo.satellite-nav/yONNWAEx23Y/7LpakFp4BwAJ

Where I don't yet know if there is an OziExplorer-like program on Linux
that geocalibrates USGS PDFs allowing tracks to be drawn and edited on
them, offline, in Linux.

I googled for whether OziExplorer works on Linux and only found this:
http://www.oziexplorer3.com/support/oziexplorer/other/linux.html
https://ubuntuforums.org/showthread.php?t=210752

Apparently oziexplorer works on Android though
http://oziexplorer3.com/oziexpmain_au.html

So, unless the main capability of stitching USGS PDFs together and
geocalibrating them and editing tracks on them is available on Linux,
having this command in linux isn't all that helpful.

Keith Nuttle

unread,
Mar 28, 2018, 5:09:37 PM3/28/18
to
While many ways have been offered to assist you. The following is the
basic operations you need to perform to make the conversions.

To convert degrees-minutes-seconds to decimal degrees.

Using your standard calculator enter the

degrees in memory
divide the minutes by 60 and add (sum) the results to memory
divide the seconds by 3600 and add (sum) the results to memory

The sum of Degrees + minutes/60 + seconds/3600 is the decimal degrees.

Example: 60d 30m 50s

sum (60 + 39/60 + 59/3600) = 60.51388889


Converting from decimal degrees is a little more difficult

longitude 60.51388889

The integer portion is the degrees

Use the decimal portion of the longitude
multiply by 60 the integer portion in the minutes.

using the decimal portion of the above multiply by 60
the integer portion of the above is the seconds.

Using 60.51388889

60 Degrees
0.51388889*60 = 30.8333333333331 for 30 minutes
0.8333333333331*60 = 50 second

I have seen the seconds from the above calculation expressed as a
decimal. 50d 40m 35.45s

It does not make any difference if you are working with longitude or
latitude the calculation is the same

As I said this can be done in your hand calculator or if you want you
can place it in a spreadsheet, MS Excel, Corel Quattro Pro, of one of
the free spread sheets.

--
2018: The year we learn to play the great game of Euchre

B. R. 'BeAr' Ederson

unread,
Mar 28, 2018, 5:25:31 PM3/28/18
to
On Wed, 28 Mar 2018 19:38:08 +0000 (UTC), Bob J Jones wrote:

> I was asked by a friend if this process described below works for Linux in
> addition to Windows.
> https://groups.google.com/d/msg/sci.geo.satellite-nav/yONNWAEx23Y/7LpakFp4BwAJ
[...]
> So, unless the main capability of stitching USGS PDFs together and
> geocalibrating them and editing tracks on them is available on Linux,
> having this command in linux isn't all that helpful.

OziExplorer is "just" a GUI wrapper (like the free QGIS I recommended)
around the functionality of the GIS tools and libraries from the free
open source OSGEO project (and several others). These libraries and
tools are - of course - also available for Linux. Actually, most of
them have been initially developed there; and were just ported to Win
later on.

So for example: Instead of having OziExplorer call up gdal_translate,
you could run it all by yourself.

Bob J Jones

unread,
Mar 28, 2018, 6:08:12 PM3/28/18
to
In <news:jqcwylqn...@br-ederson.eternal-september.org>, "B. R. 'BeAr'
Ederson" <use.r...@this.is.invalid> wrote:

> OziExplorer is "just" a GUI wrapper (like the free QGIS I recommended)
> around the functionality of the GIS tools and libraries from the free
> open source OSGEO project (and several others). These libraries and
> tools are - of course - also available for Linux. Actually, most of
> them have been initially developed there; and were just ported to Win
> later on.
>
> So for example: Instead of having OziExplorer call up gdal_translate,
> you could run it all by yourself.

Wow. Thanks for that useful information.

I don't have anywhere near the skillset required to make use of that
information to create a Linux tool that geocalibrates the USGS PDF
topographic maps and then edits and displays tracks on those geocalibrated
maps, but that's great to know that the underlying capability exists for a
good Linux coder to follow up on.

Thanks!

B. R. 'BeAr' Ederson

unread,
Mar 28, 2018, 6:24:30 PM3/28/18
to
You really don't get it: The programs /are/ all available. QGIS (available
for Windows as well as Linux, Mac, BSD) is currently just the best solution
as a GUI. Suitable for beginners as well as GIS Pro's. But there are other
GUI's as well. *And* countless GIS command line tools and libraries.

QGIS also supports geopdf files directly. (No need for conversation.) But
those huge files load (very) slowly. Therefore I did recommend using WMS
services. These load nearly instantaneously. No need to load, convert and
store huge amounts of raster data (which soon will be outdated), just to
adjust a couple of track points to elevation contour lines..

Bob J Jones

unread,
Mar 28, 2018, 7:27:17 PM3/28/18
to
In <news:epcfd51p...@br-ederson.eternal-september.org>, "B. R. 'BeAr'
Ederson" <use.r...@this.is.invalid> wrote:

> You really don't get it: The programs /are/ all available. QGIS (available
> for Windows as well as Linux, Mac, BSD) is currently just the best solution
> as a GUI. Suitable for beginners as well as GIS Pro's. But there are other
> GUI's as well. *And* countless GIS command line tools and libraries.

Thanks for the confirmation that QGIS exists for Linux & Windows.
https://www.qgis.org/en/site/

> QGIS also supports geopdf files directly. (No need for conversation.)

I'm not sure yet what a "geopdf" file is, but I guess what you're saying is
that the PDFs from the USGS don't need to be "geocalibrated", is that what
you mean?

> But
> those huge files load (very) slowly. Therefore I did recommend using WMS
> services. These load nearly instantaneously.

WMS services?

Web map services?
http://www.qgistutorials.com/en/docs/working_with_wms.html

Googling, is this an appropriate hit to ponder?
https://www.northrivergeographic.com/qgiswms

> No need to load, convert and
> store huge amounts of raster data (which soon will be outdated), just to
> adjust a couple of track points to elevation contour lines..

Is this the right place to get started using QGIS to view and create
tracks, offline, on a desktop using USGS topographic maps?
https://www.qgis.org/en/site/forusers/index.html

Mike S

unread,
Mar 29, 2018, 5:37:05 AM3/29/18
to
Easy to do in javascript as well.

Bill Bradshaw

unread,
Mar 29, 2018, 1:43:27 PM3/29/18
to
There was one called DegMinSec by Mentor Software but they are gone and I
can not find the program online. Send me an email with your address and I
will send you a copy.
--
<Bill>

Brought to you from Anchorage, Alaska

Mike S

unread,
Mar 30, 2018, 2:50:29 AM3/30/18
to
Send me an email if you'd like a cleaned up version of this page,
including just the relevant HTML and javascript.
https://www.fcc.gov/media/radio/dms-decimal

Mike S

unread,
Mar 30, 2018, 5:04:26 AM3/30/18
to

Terje Mathisen

unread,
Mar 30, 2018, 6:16:05 AM3/30/18
to
I'm sure that you could write such a converter in PowerShell (assuming
you are on Windows), or you could download a free perl implementation
and use a script like this: If an input line contains 3 numbers it
assumes DD MM SS and returns DD MM.MMMM, if two it assumes DD MM.MMM and
returns DD.DDDDDD, and a single input is converted from DD.DDDDD to DD
MM SS.S.

#!perl -w
while (<>) {
chomp;
(my $d, $m, $s) = split;
if (defined($s) && $s ne '') { # 3 inputs!
printf("%s %6.4f\n", $d, $m+$s/60); # Return DD MM.MMMM
}
elsif (defined($m) && $m ne '') { # 2 inputs
printf("%8.6f\n", $d+$m/60); # Return DD.DDDDDD
}
elsif (defined($d)) {
$m = $d*60; $d = int($d); $m -= $d*60;
$s = $m*60; $m = int($m); $s -= $m*60;
printf("%2d %2d %4.1f\n", $d, $m, $s); # Return DD MM SS.S
}
}

I've tested this far enough to see that it is accurate at the sub-meter
level, which is far better than needed for map calibration.

Terje
0 new messages