Time is an important component of many spatial datasets. Along with location information, time providers another dimension for analysis and visualization of data. If you are working with dataset that contains timestamps or have observations recorded at multiple time-steps, you can easily visualize it using the TimeManager plugin in QGIS. TimeManager allows you to view and export ‘slices’ of data between certain time intervals that can be combined into animations.
We will take a point layer of maritime piracy incidents, create a heatmap visualization and create an animation of how the piracy hot-spots have changed over past 2 decades.
National Geospatial-Intelligence Agency’s Maritime Safety Information portal provides a shapefile of all incidencts of maritine piracy in the form on Anti-shipping Activity Messages. Download the Arc Shape file version of the database.
Natural Earth has several global vector layers. Download the 10m Physical Vectors - Land containing Land polygons.
For convenience, you may directly download a copy of the above layers from below:
Data Source: [NGA_MSI] [NATURALEARTH]
Go to
. Search for and install the TimeManager plugin.ne_10m_land.zip
and select the ne_10m_land.shp
layer. Drag the layer to the canvas. Next, locate the ASAM_shp.zip
file. Expand it and select the asam_data_download/ASAM_events.shp
layer and drag it on to the canvas.ASAM_events
layers and click the Open the layer Styling Panel button in the Layers panel. Click the Single symbol
drop-down.Heatmap
renderer. Next, select the Viridis
color ramp from the Color ramp selector.5.0
. At the bottom, expand the Layer Rendering section and adjust the Opacity to 75.0%
. This gives a nice visual effect of the hotspots with the land layer below.dateofocc
- representing the date on which the incident took place. This is the field that will be used by the plugin to determine the points that are rendered for each time period. Select ASAM_events
as the Layer and dateofocc
as the Start time. The End time should be set to Same as start
. Click OK.1 years
. Once enabled, you will see a filter icon next to the ASAM_events
layer. TimeManager works by applying a filter to the layer based on the selected field and specified time period.Note
As TimeManager works by applying a filter on the layer, it only works with layer types that support this feature. Most data source types do support it - with a notable exception being temporary memory layers. If you had done some processing earlier and have a temporary layer, right-click and select Make Permanent before using TimeManager on that layer.
25
. Change the DateTime format to %Y
. The time format should be specified in the Python strftime format. %Y
is the short-code for a 4 digit year. Also you can change the Placement direction to NW
. Click OK.EPSG:4326
which is ok for storing the source data, but not ideal for global visualization like this. I really like the Equal Earth Projection for a visually pleasing and more accurate representation of the world. It is a fairly new projection and not yet available as a predefined option in QGIS. But there is an easy way to use it in QGIS by defining a custom projection. Go to .Equal Earth
as the name. Enter the following definition in the Parameters box. The parameters need to be specified in the PROJ format. After entering the parameters, click OK.+proj=eqearth +datum=WGS84 +wktext
Equal Earth
to find and select the newly defined projection. Click OK..png
files. Note that the export folder will also have a .pgw
file for each frame which contains the georeference information. You may want to sort the images by Type
to allow easy bulk selection of only .png
files. Once selected, click the Upload and make a GIF! button.This work is licensed under a Creative Commons Attribution 4.0 International License