Author Topic: Search GPS location  (Read 1323 times)

Fulco

  • Full Member
  • ***
  • Posts: 77
Search GPS location
« on: October 19, 2015, 06:16:45 PM »
Is it possible to search for a specific GPS location?

I tried these commands, but without result:

exiftool -if 'abs($gpslatitude# - 48.8577471913) and abs($gpslongitude# - 2.2952922789)' -filename

exiftool -if '$gpslatitude =~ "48.8577471913"' -FileName


Thanks!
Fulco

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 16885
    • ExifTool Home Page
Re: Search GPS location
« Reply #1 on: October 19, 2015, 07:20:18 PM »
Hi Fulco,

exiftool -if 'abs($gpslatitude# - 48.8577471913) and abs($gpslongitude# - 2.2952922789)' -filename

This tests to see if the position is exact (ie. the abs() returns zero), which is always problematic with floating point numbers.

Quote
exiftool -if '$gpslatitude =~ "48.8577471913"' -FileName

This syntax is wrong for a number of reasons.

I think you are perhaps looking for something more like this:

exiftool -if 'abs($gpslatitude# - 48.8577471913) < 1e-6 and abs($gpslongitude# - 2.2952922789) < 1e-6' -filename DIR

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

Fulco

  • Full Member
  • ***
  • Posts: 77
Re: Search GPS location
« Reply #2 on: October 20, 2015, 03:40:54 AM »
Thank you very much!