Friday 23 March 2012

Howto: Use GPS coordinates with Google Maps

UPDATE: This article is for those who want to extract GPS coordinates from an image and plot the location in Google Maps. If you just want a quick and easy way to visualise an image's location, and you don't want to install any tools, I've now published a faster method (27/03/2012).

If you have a set of GPS coordinates that you want to convert into a real location here are some handy tips. The first one is not to use Windows Explorer in Windows 7 to obtain the coordinates!

Find the coordinates

Let's say that the coordinates have come from an iPhone, perhaps embedded in an image. You could use Windows 7 to find them, but you'll see incomplete data.

For example:
An image's Properties may
reveal some metadata, including
partial GPS coordinates
This tells us that the image was taken at the following coordinates.
Latitude 19; 26; 13.19999999999...
Longitude 99; 8; 27.59999999997671
As we will see, this is actually so misleading as to be wrong.

Find the polarity

We need to know the polarity of the Longitude and Latitude. Unfortunately Windows 7 doesn't show you this crucial piece of information. As a result, in this example both values above are reported as being positive values - but actually they should not be.

You can discover this information using an image viewer capable of reading Exif data or using a tool like ExifTool.

Here is part of ExifTool's output, which is much more helpful than Windows 7's output:
GPS Latitude: 19 deg 26' 13.20" N
GPS Longitude: 99 deg 8' 27.60" W
If the Longitude value (99) was East (E) then the polarity would be positive (+), as reported by Windows Explorer. In this example it is West (W) so the polarity should be negative (-).

With Latitude you are looking at possible North (N) and South (S) values, which are positive and negative respectively. In this example the value is positive so Windows gets it right by accident.

To summarise:
Longitude (E): +
Longitude (W): -
Latitude (N): +
Latitude (S): -
Using Google Maps

Thus far we have some coordinates, as reported by Windows. We also have the polarity as reported by ExifTool:
Latitude 19; 26; 13.19999999999...
Longitude 99; 8; 27.59999999997671

Latitude: N
Longitude: W
You should be able to enter these figures into Google Maps and see where the photo was taken, but you need to make a few small changes first.

We'll shorten the last figures on each line to make things neat but the most important thing is to express the values in degrees, minutes and seconds. To do this replace each semicolon with a space like this:
Latitude 19 26 13.20
Longitude 99 8 27.60
Next, take the second figure from each set of values and add an apostrophe mark to show which figure is in minutes:
Latitude 19 26' 13.20
Longitude 99 8' 27.60
Suffix the final figure with a quote mark, to define the seconds and make the second set of values (Longitude) negative if its polarity is W:
Latitude 19 26' 13.20"
Longitude -99 8' 27.60"
Finally, express the coordinates in one line, without the Latitude and Longitude labels:
19 26' 13.20" -99 8' 27.60"
Alternatively you can state the coordinates using the North and West labels (but remove the minus sign) like this:
19 26' 13.20" N 99 8' 27.60" W
Paste either of the above sets of coordinates directly into the Google Maps search box and you will see the location on a map or satellite photo.

Google Maps can find a location
using GPS coordinates
Note: To extract coordinates from Google Maps right-click on a location and choose 'What's here?' from the drop-down menu. The search box will now contain the coordinates of that location.

6 comments:

  1. This hepled me too much.

    Many thanks

    ReplyDelete
  2. Thank you so much...helped me understand how to use the co-ordinates from Avast anti theft service.

    ReplyDelete
  3. Nice! Thanks!

    ReplyDelete
  4. and how do we go the other way around? from GPS co-ords to a google maps hyperlink?

    ReplyDelete
  5. This article describes how to do just that, unless I misunderstand you.

    ReplyDelete
  6. This was the ONLY, I repeat the ONLY website, of all the google search results, that explained the concept so clearly, and very clearly explained how to interpret the GPS information from the picture properties from the picture file, and then translate it into something you can put in the google map application. Cant believe this was not on the top of the search results. It also covered the things that are not accurate in the Properties information, and covered how to correct for it. Excellent article. Thank you very much Mr.Edwards !!!

    ReplyDelete