Last active
April 16, 2020 20:19
-
-
Save flyinva/874186fe615c1abdb440 to your computer and use it in GitHub Desktop.
Create a GeoJSON file from EXIF data
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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