Thursday, November 10, 2016

takes a directory full of images, export Lat, Long data and makes a file (i.e. GeoJSON/HTML or spreadsheet or .kml) with all of the found GPS points. 2016 standard specification of the GeoJSON format: RFC 7946

directory full of images---> GeoJson or spreadsheet file (or kml)


GeoJSON is a format for encoding a variety of geographic data structures for example:
  "type": "Feature",
  "geometry": {
    "type": "Point",
    "coordinates": [125.6, 10.1]
  "properties": {
    "name": "Dinagat Islands"

GeoJSON supports the following geometry types: Point, LineString, Polygon, MultiPoint, MultiLineString, and MultiPolygon. Geometric objects with additional properties are Feature objects. Sets of features are contained by FeatureCollection objects.

In 2015, the Internet Engineering Task Force (IETF), in conjunction with the original specification authors, formed a GeoJSON WG to standardize GeoJSON. RFC 7946 was published in August 2016 and is the new standard specification of the GeoJSON format, replacing the 2008 GeoJSON specification.

Remember that GeoJSON stores coordinates in "reversed order" (longitude, latitude)

Some javascript codes:

This javascript takes a directory full of images and makes a GeoJSON file with all of the found GPS points. Put the images you want to create a corresponding GeoJSON file with in the img directory.
node exif-to-geojson.js . The output will be written to exif.geojson

After you run the script, you can see the geojson with pop-ups that link to the corresponding images in index.html.
See also:
This is a Leaflet plug-in that plays back points that have a time stamp synchronized to a clock.

2/exif-gps-to-json-example (quite complex)
Example code on how to save EXIF data from photos to a JSON file.

This is the example code for the article Showing photo GPS location on Google Maps with gulp.
In this tutorial I will go through how to read the EXIF data from a folder of photots, and show the GPS location where each photo was taken in Google Maps. This article is based on the code I wrote to make my personal World Travel Map,
(see this interesting "story map" with text!!!)
which shows where I've been based on my vacation shots.

We'll use the gulp build system to read the image files and output the data we need to a JSON file, which we can then read into Google Maps.

First we install gulp and a couple of packages, gulp-data, gulp-exif and gulp-extend:
npm install --save-dev gulp gulp-data gulp-exif gulp-extend
This will allow us to read the EXIF data from the image files, extract the part we need (GPS coordinates), and save it all into a single JSON file.

Now we create a task called "exif", which does three things:

  • Reads the EXIF data from the images in the photos folder
  • Plucks out the GPS data and puts it in a JSON format with the filename as the key
  • Joins the JSON data into a single gps.json file

Show distance between image EXIF GPS data and Location API.

  • Use client side parser
  • Store results for statistical analysis
  • Auto positioning and scaling of map
Try it out at

Some tools:
Convert GPS degrees, minutes, seconds coordinates to decimal value. Useful for parsing GPS exif tags in geotagged images, Google Maps, and Open Street Map (SOM).

Remember that GeoJSON stores coordinates in reversed order (longitude, latitude) which means you have to reverse the order of the coordinates returned from dms2dec():
var geojson = {
  type: 'Point',
  coordinates: dms2dec(lat, latRef, lon, lonRef).reverse()

4/GPSeitor (code date: 2014)
A Python application that processes a pictures directory and generates a static web page positioning the images that have GPS Exif data in a Google Map in a gallery-like fashion.

5/gps detect (firefox add-on)
Firefox addon for detecting GPS EXIF info in JPEGs automatically.
GPSDetect is a simple Firefox addon that monitors Firefox network traffic and automatically alerts the user whenever a JPEG file loads that contains embedded EXIF GPS coordinates.
When an image is detected that contains GPS data, the user is alerted, and given a link to the offending image as well as the GPS information and a link to the location on a map.

Note that most major social networking sites strip EXIF information (including GPS locations). This includes Facebook, Twitter and imgur.

GPSDetect uses the Firefox Add-on SDK, which is required to build and install it, for now. To build a copy of GPSDetect, see the Add-on SDK installation instructions to activate the SDK's virtualenv, and then simply run cfx xpi in the GPSDetect root directory. You will get an unsigned XPI that can be installed into Firefox as usual.

command line interface (cli) tool for pulling exif gps data from images

Organize your photos based on exif date and GPS coordinates.
This simple tool takes two arguments, an input directory and an output directory. The input directory should be a folder with photos that have exif data. The output directory is where you want the organized files to end up. Of course your original files are left alone.

MongoDB is a free and open-source cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with schemas. MongoDB is developed by MongoDB Inc. and is free and open-source:

-->Spreadsheet file

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 or other spreadsheet.

1/ use exifTool:

2/Once the installation is finished, open up Terminal or open up your Command Line on Windows or the stand-alone Windows executable.

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:

No comments:

Post a Comment