Geotagging - GPS coordinates - How far away was this photo taken?

Discussion related to "Everything" 1.5 Alpha.
Post Reply
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Geotagging - GPS coordinates - How far away was this photo taken?

Post by NotNull »

I was wondering why the trigonometry functions (sinus, cosinus, etc) were included in Everything. Not something one would need when handling files. Right?

Well, I found a semi-useful application: calculating the distance between two points on our planet. That way it should be possible to calculate "how far away" a picture was taken. Had a bit of fun converting an existing formula to something that can be used in Everything:
2025-01-01 19_09_49-d_ - Geo Distance (km) - Everything 1.5.0.1388a (x64).jpg
2025-01-01 19_09_49-d_ - Geo Distance (km) - Everything 1.5.0.1388a (x64).jpg (47.22 KiB) Viewed 2478 times
To "install":
  • Create a new filter (Menu => Search => Organize Filters)
  • Name = Geo Distance (km)
    (can be anything you like)
  • Search =

    Code: Select all

    pic:  latitude: longitude:   [define:EARTHRADIUS=6371] [define:mylat=48.858093]  [define:mylong=2.294694]   add-column:A   A-label:="Distance (km)"   A:=ROUND(ACOS(SIN(RADIANS(90-[mylat:]))*SIN(RADIANS(90-$latitude:))*COS(RADIANS([mylong:]-$longitude:))+COS(RADIANS(90-[mylat:]))*COS(RADIANS(90-$latitude:)))*[EARTHRADIUS:],0)
    
  • Change the "Home" latitude and longitude to reflect your current position.
    Currently:
    [define:mylat=48.858093] [define:mylong=2.294694]
    ( = Eiffel Tower in Paris)

    To find your "Home": right-click a point in Google maps (or similar) and select the coordinates.
    This will copy the coordinates to the clipboard



To use, type a search query in Everything that finds your geo-tagged photos and activate the Geo Distance (km) filter.
The distance to the "Home" location will be shown in the Distance (km) column.



Notes:
  • The formula assumes that the earth is a perfect sphere (sorry, flat-earthers ;)), which is roughly correct, but earth's radius varies from
    6357 to 6378 km. Rounding errors in the formulas are a factor too. So all values are approximate.
  • The earth radius is currently in kilometers; change it to miles if that suits you better. (
    [define:EARTHRADIUS=3959]
    )
    This will show distances in miles.
  • Only geo-tagged images will be shown.
  • It will take some time to process each image, just to find geo-tagging information.
    Consider indexing longitude and latitude to make this instant (in case you need this information more often).
tuska
Posts: 1159
Joined: Thu Jul 13, 2017 9:14 am

Re: How far away was this photo taken?

Post by tuska »

2NotNull
Thanks for sharing! :)
horst.epp
Posts: 1493
Joined: Fri Apr 04, 2014 3:24 pm

Re: How far away was this photo taken?

Post by horst.epp »

2NotNull

you're trying to make Everything to a (in German) "Eierlegende Wollmichsau" :)
Last edited by NotNull on Thu Jan 02, 2025 6:25 pm, edited 1 time in total.
Reason: Removed my name for privacy
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Re: How far away was this photo taken?

Post by NotNull »

Haha, yes indeed :lol:. Maybe that is why it is called .. Everything? ;)
jimspoon
Posts: 208
Joined: Tue Apr 26, 2011 11:39 pm

Re: How far away was this photo taken?

Post by jimspoon »

horst.epp wrote: Thu Jan 02, 2025 5:41 pm 2NotNull

you're trying to make Everything to a (in German) "Eierlegende Wollmichsau" :)
Google Translate tells me that means "egg laying woolly sow" !!
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Re: How far away was this photo taken?

Post by NotNull »

There is a typo in that: "mich" should be "milch" (= milk).
So a (n impossible) "multi-functional" animal that gives you eggs, wool, milk and meat ..
abr01
Posts: 118
Joined: Tue May 01, 2018 4:57 pm

Re: How far away was this photo taken?

Post by abr01 »

Hey, not bad. Is there a way to get the first digit after the full Kilometer, like 6.3km? And maybe only for the selected image?
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Re: How far away was this photo taken?

Post by NotNull »

I'm not sure if the results are even that accurate, but technically it can be done (untested, btw):
Change
A:=ROUND( .... ,0)
to
A:=ROUND( .... ,1)


Filters work on all items, not just the selected one.
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Re: How far away was this photo taken?

Post by NotNull »

BTW: Anyone got a suggestion for a new topic title?
The current one is terrible and I can't think of a better one ...
tuska
Posts: 1159
Joined: Thu Jul 13, 2017 9:14 am

Re: How far away was this photo taken?

Post by tuska »

NotNull wrote: Sat Feb 01, 2025 3:36 pm BTW: Anyone got a suggestion for a new topic title?
The current one is terrible and I can't think of a better one ...
Geotagging - GPS coordinates - How far away was this photo taken?

:?:
NotNull
Posts: 5769
Joined: Wed May 24, 2017 9:22 pm

Re: Geotagging - GPS coordinates - How far away was this photo taken?

Post by NotNull »

Yep, that's better. Thank you! :thumbsup:
abr01
Posts: 118
Joined: Tue May 01, 2018 4:57 pm

Re: How far away was this photo taken?

Post by abr01 »

NotNull wrote: Sat Feb 01, 2025 11:35 am I'm not sure if the results are even that accurate, but technically it can be done (untested, btw):
Change
A:=ROUND( .... ,0)
to
A:=ROUND( .... ,1)


Filters work on all items, not just the selected one.
Thanks!
Post Reply