Can we set GeoLocation for Picture after taking it?


#1

I have a requirement to Take a picture from Ricoh camera and need to set lat/lng by accessing the picture again.
Can this be done?
I am seeing setOptions to set geoLocation, that is to set the options to camera not the pitcure.


#2

Yes Examble : Google Picasa can do this, move and correct the placemark or sett a new marker on the map and the info are written to the image file automatically.


#3

See this:

http://theta360.guide/thetamedia/#_metadata

Example:

GPS Altitude                    : 36 m Above Sea Level
GPS Date/Time                   : 2016:10:23 19:25:31Z
GPS Latitude                    : 37 deg 25' 58.58" N
GPS Longitude                   : 122 deg 10' 14.32" W
GPS Position                    : 37 deg 25' 58.58" N, 122 deg 10' 14.32" W

I’m assuming that the API adds the GPS information to a metatag. You can test it on an image and then read the exif data

https://developers.theta360.com/en/docs/v2.1/api_reference/options/gps_info.html

See the post below for working examples.


#4

Full code example:

JSON_GPS_SET_REQ=$(< <(cat <<EOF
{
  "name": "camera.setOptions",
  "parameters": {
    "sessionId": "SID_${SID}",
    "options": {
                  "gpsInfo": {
                 "lat": ${GPS_LAT},
                 "lng": ${GPS_LON},
                 "_altitude": ${GPS_ALT},
                 "_dateTimeZone":"${GPS_DATE} ${GPS_TIME}+00:00",
                  "_datum":"WGS84"
            }
        }
  }
}
EOF
))
                   # Set the gps values on the camera via wifi
                echo ${JSON_GPS_SET_REQ}
                   curl -s -X POST -d "${JSON_GPS_SET_REQ}" http://${CAMIP}:${PORT}/osc/commands/execute >> /dev/null
             else
            # Set the gps via usb
            ptpcam --set-property=0xD801 --val="${GPS_LAT},${GPS_LON},${GPS_ALT}m@${GPS_DATE}${GPS_TIME}Z,WGS84"
         fi

       else
          echo "GPS enabled but now location found."
       fi
    fi

from community member 200cm3

- (void)setGpsLocation:(double)lat lng:(double)lng alt:(double) alt
{
 [self setOptions:@{@"gpsInfo":
                           @{@"lat": [NSNumber numberWithDouble: lat],
                             @"lng": [NSNumber numberWithDouble: lng],
                             @"dateTimeZone": @"2014:05:18 01:04:29+08:00",
                             @"_altitude": [NSNumber numberWithDouble:alt],
                             @"datum": @"\"WGS84\""}}];
    
}

#5

Since you want to add geoLocation to an image that you have already taken you can easily modify the metadata of that image with ExifTool to add that data. You should be able to do groups of images at one time if you are applying the same data to all of them.

http://www.sno.phy.queensu.ca/~phil/exiftool/


#6

Here is an example of Geotagging using ExifTool