How to insert GPS coordinates from photo metadata into Google Maps?

Started by tharmon, August 03, 2024, 02:26:27 PM

Previous topic - Next topic

tharmon

I read somewhere that it was easy to do this with Exiftool. All I see, as a newbie, are explanations that would take me months to figure out.  If I could just copy the GPS coordinates found in the properties of my photo, maybe I could then paste them into Google Maps.   But I can't "copy" them!  Can someone give me an easy explanation or tell me some other application that makes this easy? I realize I can type in the coordinates into Google Maps, but I've got thousands of pictures I want to be able to do this with and that process would be very cumbersome.   Thanks so much for any suggestions... Tom

StarGeek

It's easy enough to list the data with exiftool. The problem I'm not understanding is what you are doing on the Google side of things. You say you paste the data into Google, then what? Paste the next one? What's the point? Are you saving this on Google somehow?

If the image has GPS coordinates, you can upload it to Google Photos and Google will read the location, allowing you to go to the map. You can also use exiftool to create a KML or GPX track (download and read the FMT files on GitHub). Or you can extract all the coordinates into a CVS file, which you could load into a spreadsheet program such as LibreOffice or Excel.

Finally, there's a config file in this post that will create a link to the GPS location on Google maps, as well as a couple other mapping sites (though Bing and MapQuest are broken ATM). For example, this command creates a link to Google maps for GPS Coordinates 40.6892, -74.0445 (The values set in the file)
C:\>exiftool -config GPS2MapUrl.config -GPSPosition -GoogleMapsUrl y:\!temp\Test4.jpg  -n
GPS Position                    : 40.6892 -74.0445
Google Maps Url                 : https://www.google.com/maps/search/?q=40.6892,-74.0445
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

tharmon

Let me tell you more of what my work flow is:  My hobby is genealogy and I occasionally visit graveyards in Massachusetts and Connecticut and take photos of the gravestones of ancestors and others.  My camera records the GPS coordinates of where I took the photo.  When I get home, I import a photo into a program called BatchPhoto which enables me to attach a caption to the photo telling what I know about that person.  I also can add the GPS coordinates of where the picture was taken automatically. 
     Then I print the photo with all this information and put it in a loose leaf binder/book.  I expect somewhere down the line, I or some relative of mine will see a photo and want to retrace my steps as to how I got to the site of the grave.  That's where the GPS coordinates come in.... I want to find an easy way to bring up a google type map showing exactly where the grave is located so that I know how to drive to that location and proceed into the cemetery and easily find the grave stone. (without the GPS, it can take hours to locate a gravestone in a large cemetery!)   I realize I can look at the page and manually enter the letters, signs and numbers of the GPS coordinates into Google Maps.  But I'm looking for an easier way... its so cumbersome to manually enter all those numbers and degree signs and letters and not know if you've made a mistake.  I guess what I'd like to do is be able to take my iPhone and with an app take a photo of the page with the GPS Coordinates and have the "smart app" recognize the coordinates and instantly take me to where the grave stone is on the Google Map.  To go one step further, if I could convert the printed picture of the GPS coordinates (as in OCR) and easily enter them into my Garmin GPS unit and use the "Garmin Trip Planner" to set a convenient/efficient route for visiting 15 or 20 gravestones in a one day's trip, that would really be cool!

Anyway, that's the rabbit hole I go down.  Thanks for taking the time and I appreciated any thoughts... Tom


StarGeek

Quote from: tharmon on August 03, 2024, 05:51:26 PMThen I print the photo with all this information and put it in a loose leaf binder/book.

To verify, do you keep the original digital file or delete it after printing?

If you keep them, then a good Digital Asset Management (DAM) program would help. Lightroom would be a paid option, but DigiKam is a good free option. For example, here you can see that the selected picture shows up located on the map sidebar.
firefox-2024-08-03_16.07.24.png

Clicking the globe in the lower right next to where it says "Google Maps" will bring up the location on Google maps using Digikam's built in browser. From there, you can hit "Desktop Browser" and pull it up on your default browser
digikam-2024-08-03_16.11.46.png
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Alan Clifford

My thoughts?  A QR code that you can print and can be scanned

I thought I'd found an easy solution at https://www.qrcodechimp.com/qr-code-generator-for-googleMaps
but when I put in one of my links, it tells me I don't have permission.

Failure in detail.  On this page, http://clifford.ac/potpourri/tn/x-s1_4645.jpg.index.html is a link called location map.  Click on that and you get a google map.  If you copy the link and paste it into grcode chimp, you are told "Forbidden".

Some research on QR code generators is needed methinks as the way forward.

Alan Clifford

I generated a QR code here https://qrgenerator.org/location-qr/ but don't know how to use it yet.

Alan Clifford

My phone is a tad old so I had to open google lens in the camera app and using that, it opens google maps at the location.



tharmon

Quote from: StarGeek on August 03, 2024, 07:24:43 PM
Quote from: tharmon on August 03, 2024, 05:51:26 PMThen I print the photo with all this information and put it in a loose leaf binder/book.

To verify, do you keep the original digital file or delete it after printing?

If you keep them, then a good Digital Asset Management (DAM) program would help. Lightroom would be a paid option, but DigiKam is a good free option. For example, here you can see that the selected picture shows up located on the map sidebar.
firefox-2024-08-03_16.07.24.png

Clicking the globe in the lower right next to where it says "Google Maps" will bring up the location on Google maps using Digikam's built in browser. From there, you can hit "Desktop Browser" and pull it up on your default browser
digikam-2024-08-03_16.11.46.png



I Keep the original file.  However, its a real problem for me to find the original photo since I have never developed a good organizational layout.  I really am relying on the paper copy for purposes of posterity.  Nobody would ever be able to dig into my computer and be able to make any sense of it.  I think the paper photos with captions and gps coordinates can possibly be enjoyed and have meaning.  But it would be a lot more fun if someone could easily see the paper GPS coordinates and have OCR translate it to a google maps location as previously mentioned. 

StarGeek

Quote from: Alan Clifford on August 03, 2024, 07:31:22 PMMy thoughts?  A QR code that you can print and can be scanned

That's a really good idea!

A quick search and I found a program called qrencode. You can use it to simply record the GPS coordinates and the camera scanning it can pull up the location on whatever mapping program is available. It's a Linux program, but there is a Windows port of it.

I found this HowToGeek page which has install instructions for Linux as well as the command for a GPS QR code.

I would probably use exiftool to create a BAT file to extract the GPS coordinates and run qrencode.  Something like this (use CMD, not PowerShell)
exiftool -if "$GPSLatitude" -n -p "qrencode -s 6 -l H -o \"$Directory\${Basename}-QR.png\" \"geo:$GPSLatitude,$GPSLongitude\" " /path/to/files/  >temp.bat/

I just tested this on a directory of random files and it created a QR PNG file for each file that had a GPS coordinate.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

Alan Clifford

Another thought.  What3words.  Print the 3 words next to the photo.  I know some people are very dismissive of what3words but it is another way of giving the location and might be easier to type in if neccessary

I use the what3words with curl in a script to get the 3 words for a photo using the gps coordinates in a photo (and then store it in the photo and the website generator puts it on the web page.  Example http://clifford.ac/photo/2022/SouthAfrica.WeaverBirds.SepOct/tn/ahc_9000.jpg.index.html)

The three words for the photo at http://clifford.ac/potpourri/tn/x-s1_4645.jpg.index.html are

velvety.upper.consistency

which can be used at https://map.what3words.com/velvety.upper.consistency


wywh

Quote from: StarGeek on August 03, 2024, 08:34:27 PMI would probably use exiftool to create a BAT file to extract the GPS coordinates and run qrencode.  Something like this (use CMD, not PowerShell)
exiftool -if "$GPSLatitude" -n -p "qrencode -s 6 -l H -o \"$Directory\${Basename}-QR.png\" \"geo:$GPSLatitude,$GPSLongitude\" " /path/to/files/  >temp.bat/

I just tested this on a directory of random files and it created a QR PNG file for each file that had a GPS coordinate.

I installed qrencode to macOS Sonoma via MacPorts and it runs OK.

What would be a similar command to extract GPS and create QR PNG from .jpg images in that environment?

- Matti

StarGeek

Quote from: Alan Clifford on August 04, 2024, 07:41:15 AMI know some people are very dismissive of what3words but it is another way of giving the location and might be easier to type in if neccessary

The only real problem I see with What3Words is how future-proof it might be. I have doubts they make their database available for offline use, so if their servers get closed down, the three words won't be very useful.

* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

Quote from: wywh on August 04, 2024, 10:09:38 AMWhat would be a similar command to extract GPS and create QR PNG from .jpg images in that environment?

I don't know enough about Macs to comment.  The command I listed simply dumped a list of commands into a file, which would run as a bat file
qrencode -s 6 -l H -o "y:/!temp\Test Tiff-QR.png" "geo:5.346783,-3.985286"
qrencode -s 6 -l H -o "y:/!temp\Test10-QR.png" "geo:5.346783,-3.985286"
qrencode -s 6 -l H -o "y:/!temp\Test3-QR.png" "geo:-74.0445,-74.0445"
qrencode -s 6 -l H -o "y:/!temp\Test3a-QR.png" "geo:40.6892,-70.0445"
qrencode -s 6 -l H -o "y:/!temp\Test3aa-QR.png" "geo:-40.6892561896139,-70.0445326593333"
qrencode -s 6 -l H -o "y:/!temp\test3_(2)-QR.png" "geo:47.0480365833333,-122.904128366667"
qrencode -s 6 -l H -o "y:/!temp\Test4-edited-QR.png" "geo:40.69,-74.04"
qrencode -s 6 -l H -o "y:/!temp\Test4-QR.png" "geo:40.6892,-74.0445"
qrencode -s 6 -l H -o "y:/!temp\Test5-QR.png" "geo:32.8113334686417,-117.148225494572"
qrencode -s 6 -l H -o "y:/!temp\Test6-QR.png" "geo:32.8113334686417,-117.148225494572"
qrencode -s 6 -l H -o "y:/!temp\test_1-QR.png" "geo:-10.95,-63.85"
qrencode -s 6 -l H -o "y:/!temp\Test_small-QR.png" "geo:56.52086,27.25973"

Maybe just put #! /bin/bash on the first line? See This StackOverflow answer.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).

StarGeek

I created a config file that will run qrencode for any file with GPS coordinates. See this post.
* Did you read FAQ #3 and use the command listed there?
* Please use the Code button for exiftool code/output.
 
* Please include your OS, Exiftool version, and type of file you're processing (MP4, JPG, etc).