Skip to content

Instantly share code, notes, and snippets.

@cquest
Forked from flyinva/GeoJSON from EXIF
Created July 31, 2014 21:41
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cquest/777faa6268d848f0a6e2 to your computer and use it in GitHub Desktop.
Save cquest/777faa6268d848f0a6e2 to your computer and use it in GitHub Desktop.
exiftool -n -g -json \
-imagewidth \
-imageheight \
-composite:gpslatitude \
-composite:gpslongitude \
*jpg \
| jq --compact-output --arg urlBase http://mysite.net/myphotos/ \
'{
"type": "FeatureCollection",
"features":
map( {
"type": "Feature",
"properties": {"url": [$urlBase,.SourceFile] | add,
"width": .File.ImageWidth,
"height": .File.ImageHeight,},
"geometry": {
"type": "Point",
"coordinates": [ .Composite.GPSLongitude, .Composite.GPSLatitude]}
} )
}' \
> data.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment