Skip to content

Instantly share code, notes, and snippets.

@flyinva
Last active April 16, 2020 20:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save flyinva/874186fe615c1abdb440 to your computer and use it in GitHub Desktop.
Save flyinva/874186fe615c1abdb440 to your computer and use it in GitHub Desktop.
Create a GeoJSON file from EXIF data
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