1

How do I convert a Google maps link to GPS coordinates? (I think

10°11'12.0"N 13°14'15.0"E

is an example of a common GPS coordinate format.)

The reason I ask is that Google Maps for Android (I use Samsung Galaxy Note 3) does not seem to give coordinates. It will only give Google links. (Any instructions with right click can not be followed in a phone, only in a computer.)

For example. How do I convert the following link to find the coordinates of the Eiffel Tower:

http://goo.gl/maps/VqEsU

I think there have been earlier standards by Google where the hyperlink arguments contained the coordinates. But the current standard is more cryptic.

Right now I want to do it manually in my Android (Samsung Galaxy Note 3) phone. But maybe the question is of interest for programmatic conversion too.

Edit:

This question is NOT about the conversion between decimal and DMS (degrees, minutes, seconds) formats for coordinates. Many web pages and code-snippets are available for that.

cvr
  • 161
  • 1
  • 2
  • 10

2 Answers2

2

You need to unshorten the url link, and the result will be and url with coordinates embedded in it. In your example:

https://www.google.com/maps/place/Eiffel+Tower/@48.8583701,2.2922926,17z/data=!3m1!4b1!4m2!3m1!1s0x0:0x8ddca9ee380ef7e0?hl=en

See this topic on how to unshorten using Python: How can I unshorten a URL?

Then you need to parse it for the coordinates, for example by searching for the @ character. Assume your long url is called longurl. In Python, you can do

import re
temp = re.search('@([0-9]?[0-9]\.[0-9]*),([0-9]?[0-9]\.[0-9]*)', longurl, re.DOTALL)
latitude  = temp.groups()[0]
longitude = temp.groups()[1]

(Then you can further convert it from DD to minutes, seconds, if you need that.)

Community
  • 1
  • 1
GEK
  • 61
  • 5
  • The GPS coordinates in this URL aren't the ones for the place; they represent the position on the screen, when the URL was copied, or resolved through a shortlink. Would have been too easy, unfortunately. – TigrouMeow Dec 01 '22 at 00:06
-1

This link shows you how to convert coordinates from a Google Maps link (which is in DD, aka decimal degrees) into GPS coordinates (DMS - degrees, minutes, seconds). The general idea is to take the DD value and split it up into the degrees, minutes, and seconds values for latitude and longitude using the following process:

1) Take the integer value. This becomes the degrees.

2) Take the remaining decimal value and multiply it by 60. The integer portion of this value is the minutes.

3) Lastly, take the remaining decimal value and multiply it by 60 again. This is the seconds value (and is generally rounded off to 2 decimal points).

Example: 48.8583701, 2.2944813

Latitude: degrees = 48

0.8583701 * 60 = 51.502206 => minutes = 51

0.502206 * 60 = 30.13236 => seconds = 30.13

Latitude (DMS): 48º 51' 30.13" N

The link also has some code if you want to do it programmatically.

not_a_bot
  • 2,332
  • 2
  • 19
  • 33
  • Please check the example of Google link in the question. It is given in letters. How do you find the decimal (or DMS) representation of these letters? – cvr Sep 14 '15 at 23:17
  • Ah, sorry I misunderstood your question. I believe you can do it on iOS but I don't think it's possible on Android devices. – not_a_bot Sep 14 '15 at 23:55