Lightroom Geotag Timelapser
I wrote this tool to create timelapse frames from the geotags in my Lightroom library. It's nice to reminisce and see an overview of the places I've been to. The script automatically loads geotags from a Lightroom library and then shows a heatmap-style animation of the places popping up on a map. You can save the frames to assemble into a GIF in e.g. Photoshop, or you can just watch the animation loop.
This script was tested on Processing 3 on Windows only, though Mac ought to work. Technically it's possible to use this script with tags from a non-Lightroom program, you'd need a CSV with each geotag in the format
latitude,longitude,year,month,day. The data needs to be sorted by date, ascending.
At the top of the file, set
lightroomDb with the location of your Lightroom database. The script only reads and does not write to the database, but nevertheless you should back it up.
zoomLevel can be increased for higher resolution output. This is the OpenStreetMap zoom level. If your geotags are entirely within, say, the United States, a level of 4 or 5 would be good. If you're a world traveler, you'd want 1-3. If you set this too high, the output will probably be stupidly large and take a long time to download the tiles. The tiles are downloaded from Stamen's OSM tile servers, with a 500ms delay after each download.
margin adjusts the map margin for the outermost points. The script downloads the tiles the geotags are contained within, and the immediate ring of tiles outside of that. So unless your tags are on the edge of the world map, you have a 256px (OSM tiles are this large) maximum margin.
If you want the amount of time each frame covers to be smaller, you can set
Calendar.DATE (which is one day) and
intervalLength accordingly, like 15.
Finally, if you want to change the location where the tiles get cached, the output frames get generated, or the CSV points file that gets loaded or used as a cache for what's read from Lightroom, you can change
When you run the script, if the input points file is missing, the script will read your Lightroom geotags and cache to the points file. Then it will retrieve any tiles necessary and run the animation. You can press
R to reload tags from Lightroom.
S saves all the animation frames to the output folder, while pressing
L only saves the final frame.
M enters mouse mode, where the date follows the left/right movement of the mouse across the map.
- added mouse mode
- added ability to export last frame only
- restructured the program so that date/point sets aren't regenerated
- adjusted the point glow blending so that points over water don't look excessively bright
- fixed crash when cache folder didn't exist
- cleaned up the code some, first public version
- initial version
- Lato font by Łukasz Dziedzic and Adam Twardoch - SIL Open Font License 1.1
- SQLite JDBC Driver by Taro L. Saito - Apache License 2.0
- OSM Toner tiles by Stamen Design - CC BY 3.0; Data by OpenStreetMap - ODbL
- Seth Golub's heatmap.py - More general-purpose and has a lot more features. Creates proper heatmaps, but inputs with thousands of tags take longer to process.