![]() Prior to QGIS 3.4, importing geotagged photos in QGIS was done via a plugin. Geotagged photographs are geospatial data that you can play around with in something like QGIS. Most modern smartphones have the option of geotagging the photos they take. The geographic information (latitude, longitude, and optionally altitude, bearing, and others) are stored in the image’s EXIF header. Thankfully, you had your phone’s geolocation on while taking the photographs so you don’t just have photographs but geotagged photographs.Ī geotagged photograph is a photograph with an associated geographic location added to it by a process called geotagging. You then choose the best photographs and think of what to do with them – you can upload them on social media, you can send them to friends, or you can make a map. You return from your trip with a bunch of fond memories, a bucket of experiences, and a phone full of photographs. So like most people, you pull out your phone and start taking photos of all the stuff that interest you (e.g. With two lines of code, we can get a ame out of our EXIF data.Imagine going on a trip somewhere for the first time and, while on this trip, you encounter some fascinating and interesting things. Since our output is not a file, we'll have wrap our string with textConnection() to make it accessible to read.csv(). With that, we can use read.csv() to process the output. SourceFile,APP14Flags0,APP14Flags1,BitsPerSample,ColorComponents,ColorTransform,Compression,DCTEncodeVersion,Directory,EncodingProcess,ExifByteOrder,ExifToolVersion,FileAccessDate,FileInodeChangeDate,FileModifyDate,FileName,FilePermissions,FileSize,FileType,FileTypeExtension,GPSAltitude,GPSAltitudeRef,GPSLatitude,GPSLatitudeRef,GPSLongitude,GPSLongitudeRef,GPSMapDatum,GPSPosition,GPSVersionID,ImageHeight,ImageSize,ImageWidth,JFIFVersion,Megapixels,MIMEType,ModifyDate,PhotometricInterpretation,Quality,ResolutionUnit,RowsPerStrip,SamplesPerPixel,StripByteCounts,StripOffsets,XResolution,YCbCrSubSampling,YResolution Pass the -csv parameter and you've got the output in nice parsing form, ready for R to convert to a ame. Luckily, the genious behind exiftool figured this out already.all you have to do is pass the -n parameter. Also, things like "GPS Latitude" are in a pretty unitelligible format (we'll probably want something like -94.526 instead of 94 deg 47' 56.41" W if we're going to do any processing in R). ![]() GPS Position : 38 deg 51' 20.15" N, 94 deg 47' 56.41" WĪs you can see, all the information we need is here, but it's not in a format that is particularly conducive to parsing in R. Once you have one in your RStudio project (or working directory), try the following:įile Modification Date/Time : 2015:11:21 14:16:21-04:00įile Access Date/Time : 2015:12:13 14:02:36-04:00įile Inode Change Date/Time : 2015:11:21 14:16:21-04:00Įxif Byte Order : Little-endian (Intel, II)Įncoding Process : Baseline DCT, Huffman coding ![]() Any photo taken by a digital camera has at least some kind of EXIF data, so this shouldn't be hard to find. The next thing you'll need is a photo with some EXIF data. If you can type system("exiftool") into your R console and not get any text saying "command not found", you're good to go. In Windows you'll end up with an exiftool.exe file that you should put in your RStudio Project directory (or working directory, if you don't use RStudio). It's available for Windows, Mac, and Unix-oid systems (although it's a little more complicated to install on the unix-oid ones). Using the system() command in R, we can write a simple wrapper around the exiftool command that produces a nice ame with all the information about our image files.įirst thing is first, you're going to need to install exiftool. There is no package available for this, however exiftool, written by Phil Harvey, is a multi-platform command-line interface that extracts this data and outputs in a number of formats. Enter EXIF data, the format in which date/time, GPS, resolution, camera make/model, and a number of other fields are stored within image files. The photos came from a GPS with a camera, but because there were tons of duplicate files, any GPS waypoints they were associated with were lost. Recently I was tasked with organizing a large number of geotagged images extracted from several years of field data. ![]()
0 Comments
Leave a Reply. |