Jan
27
2013

Exporting GPS Data from a folder of images & writing to a CSV

While at #educon @alvintrusty was talking about fusion tables which is a tool from Google that allows you to map and plot data. The conversation came up about attaching GPS data from images into the map. There are several apps for IOS, Windows, and Mac that will allow you to see this data. I wanted to share a quick tip using one of my favorite tools, EXIFTool to pull out the GPS EXIF data from a folder of images.
The goal for this post is to extract Longitude and Latitude data from a folder of images and export the data in a CSV so it can be easily imported into a Fusion Table.

To get started navigate to http://www.sno.phy.queensu.ca/~phil/exiftool/ and download exiftool.

Install the software on your computer.

Once the installation is finished, open up Terminal or open up your Command Line on Windows.

Screen Shot 2013 01 27 at 3 31 34 PM

Here is the line that you need to enter:

“exiftool -csv -filename -imagesize -gps:GPSLatitude -gps:GPSLongitude ./ > long.csv”

 

This command will go to the folder that you input and read through all of the images and pull out the filename, the image size, the GPS Latitude and the GPS Longitude and export everything to a CSV.

Here is the finished CSV that is opened in Excel:

Screen Shot 2013 01 27 at 3 36 17 PM

 

If you have any issues feel free to comment or email me at tj@tjhouston.com

 

Thanks

About the Author: TJ Houston

TJ Houston is the Director of Technology at Shelby City Schools and New London Local Schools for Epiphany Management. TJ leads professional development in all areas of technology and loves developing ways to make teachers, students, and staff's lives easier with the use of technology. TJ also loves photography and his portfolio can be found at http://www.tjshots.com. All of the views on this site are his own.

  • aec

    Thanks, this is precisely what I needed! Only minor edit — you want to run this command after you have navigated to the directory with the photos whose GPS data you want to export.

  • Erik

    As aec said, this should be copied or dragged to the command prompt, or Terminal on my Mac, like so: exiftool -csv -filename -imagesize -gps:GPSLatitude -gps:GPSLongitude ./ > filenameIchose.csv /Users/firley/Desktop/bearjollyhike

    Then I searched for filenameIchose.csv. It was saved by ExifTool to the User “firley” on my Mac (reading the info from the bearjollyhike folder).

    btw not sure the”.” should be before />, as TJs example shows

    Anyway, my hope was to use this csv to merge GPS data with photo link data to show up on a Google maps, probably using

    One problem is that the output is in degrees, minutes and seconds, not decimal degrees making the process cumbersome without a modification.

    The modification to get decimal degrees (required by Google and GPS Visualizer etc.) is to add “-n” and the csv will output to decimal degrees (not d,m,s), like so: exiftool -csv -filename -imagesize -gps:GPSLatitude -n -gps:GPSLongitude -n/> filenameIchose.csv /Users/firley/Desktop/bearjollyhike

    Other problem I had was that the above took away the negative from the longitude. I had to correct the csv in Excel.

    Google maps could not do what I wanted with photos, so I used GPS Visualizer, pasting iframe in post, linking to html of map (created with GPS Visualizer) in another folder.

    Many Thanks to TJ as the ExifTool FAQ and forum did not have his simple how to. To see the map in action: http://www.trailove.com/cuyamaca-to-indian-creek-loop/

    • http://www.tjhouston.com/ TJ Houston

      Thanks for the response. In unix the ./ is the current directory.

      Also great example! Pretty neat.

      Thanks
      TJ

  • Atif

    hi, this works perfect with the photographs but i was wondering if there is a way to use it for quick time videos shot with the iPhone. quick time’s video inspector let’s you view the gps data but exiftool does not recognise the gps data in the same way that it can for the photographs. the file name and size is recorded on the cdv foe but not the gps data.

Find Me Online:

About Me:

My name is TJ Houston.
I am the Director of Technology at Huron City Schools. I love integrating technology into the classroom and helping teachers find the way on the information super highway. Things I love: My family, My awesome Girlfriend, Technology, Education, and Photography.

I run PD sessions twice a week and run community training the first Saturday of the month. I love teaching people new things.

Best School Admin Blog

Nominated for Best School Admin Blog

Facebook Friends

Sponsors

Classroom 2.0

Presentations

Presenter Badge
diigo education pioneer

Friends