stevefaeembra
Animated Heatmap using QGIS Time Manager
Using the QGIS Time Manager Plugin to visualise a couple of hours of Edinburgh's Bus Movements during weekday rush hour (1630-1830h). Time scale - 12 minutes per second of video.
Inspired by this Plugin tutorial
Used QGIS heatmap rendering.
I confess, I had to cheat a bit - I used ffmpeg to generate the final video, rather than exporting directly from the plugin.
Couple of reasons for this...
- the web endpoint I used sometimes returns incomplete data
- sometimes, it doesn't return any data at all, so the frame is black
A video with blank or nearly-empty frames can be difficult to watch. This meant I had to manually replace empty frames to avoid distracting "flashes".
ffmpeg doesn't like gaps in the file numbering sequence, so I copied neighbouring frames over the 'bad' frames.
This is the ffmpeg command I used.
~/path/to/ffmpeg -r 24 -i /path/to/animation/frame%03d.png -c:v libx264 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -r 30 -q 1 -pix_fmt yuv420p ~/Videos/myvideo.mp4
I had to move the png world files (*.pngw) to a backup directory first, otherwise ffmpeg tries to include them. The codec also requires the dimensions to be even, so a scale filter is used to make sure this is the case.
Animated Heatmap using QGIS Time Manager
Using the QGIS Time Manager Plugin to visualise a couple of hours of Edinburgh's Bus Movements during weekday rush hour (1630-1830h). Time scale - 12 minutes per second of video.
Inspired by this Plugin tutorial
Used QGIS heatmap rendering.
I confess, I had to cheat a bit - I used ffmpeg to generate the final video, rather than exporting directly from the plugin.
Couple of reasons for this...
- the web endpoint I used sometimes returns incomplete data
- sometimes, it doesn't return any data at all, so the frame is black
A video with blank or nearly-empty frames can be difficult to watch. This meant I had to manually replace empty frames to avoid distracting "flashes".
ffmpeg doesn't like gaps in the file numbering sequence, so I copied neighbouring frames over the 'bad' frames.
This is the ffmpeg command I used.
~/path/to/ffmpeg -r 24 -i /path/to/animation/frame%03d.png -c:v libx264 -vf "scale=trunc(iw/2)*2:trunc(ih/2)*2" -r 30 -q 1 -pix_fmt yuv420p ~/Videos/myvideo.mp4
I had to move the png world files (*.pngw) to a backup directory first, otherwise ffmpeg tries to include them. The codec also requires the dimensions to be even, so a scale filter is used to make sure this is the case.