[Digikam-devel] [Bug 133359] WISH: Google maps support to show satellite images of the photos

Antonio E. aironmail at gmail.com
Thu Sep 14 22:29:18 BST 2006


------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
         
http://bugs.kde.org/show_bug.cgi?id=133359         




------- Additional Comments From aironmail gmail com  2006-09-14 23:29 -------
I've made a little fix in the script described in the svn documentation that uses exiftools to set the gps data using the google maps coordenates. The original script only works with folders; it fails with single files. And it doesn't check if the file exists. The new script is:

#!/bin/sh
# exiftool wrapper script for easy commandline use. It treats regex files or whole directories.
#
#                        FMT                  Output
#                "%d deg %d' %.2f"\"    54 deg 59' 22.80"
#                "%d deg %.4f min"      54 deg 59.3800 min
#                "%.6f degrees"         54.989667 degrees

if [ -z $1 ]; then
   echo "Usage: exiftool-gps lat long [alt] file || dir (use signed floating coordinates)"
else

   if  [ -z "$4" ]; then  foo="$3"; alt=0
   else                   foo="$4"; alt=$3
   fi

   echo $foo
   if [ -e "$foo" ] ; then
        lat=$(echo "$1" | awk '{if ($1 < 0) print "S"; else print "N"}')
        lon=$(echo "$2" | awk '{if ($1 < 0) print "W"; else print "E"}')
        # use the following syntax for easy googlian paste of ll=-1.23456,53.345345
        #lon=$(echo "$2" | awk '{if ($2 < 0) print "W"; else print "E"}')
        echo $1, $lat, $2, $lon, $3, $4, $foo

        if [ -d "$foo" ] ; then

            for i in "$foo" ; do    # the selection of files treated depend on the passed regex
                echo "i= "$i
                exiftool -c "%.6f" -GPSMapDatum="WGS-84" -GPSAltitude=$alt \
                -GPSLongitudeRef=$lon -GPSLongitude=$2 -GPSLatitudeRef=$lat -GPSLatitude=$1 "$i"
                exiftool -GPS:ALL "$i"  # read back
            done
        else

            exiftool -c "%.6f" -GPSMapDatum="WGS-84" -GPSAltitude=$alt \
            -GPSLongitudeRef=$lon -GPSLongitude=$2 -GPSLatitudeRef=$lat -GPSLatitude=$1 "$foo"
            exiftool -GPS:ALL "$foo"  # read back
        fi
   else echo "file or folder is wrong"
   fi
fi



More information about the Digikam-devel mailing list