Skip to content

Instantly share code, notes, and snippets.

@pas-calc
Last active December 18, 2023 10:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save pas-calc/0e6063affa749fedc2e51cea88345929 to your computer and use it in GitHub Desktop.
Save pas-calc/0e6063affa749fedc2e51cea88345929 to your computer and use it in GitHub Desktop.
GEO Exif Coordinate viewer
#!/bin/bash
# Pascal K.
# Mi 25 Nov 2020 23:36:54 CET
# Do 26 Nov 2020 13:43:43 CET
# Mo 18 Dez 2023 11:32:34 CET - use "xdg-open" to open link in browser
echo "GEO Exif Coordinate viewer"
echo "--------------------------"
echo "Filename = $1"
if [ -f "$1" ]; then
file "$1"
else
echo "File does not exist."
exit 1
fi
coords=$(exiftool -c "%+.6f" "$1" |grep "GPS Position" | cut -d":" -f2 | tr -d ' ')
[[ -z "$coords" ]] && { echo "Error: Coords not found"; exit 2; }
echo "Coord=${coords}"
xdg-open "http://geo.klein-computing.de/gpx_tool.html#${coords}"
exit 0
@rolfn
Copy link

rolfn commented Nov 23, 2023

My Linux system doesn't know the sensitive-browser command. It would therefore be good to replace sensible-browser with xdg-open, which would probably make the script work on any Linux systems.

@pas-calc
Copy link
Author

replace sensible-browser with xdg-open,

Yes thanks for your feedback, you're right. I just replaced that. Hope that script helps you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment