At 22:11 21/11/2020 -0700, Gilles Noname wrote:
I need to convert GPS coordinates from
degrees+minutes+seconds (DMS) to decimal, eg.
00°05'12"O 42°59'12"N -> 42.98666667,-0.08666667
Can Calc do this, ...
I'm guessing that "O" means "east" (as in
"ouest"?) and that the alternatives to "O" and
"N" are "E" and "S" respectively?
If 00°05'12"O 42°59'12"N is in A1, then
will deliver 42.9866666667, and
will deliver -0.0866666667.
The extracted parts of the original string are
automatically converted from text to number on
the fly when they are used in the arithmetical
expressions. The equality tests in the last parts
of the formulae are TRUE for north and east and
FALSE for west and south. When used in an
arithmetical expression, TRUE is interpreted as
one and FALSE as zero. By doubling these and
subtracting one, we get +1 for TRUE and -1 for
FALSE, and we can multiply the calculated value
by this number to attach the appropriate sign.
This means that these formulae will also work for
positions east and south of the origin - so your
trip to the southern hemisphere will be covered.
I trust this helps.
To unsubscribe e-mail to: firstname.lastname@example.org
Posting guidelines + more: https://wiki.documentfoundation.org/Netiquette
List archive: https://listarchives.libreoffice.org/global/users/
Impressum (Legal Info)
: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (MPLv2
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our trademark policy