#!/bin/bash
#                       /usr/local/bin/photo2map
#  http://crystalfaeries.net/posix/bin/photo2map
# celeste:crystalfaery 2016-06-09 18:39:27+00:00
# http://www.commandlinefu.com/commands/view/17373/generate-a-google-maps-url-for-gps-location-data-from-digital-photo
# This command uses the "exiftool" command which is available here: 
# http://www.sno.phy.queensu.ca/~phil/exiftool/[1]
# Generate a Google Maps URL for GPS location data from digital photo:

while [ $# -ne 0 ]
do
	PLACE="$(exiftool -ee -p '$gpslatitude, $gpslongitude' -c "%d?%d'%.2f"\" ${1} 2> /dev/null | sed -e "s/ //g")"
	if [ "${PLACE}" == "" ]
	then
		echo "No GPS coordinates found within ${1}" 1>&2
	else
		echo -n "${1}:	" 1>&2
		echo "https://www.google.com/maps/place/${PLACE}"
	fi
	shift
done


syntax highlighted by Code2HTML, v. 0.9.1