getWikiMedia.ImageInfo
function fetches the EXIF (Exchangeable image file format) data via the "SpatialPhotoOverlay"
, which can be parsed to KML.getWikiMedia.ImageInfo(imagename,
APIsource = "https://commons.wikimedia.org/w/api.php",
module = "imageinfo",
details = c("url", "metadata", "size", "extlinks"), testURL = TRUE)
getWikiMedia.ImageInfo
function assumes that all required metadata has already been entered by the user before the upload, hence no further changes in the metadata will be possible. Examples of how to embed EXIF tags into an image file are available {{location|lat deg|lat min|lat sec|NS|long deg|long min|long sec|EW}}
tag to the file description, in which case getWikiMedia.ImageInfo
will automatically look for the attached coordinates via the external links. For practical purposes and because the image properties information determined by the Wikimedia system can are more reliable, the function will rewrite some important EXIF metadata (image width and height) using the actual values determined by Wikimedia server.
For a list of modules and parameters that can be used via getWikiMedia.ImageInfo
, please refer to spPhoto
, Rexif::getExifPy
# Photo taken using a GPS-enabled camera:
imagename = "Africa_Museum_Nijmegen.jpg"
x <- getWikiMedia.ImageInfo(imagename)
# Get the GPS info:
x$metadata[grep(names(x$metadata), pattern="GPS")]
# prints the complete list of metadata tags;
Run the code above in your browser using DataLab