-2

How can I convert Wikipedia coordinates coming directly from source code into decimal ones?

Input: DMS coordinates

{{coord|33|21|30.5|S|70|41|50.4|W|scale:5000}}

Desired output:

-33.358472, -70.697333

Should I use geoconvert or try to do it with awk?

agmoermann
  • 86
  • 7
  • 1
    how would you get "-33.358472" from "33". You can't normally add additional information. only reformat or remove. If the data isn't there and you don't know what it will always be, then you can't really do it. – James Lingham Apr 10 '18 at 11:10
  • DMS to decimal calculation is easy if you have all the values. – agmoermann Apr 10 '18 at 11:21
  • sorry I misunderstood. I'll update with an answer – James Lingham Apr 10 '18 at 11:23
  • 1
    Sorry, this is not the way StackOverflow works. Questions of the form "I want to do X, please give me tips and/or sample code" are considered off-topic. Please visit the [help] and read [ask], and especially read [Why is “Can someone help me?” not an actual question?](http://meta.stackoverflow.com/q/284236) – kvantour Apr 10 '18 at 13:00

1 Answers1

0
D + M/60 + S/3600

Is the formular to convert from DMS to Decimal. Have you been able to parse the input to be able to get the DMS values on their own, or is this what you are struggling with?

James Lingham
  • 419
  • 1
  • 3
  • 17