Loop through dirs and JPGs and list files that lie within 50m from a location?

Started by Winfried, June 03, 2023, 02:42:45 PM

Previous topic - Next topic

Winfried

Hello,

Before I learn how to do this in Python, I'd like to check if ET can't do it on the command line.

I need to loop through all the JPGs in a directory (and its sub-directories), and find all the pictures that were taken within 50m from a lat+lon — and possibly build a GPX file with a link that I can just click to see the picture.

Can ET do this somehow?

Thank you.

StarGeek

I think it would be difficult to do the calculations directly on the command line. The problem on the command line would be having to access two different tags (the GPS coordinates) and then working in the center point coordinates and then the distance.

It probably would be possible to create a user defined tag, as I don't think the calculations would be that difficult, though I haven't looked into it.  But then, it also depends upon how accurate you want it to be.  Does it include the curvature of the earth or a simple direct line?  Does altitude enter in to it?
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Winfried

Thanks.

Pictures are geotagged by my smartphone. It includes infos shown below. I don't need much accuracy: I just need to find which pictures were taken around a location, even if they're a bit a few meters aways from 50m.

GPSLatitudeRef - N
GPSLatitude - 48  47  29.3099 (48.791475)
GPSLongitudeRef - E
GPSLongitude - 2  15  9.8388 (2.252733)
GPSAltitudeRef - Above Sea Level
GPSAltitude - 212.13 m
GPSTimeStamp - 12  27  11
GPSDateStamp - 2023:06:03


Winfried

Perfect!

c:\Apps\exiftool.exe -filename -if "$toRad=3.14159/180;$conv=6371*$toRad;(($gpslatitude#-$lat)*$conv)**2 + (($gpslongitude#-$lon)*$conv*cos($gpslatitude#*$toRad))**2 < $dist*$dist" -userparam lat=48.791475 -userparam lon=2.252733 -userparam dist=1 .
Google didn't help finding if "dist" can be set in meters. Kilometers isn't as useful for my need.

https://metacpan.org/dist/Image-ExifTool/view/lib/Image/ExifTool.pod#Options

StarGeek

Quote from: sevy on June 04, 2023, 02:50:22 AMmay be a first approach here :

Ah, you search was more successful than mine.  And I was over complicating things while thinking about it.

Quote from: Winfried on June 04, 2023, 03:14:27 AMGoogle didn't help finding if "dist" can be set in meters. Kilometers isn't as useful for my need.

Meters from Kilometers is easy, unlike Imperial measurements.  Just divide by 1000
-userparam dist=.05
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

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

StarGeek

Wouldn't that be 1 meter?  The first post says they want to be within 50 meters  50/1000=0.05
"It didn't work" isn't helpful. What was the exact command used and the output.
Read FAQ #3 and use that cmd
Please use the Code button for exiftool output

Please include your OS/Exiftool version/filetype

Phil Harvey

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