Thanks.
For others' benefit, here's some code that seems to work to find geotagged pictures that were shot within 100 meters from a reference location:
#include <GUIConstantsEx.au3>
#include <ListViewConstants.au3>
#include <GDIPlus.au3>
#include <File.au3>
#include <Math.au3>
;https://stackoverflow.com/questions/37484988/distance-formula-between-two-lat-longs-autoit
Func _distanceInKm($lat1, $lon1, $lat2, $lon2)
Local $iRadius = 6371
Local $iLat = _Radian($lat2 - $lat1)
Local $iLon = _Radian($lon2- $lon1)
Local $a = Sin($iLat / 2) * Sin($iLat / 2) + Cos(_Radian($lat1)) * Cos(_Radian($lat2)) * Sin($iLon / 2) * Sin($iLon / 2)
Local $c = 2 * ATan2(Sqrt($a), Sqrt(1 - $a))
Local $d = $iRadius * $c
Return Abs($d)
EndFunc
Func ATan2($y, $x)
Return (2 * ATan($y / ($x + Sqrt($x * $x + $y * $y))))
EndFunc
Local Const $REF_LAT = 1.23, $REF_LON = 4.56
Local Const $RADIUS = 100 ; meters
Local $distance ; meters
ConsoleWrite("Let's get going" & @CRLF)
Local $sFileSelectFolder = FileSelectFolder("Select a folder", "")
If @error Then Exit MsgBox($MB_SYSTEMMODAL, "", "No folder was selected.")
Local $aArray = _FileListToArrayRec($sFileSelectFolder, "*.jpg", $FLTAR_FILES , $FLTAR_RECUR, $FLTAR_NOSORT,$FLTAR_FULLPATH )
;_ArrayDisplay($aArray, "JPG")
If UBound($aArray) = 0 Then Exit ConsoleWrite("zero elements") ;1D array only
_GDIPlus_Startup()
Local $filename, $OSM_URL = "https://www.openstreetmap.org/?"
For $picindx = 1 to UBound($aArray) -1
$filename = $aArray[$picindx]
Local $hImage = _GDIPlus_ImageLoadFromFile($filename)
If @error Then
_GDIPlus_Shutdown()
ConsoleWrite("An error has occured - unable to load image! " & $filename)
Exit
EndIf
Local $aPropID = _GDIPlus_ImageGetPropertyIdList($hImage)
;_ArrayDisplay($aPropID)
Local $aValues, $GpsLatitudeRef, $GpsLongitudeRef
For $i = 1 To $aPropID[0][0]
Switch $aPropID[$i][1]
Case "GpsLatitudeRef"
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) Then
$GpsLatitudeRef = $aValues[1]
EndIf
Case "GpsLongitudeRef"
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) Then
$GpsLongitudeRef = $aValues[1]
EndIf
Case "GpsLatitude"
Local $sOutput = ""
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) Then
For $y = 1 To $aValues[0]
$sOutput &= $aValues[$y] & "."
Next
EndIf
;~ $sOutput = $aPropID[$i][1] & " = " & $GpsLatitudeRef & " " & StringTrimRight($sOutput, 1)
;~ ConsoleWrite($sOutput & @CRLF)
Local $sOutput = ""
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) And $aValues[0] = 3 Then
Local $GpsLatitude_Decimal
For $y = 1 To $aValues[0]
Switch $y
Case 1
$GpsLatitude_Decimal = $aValues[$y]
Case 2
$GpsLatitude_Decimal += ($aValues[$y] / 60)
Case 3
$GpsLatitude_Decimal += ($aValues[$y] / 3600)
EndSwitch
Next
EndIf
$sOutput = $aPropID[$i][1] & "Decimal = " & $GpsLatitudeRef & " " & $GpsLatitude_Decimal
;ConsoleWrite($sOutput & @CRLF & @CRLF)
;ConsoleWrite($GpsLatitude_Decimal & ",")
Case "GpsLongitude"
Local $sOutput = ""
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) Then
For $y = 1 To $aValues[0]
$sOutput &= $aValues[$y] & "."
Next
EndIf
;~ $sOutput = $aPropID[$i][1] & " = " & $GpsLongitudeRef & " " & StringTrimRight($sOutput, 1)
;~ ConsoleWrite($sOutput & @CRLF)
Local $sOutput = ""
$aValues = _GDIPlus_ImageGetPropertyItem($hImage, $aPropID[$i][0])
If IsArray($aValues) And $aValues[0] = 3 Then
Local $GpsLongitude_Decimal
For $y = 1 To $aValues[0]
Switch $y
Case 1
$GpsLongitude_Decimal = $aValues[$y]
Case 2
$GpsLongitude_Decimal += ($aValues[$y] / 60)
Case 3
$GpsLongitude_Decimal += ($aValues[$y] / 3600)
EndSwitch
Next
EndIf
;$sOutput = $aPropID[$i][1] & "Decimal = " & $GpsLongitudeRef & " " & $GpsLongitude_Decimal
$OSM_URL &= StringFormat("mlat=%s&mlon=%s",$GpsLatitude_Decimal,$GpsLongitude_Decimal)
$distance =Int(1000 * _distanceInKm($REF_LAT, $REF_LON, $GpsLatitude_Decimal, $GpsLongitude_Decimal))
If $distance <= $RADIUS Then ;picture taken within $RADIUS of reference location?
ConsoleWrite($filename & @CRLF)
ConsoleWrite("Distance : " & $distance & @CRLF)
ConsoleWrite($OSM_URL & @CRLF & @CRLF)
EndIf
$OSM_URL = "https://www.openstreetmap.org/?" ;reset
EndSwitch
Next
_GDIPlus_ImageDispose($hImage)
Next
_GDIPlus_Shutdown()
ConsoleWrite("Done." & @CRLF)