ExifTool Forum

ExifTool => Bug Reports / Feature Requests => Topic started by: Valour549 on August 08, 2021, 10:13:41 PM

Title: Add search by GPS coordinates on Google Maps
Post by: Valour549 on August 08, 2021, 10:13:41 PM
So in the old days I use OPanda IExif, which has a really convenient feature of opening up Google Maps using the GPS coordinates contained in the exif. Like in the screenshots below.

Nowadays I enjoy the fantastic ImageGlass which has incorporated the equally fantastic exiftool.exe functionality into its interface (the tool still opens separately as a program), and it would be really awesome to have that function as well.

Because often one would browse old photos and think really hard hmmm where was this taken? And two clicks later you remember.

I did however note in the "GPS Position" column exiftool uses deg instead of the symbol ° , which Google Map does not recognize as valid. So that small change would need to be made if this functionality were ever to be incorporated into exiftool.

Thanks.
Title: Re: Add search by GPS coordinates on Google Maps
Post by: StarGeek on August 08, 2021, 11:41:17 PM
Quote from: Valour549 on August 08, 2021, 10:13:41 PM
I did however note in the "GPS Position" column exiftool uses deg instead of the symbol ° , which Google Map does not recognize as valid. So that small change would need to be made if this functionality were ever to be incorporated into exiftool.

You can use the -c (-coordFormat) option (https://exiftool.org/exiftool_pod.html#c-FMT--coordFormat) to format the coordinates any way you want.  Or you can use the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) and exiftool will return the coordinates as decimal.

Finally, you can use the config file in this post (https://exiftool.org/forum/index.php?topic=9862.msg51226#msg51226) and get an URL to display the coordinates on Bing, Google, MapQuest, Open Street Maps, or Yandex.
Example output of the config file
C:\>exiftool -config GPS2MapUrl.config -G1 -s -GPSLatitude# -GPSLongitude# -*mapsurl y:\!temp\Test4.jpg
[Composite]     GPSLatitude                     : 40.6892
[Composite]     GPSLongitude                    : -74.0445
[Composite]     BingMapsUrl                     : https://bing.com/maps/default.aspx?cp=40.6892~-74.0445&sp=point.40.6892_-74.0445_.
[Composite]     GoogleMapsUrl                   : https://www.google.com/maps/search/?q=40.6892,-74.0445
[Composite]     MapquestMapsUrl                 : https://www.mapquest.com/?q=40.6892,-74.0445
[Composite]     OpenStreetMapsUrl               : https://www.openstreetmap.org/?mlat=40.6892&mlon=-74.0445
[Composite]     YandexMapsUrl                   : https://yandex.com/maps/?ll=-74.0445%2C40.6892&text=40.6892%2C-74.0445
Title: Re: Add search by GPS coordinates on Google Maps
Post by: sevy on August 09, 2021, 01:34:50 AM
I often use XnView (when a picture has GPS, you can see it on your favorite browser) or XnViewMP (with integrated view of GoogleMaps).
https://www.xnview.com/en/
Title: Re: Add search by GPS coordinates on Google Maps
Post by: Valour549 on August 10, 2021, 11:51:39 PM
Quote from: StarGeek on August 08, 2021, 11:41:17 PM
Quote from: Valour549 on August 08, 2021, 10:13:41 PM
I did however note in the "GPS Position" column exiftool uses deg instead of the symbol ° , which Google Map does not recognize as valid. So that small change would need to be made if this functionality were ever to be incorporated into exiftool.

You can use the -c (-coordFormat) option (https://exiftool.org/exiftool_pod.html#c-FMT--coordFormat) to format the coordinates any way you want.  Or you can use the -n (--printConv) option (https://exiftool.org/exiftool_pod.html#n---printConv) and exiftool will return the coordinates as decimal.

Finally, you can use the config file in this post (https://exiftool.org/forum/index.php?topic=9862.msg51226#msg51226) and get an URL to display the coordinates on Bing, Google, MapQuest, Open Street Maps, or Yandex.
Example output of the config file
C:\>exiftool -config GPS2MapUrl.config -G1 -s -GPSLatitude# -GPSLongitude# -*mapsurl y:\!temp\Test4.jpg
[Composite]     GPSLatitude                     : 40.6892
[Composite]     GPSLongitude                    : -74.0445
[Composite]     BingMapsUrl                     : https://bing.com/maps/default.aspx?cp=40.6892~-74.0445&sp=point.40.6892_-74.0445_.
[Composite]     GoogleMapsUrl                   : https://www.google.com/maps/search/?q=40.6892,-74.0445
[Composite]     MapquestMapsUrl                 : https://www.mapquest.com/?q=40.6892,-74.0445
[Composite]     OpenStreetMapsUrl               : https://www.openstreetmap.org/?mlat=40.6892&mlon=-74.0445
[Composite]     YandexMapsUrl                   : https://yandex.com/maps/?ll=-74.0445%2C40.6892&text=40.6892%2C-74.0445


That looks very useful, but where exactly do I add stuff like -config GPS2MapUrl.config and -c FMT (-coordFormat)? Namely which files and where.

As mentioned I use ImageGlass and the author of that basically only told us to put exiftool.exe in the same folder as the ImageGlass.exe. I assume I need some other files.
Title: Re: Add search by GPS coordinates on Google Maps
Post by: StarGeek on August 11, 2021, 12:25:23 AM
The example I give showed how to use the config on the command line.  You would download the config file in the linked thread and place it in the same directory as exiftool.

The -c option would be that option followed by a format string as shown in the link to the docs.  Taking the default listed there and swapping in the character you want would result in
exiftool -c "%d° %d' %.2f"\" -GPSLatitude -GPSLongitude file.jpg

I don't know about ImageGlass or how flexible it is or if it can be expanded to include other exiftool options.  I was just pointing out that exiftool can already do some of the stuff you want.
Title: Re: Add search by GPS coordinates on Google Maps
Post by: Valour549 on August 11, 2021, 12:45:59 AM
Quote from: StarGeek on August 11, 2021, 12:25:23 AM
The example I give showed how to use the config on the command line.
Where or what is the command line? Could you kindly screenshot, cheers.
Title: Re: Add search by GPS coordinates on Google Maps
Post by: StarGeek on August 11, 2021, 01:08:22 AM
On Windows it would be CMD (https://en.wikipedia.org/wiki/Cmd.exe) or PowerShell (https://en.wikipedia.org/wiki/PowerShell).  On Mac it would be Terminal (https://en.wikipedia.org/wiki/Terminal_(macOS)).  On Linux it would be the Bash Shell (https://en.wikipedia.org/wiki/Unix_shell) or some variation of that. 

The command line is where you would type in commands to run instead of clicking buttons in a GUI.
(https://i.imgur.com/safVJoA.gif)
Title: Re: Add search by GPS coordinates on Google Maps
Post by: Phil Harvey on August 13, 2021, 12:59:13 PM
Cool screen capture.  You should put that in the Newbies "Getting Started" (https://exiftool.org/forum/index.php?topic=4888.0) thread.

- Phil
Title: Re: Add search by GPS coordinates on Google Maps
Post by: StarGeek on August 14, 2021, 11:16:35 AM
The fact that it exists implies that I probably posted it somewhere on the forums before.  Or at the very least planned to.  But I'm not sure what use it miight be because of the fact that I extensively use my personal shortcuts, my text replacement program, and copy/paste from the clipboard in it.  Someone might see that I typed "et" and list a tag called "dto" and get confused.

The recording program, Terminalizer (https://github.com/faressoft/terminalizer), is nodejs and cross platform.  The main problem I had with it was a lack of timing controls.  It should be easier to speed up the typing part, then pause for time to read it.  It logs the key presses in a text file so you could edit it that way, but that's not quick/easy.