感谢所有回复的人。结果,我得到了以下解决方案。
Install ExifTool https://sno.phy.queensu.ca/~phil/exiftool/,
我使用Ubuntu命令:
sudo apt install libimage-exiftool-perl
然后在我的 R 代码中,将 GPS 坐标添加到图像中,我使用:
exiftool_cmd <- paste("exiftool -GPSLongitudeRef=E -GPSLongitude=",latlon_exif[i,11]," -GPSLatitudeRef=N -GPSLatitude=",latlon_exif[i,10]," ","./nodejpg/",latlon_exif[i,4],".jpg",sep='')
system(exiftool_cmd)
Where latlon_exif[i,11] and latlon_exif[i,10]- 坐标,latlon_exif[i,4]- 文件名。
为了向图像添加数据和时间,我使用:
exiftool_cmd <- paste("exiftool -alldates=",shQuote(date_exif[which(date_exif[,4]%in%latlon_exif[i,4]),8])," ","./nodejpg/",latlon_exif[i,4],".jpg",sep='')
system(exiftool_cmd)
Where shQuote(date_exif[which(date_exif[4]%in%latlon_exif[i,4]),8])数据和时间格式:'2017-11-16 22:33:17'