diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/404.html b/404.html new file mode 100644 index 0000000..92974a5 --- /dev/null +++ b/404.html @@ -0,0 +1,972 @@ + + + +
+ + + + + + + + + + + + + + + + + +This project is open source, so you can create a pull request(PR) after you fix issues. Get a local copy of the plugins checked out for development using the following process.
+Before uploading your PR, run test one last time to check if there are any errors. If it has no errors, commit and then push it!
+For more information on PR's steps, please see links in the Contributing section.
+Please make this project more fun and easy to scan by using emoji prefixes for your +commit messages (see GitMoji).
+Commit type | +Emoji | +
---|---|
Initial commit | +🎉 :tada: |
+
Version tag | +🔖 :bookmark: |
+
New feature | +✨ :sparkles: |
+
Bugfix | +🐛 :bug: |
+
Metadata | +📇 :card_index: |
+
Documentation | +📚 :books: |
+
Documenting source code | +💡 :bulb: |
+
Performance | +🐎 :racehorse: |
+
Cosmetic | +💄 :lipstick: |
+
Tests | +🚨 :rotating_light: |
+
Adding a test | +✅ :white_check_mark: |
+
Make a test pass | +✔️ :heavy_check_mark: |
+
General update | +⚡️ :zap: |
+
Improve format/structure | +🎨 :art: |
+
Refactor code | +🔨 :hammer: |
+
Removing code/files | +🔥 :fire: |
+
Continuous Integration | +💚 :green_heart: |
+
Security | +🔒 :lock: |
+
Upgrading dependencies | +⬆️ :arrow_up: |
+
Downgrading dependencies | +⬇️ :arrow_down: |
+
Lint | +👕 :shirt: |
+
Translation | +👽 :alien: |
+
Text | +📝 :pencil: |
+
Critical hotfix | +🚑 :ambulance: |
+
Deploying stuff | +🚀 :rocket: |
+
Fixing on MacOS | +🍎 :apple: |
+
Fixing on Linux | +🐧 :penguin: |
+
Fixing on Windows | +🏁 :checkered_flag: |
+
Work in progress | +🚧 :construction: |
+
Adding CI build system | +👷 :construction_worker: |
+
Analytics or tracking code | +📈 :chart_with_upwards_trend: |
+
Removing a dependency | +➖ :heavy_minus_sign: |
+
Adding a dependency | +➕ :heavy_plus_sign: |
+
Docker | +🐳 :whale: |
+
Configuration files | +🔧 :wrench: |
+
Package.json in JS | +📦 :package: |
+
Merging branches | +🔀 :twisted_rightwards_arrows: |
+
Bad code / need improv. | +💩 :hankey: |
+
Reverting changes | +⏪ :rewind: |
+
Breaking changes | +💥 :boom: |
+
Code review changes | +👌 :ok_hand: |
+
Accessibility | +♿️ :wheelchair: |
+
Move/rename repository | +🚚 :truck: |
+
Other | +Be creative | +
This plugin was developed by:
+Tim Sutton | +Nyall Dawson | +Jeremy Prior | +
---|---|---|
+ | + | + |
Coder and Ideas Guy | +Genius Guru of Awesomeness | +Document and Logo Guy | +
timlinux @ github | +nyalldawson @ github | +Jeremy-Prior @ github | +
Thanks to:
+We are looking for contributors, add yourself here!
+Also:
+Documentation is written using mkdocs.
+You can build a copy of the documentation as a PDF file using the following steps:
+pip install mkdocs-with-pdf
+pip install mkdocs-material
+pip install qrcode
+mkdocs build --config-file mkdocs-pdf.yml
+xdg-open pdfs/QGISAnimationWorkbench.pdf
+
+
+
+
+
+
+
+ Fork main
branch into your personal repository. Clone it to local computer. Install QGIS and the following dependencies.
Before starting development, you should check if there are any errors.
+git clone https://github.com/{your-personal-repo}/QGISAnimationWorkbench.git
+ln -s QGISAnimationWorkbench ~.local/share/QGIS/QGIS3/profiles/<profile>/python/plugins
+
+Enable the python in the QGIS plugin manager. You should also install the Plugin Reloader plugin so you can quickly deploy changes to your local session in QGIS as you are working.
+TODO
+
+TODO
+
+TODO
+
+
+
+
+
+
+
+ And the subsequent CPU load during processing:
+ +After processing:
+ +And here is the resulting video:
+ +Currently your filenames should not contain spaces or special characters (e.g.(, ), [, ], {, }, <, >, /, \, :, *, ?, |, ", &, etc.).
+This is planned but not yet implemented. Tim - check.
+This is a fun / hobby project, currently we want other contributors who also want to +have a fun experience with building this plugin and contribute in-kind efforts to the +project. Both Kartoza and North-Road +offer commercial development services but not for this plugin which is a intended to +provide an experimental, no-pressire space for us to work on something fun for QGIS.
+ + + + + + +Welcome to the QGIS Animation Workbench (QAW). QAW is a QGIS Plugins that will help you bring your maps to life! Let's start with a quick overview. Click on the image below to view a 14 minute walkthrough on YouTube.
+ +QGIS Animation Bench exists because we wanted to use all the awesome cartography features in QGIS and make cool, animated maps! +QGIS already includes the Temporal Manager which allows you to produce animations for time-based data. But what if you want to +make animations where you travel around the map, zooming in and out, and perhaps making features on the map wiggle and jiggle as the +animation progresses? That is what the animation workbench tries to solve...
+++ + + + + + +Supports only English currently - we may add other languages in the future if there is demand.
+
Should work with and version of QGIS 3.x. If you have QGIS 3.26 or better you can benefit from the animated icon support (see @nyalldawson's most excellent patch #48060).
+For QGIS versions below 3.26, you can animate markers by unpacking a GIF image into its constituent frames and then referencing a specific frame from the symbol data defined property for the image file. Note that to do this extraction below you need to have the Open Source ImageMagick application installed:
+First extract a gif to a sequence of images:
+convert cat.gif -coalesce cat_%05d.png
+
+Example of how to create a dynamically changing image marker based on the current frame count:
+@project_home
+||
+'/gifs/cat_000'
+||
+lpad(to_string( @frame_number % 48 ), 2, '0')
+||
+'.png'
+
+Note that for the above, 48 is the number of frames that the GIF was composed of, and it assumes the frames are in the project directory in a subfolder called gifs
.
In this example we use a geometry generator to create a line between the origin point and the destination point:
+if (@from_feature_id = $id OR @to_feature_id = $id,
+ -- read this from inside to out so
+ -- last tranform the geometry back to the map crs
+ transform(
+ -- densify the geometry so that when we transform
+ -- back it makes a great circle
+ densify_by_count(
+ -- move the geometry into a crs that
+ -- shows a great circle as a straight line
+ transform(
+ -- make a line from the previous pont to the next point
+ make_line(
+ geometry(@from_feature),
+ geometry(@to_feature)
+ ),
+ @map_crs, 'EPSG:4326'),
+ 99),
+ 'EPSG:4326', @map_crs),
+ None)
+
+
+Showing diagnostic information in the QGIS copyright label:
+[%
+'Feature Variables:' ||
+' \n------------------------' ||
+' \nPrevious Feature ' || to_string(coalesce(attribute(@previous_feature, 'name'), '-')) ||
+' \nPrevious Feature ID ' || to_string(coalesce(@previous_feature_id, '-')) ||
+' \n' ||
+' \nNext Feature ' || to_string(coalesce(attribute(@next_feature, 'name'), '-')) ||
+' \nNext Feature ID ' || to_string(coalesce(@next_feature_id, '-')) ||
+' \n' ||
+' \nHover Feature ' || to_string(coalesce(attribute(@hover_feature, 'name'), '-')) ||
+' \nHover Feature ID ' || to_string(coalesce(@hover_feature_id, '-')) ||
+' \n' ||
+' \nFrom Feature ' || to_string(coalesce(attribute(@from_feature, 'name'), '-')) ||
+' \nFrom Feature ID ' || to_string(coalesce(@from_feature_id, '-')) ||
+' \n' ||
+' \nTo Feature ' || to_string(coalesce(attribute(@to_feature, 'name'), '-')) ||
+' \nTo Feature ID ' || to_string(coalesce(@to_feature_id, '-')) ||
+' \n' ||
+' \nTotal Hover Frames ' || to_string(coalesce(@hover_frames, 0)) ||
+' \nCurrent Hover Frame ' || to_string(coalesce(@current_hover_frame, 0)) ||
+' \nTotal Travel Frames ' || to_string(coalesce(@travel_frames, 0)) ||
+' \nCurrent Travel Frame ' || to_string(coalesce(@current_travel_frame, 0)) ||
+' \nTotal Frame Count ' || to_string(coalesce(@total_frame_count, 0)) ||
+' \nFrame Number ' || to_string(coalesce(@frame_number, 0)) ||
+' \nFrame Rate ' || to_string(coalesce(@frame_rate, 0)) ||
+' \nwith Current Animation Action: ' || @current_animation_action ||
+' \nTo Direction ' || coalesce(format_number(degrees(azimuth( geometry(@hover_feature), geometry(@previous_feature) ) ) ), 0) ||
+' \nFrom Direction ' || coalesce(format_number(degrees( azimuth( geometry(@hover_feature), geometry(@next_feature) ) ) ), 0)
+%]
+
+
+
+Example output:
+ +Variably changing the size on a label as we approach it in the animation:
+```40 * ((@frame_number % @hover_frames) / @hover_frames)
+
+## Calculating the angle between points
+
+You can calculate the angle between the hover point and the previous point like this:
+
+```python
+coalesce(
+ format_number(
+ degrees(
+ azimuth(
+ geometry(@hover_feature),
+ geometry(@previous_feature)
+ )
+ )
+ ), 0)
+
+You can set the angle of rotation for a symbol using this expression:
+ + +Using this technique you can also create an animation effect showing the source +direction of travel and the new destination.
+scale_linear (
+ @current_hover_frame,
+ 0,
+ @hover_frames,
+ degrees(
+ azimuth(
+ geometry(@hover_feature),
+ geometry(@previous_feature)
+ )
+ ),
+ degrees(
+ azimuth(
+ geometry(@hover_feature),
+ geometry(@next_feature)
+ )
+ )
+)
+
+Will produce something like this:
+ +Here is an example where we animate all the points in a cluster that are not the hover point. We use an easing function to make the animation have an interesting circular motion.
+ +-- Taken from https://spicyyoghurt.com/tools/easing-functions
+-- t = Time - Amount of time that has passed since the beginning of the animation. Usually starts at 0 and is slowly increased using a game loop or other update function.
+-- b = Beginning value - The starting point of the animation. Usually it's a static value, you can start at 0 for example.
+-- c = Change in value - The amount of change needed to go from starting point to end point. It's also usually a static value.
+-- d = Duration - Amount of time the animation will take. Usually a static value aswell.
+-- Sinusoidal
+-- -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
+
+-- Use with the animation in static mode
+if(@hover_feature_id != $id,
+array(
+ (-@hover_frames / 2) * (cos( (pi() * @frame_number / @hover_frames ) - 1)) ,
+ (-@hover_frames / 2) * (sin( (pi() * @frame_number / @hover_frames ) - 1))
+),
+array (0,0))
+
+
+This function should be applied to the offset X,Y property of the symbol.
+ + + + + + + +The animation workbench exposes or modifies a number of different QGIS Expression variables that you can use to achieve different dynamic rendering effects.
+These variables will always be available, regardless of the animation mode
+Variable | +Notes | +
---|---|
frame_number | +Frame number within the current dwell or pan range. | +
frame_rate | +Number of frames per second that the video will be rendered at. | +
total_frame_count | +Total number of frames for the whole animation across all features. | +
These variables are available when in the fixed extent animation mode when a vector layer has been set
+Variable | +Notes | +
---|---|
hover_feature | +The feature we are currently hovering over | +
hover_feature_id | +Feature ID for the feature we a current hovering over | +
previous_feature | +The previously visited feature (or NULL if there isn't one) | +
previous_feature_id | +Feature ID for the previously visited feature (or NULL if there isn't one) | +
next_feature | +The next feature to visit after the current one (or NULL if there isn't one) | +
next_feature_id | +Feature ID for the next feature to visit after the current one (or NULL if there isn't one) | +
current_hover_frame | +The frame number for the current feature (i.e. how many frames we have hovered at the current feature) | +
hover_frames | +Number of frames we will hover at the current feature for | +
current_animation_action | +Always "Hovering" | +
These variables are available in the Planar or Sphere mode.
+Variable | +Notes | +
---|---|
current_animation_action | +Either "Hovering" or "Travelling" | +
These variables are available in planar or sphere mode, when the animation is currently hovering over a feature
+Variable | +Notes | +
---|---|
hover_feature | +The feature we are currently hovering over | +
hover_feature_id | +The feature ID for the feature we are currently hovering over | +
previous_feature | +The previously visited feature (or NULL if there isn't one) | +
previous_feature_id | +Feature ID for the previously visited feature (or NULL if there isn't one) | +
next_feature | +The next feature to visit after the current one (or NULL if there isn't one) | +
next_feature_id | +Feature ID for the next feature to visit after the current one (or NULL if there isn't one) | +
current_hover_frame | +The frame number for the current feature (i.e. how many frames we have hovered at the current feature) | +
hover_frames | +Number of frames we will hover at the current feature for | +
These variables are available in planar or sphere mode, when the animation is currently travelling between two features
+Variable | +Notes | +
---|---|
from_feature | +The feature we are travelling away from | +
from_feature_id | +The feature ID for the feature we are travelling away from | +
to_feature | +The feature we are heading toward | +
to_feature_id | +The feature ID for the feature we are heading toward | +
current_travel_frame | +The frame number for the current travel operation | +
travel_frames | +Number of frames we will travel between the current features | +
Visit the snippets section of our documentation for example expressions.
+ + + + + + +1. The first step for getting an output using the Workbench is to create a QGIS Project
+
+Open QGIS and click on Project
➔ New
+
Next, add new layers to your project. You will want a few layers; one, or more, backing +layer(s) (vector layers or XYZ Tiles), a layer for the workbench to follow, and one, +or more, layer(s) of animated points. The example in this section only has one animated +layer. +
+To add a layer, go to Layer
➔ Create Layer
and then select the type of layer you
+want to add. The example adds a point layer to a GeoPackage to make the project more
+portable.
Once you have added your layers you need to add features to the layers. This is done
+by selecting a layer and then clicking Toggle Editing
(1
) ➔ Add PointFeature
(2
).
+Then click around on your map to add as few, or as many, features as you need.
The example project has four layers: two point layers (3
) and two backing layers (4
).
++A simple way to add a vector base layer is to type "world" into the coordinate +textbox
+
Finally, style your layers to make your project look aesthetically pleasing. To +style your layers you must select the layer you want to style and then using the +Layer Styling toolbar, play around with the style of the layer until it suits you. A +good practice is to have your backing layers as more muted colours and your desired +features as more eye-catching colours.
+ ++You now have a QGIS Project. +
+2. The next step is to choose which features you want to be animated. +
+Pick the layer (or layers) that you want to have animations. Then either find, or create, +the animation for the layer. Make sure you have all the correct attribution for any +animations you use. Below is an example of a simple fish animation split into its frames. +The frames are repeated to slow down the animation's playback speed.
++
+++If you are using
+QGIS 3.26
you can simply use the new animated point symbol, +or if you're using an older version ofQGIS 3.x
follow the instructions below.
The layer should contain a Raster Image Marker
. Once you have selected the marker you
+want to use click on the QGIS Expressions dropdown menu (5
) and click on Edit
(6
).
+
++You can also make a marker move along a line relative to the frame of the animation. +Use the Code Snippets Section for more in-depth help.
+
The example below works with the animation from earlier.
+ +@project_home
+||
+'/fish/fish_00'
+||
+lpad(to_string( @frame_number % 32), 2, '0')
+||
+'.png'
+
+3. Configure your animation
+After animating your markers it's time to configure your animation. Open the Animated +Workbench and begin choosing between the different modes and options. +
+Open the Workbench by clicking the Animation Workbench
(7
) icon in the Plugin Toolbar.
+
+Configure the settings for your animation. The screenshot below is configured for
+the example presented in this section. The Animation Layer is selected as route
(8
)
+because that is the path that the output animation will fly along. The Zoom Range (9
) was
+selected from the Map Canvas Extent, and the Frame rate per second (fps) (10
) was set to
+match the number of frames of the animated markers so that they will play nicely in
+the output. The other settings were selected as a personal choice.
+
+Select the Output Resolution (11
) and a location for your output by clicking on the
+ellipsis (three dots) or by typing in the desired file path (12
).
+
+++Refer to the Workbench User Interface section for more information about +what various settings and buttons accomplish.
+
4. Render your animation!
+
+Click Run
and render your output. The output below is the output from the example.
What does the workbench do?
+The workbench creates animations from QGIS by generating multiple static frames (images)
+and then combining those frames into an animation. The user tells QGIS how the frames
+should change from one to the other. In QGIS 3.26
and later the animated markers
+allow markers to be animated without the use of the expressions system.
+
How do the animated markers work?
+In the code snippet below, the user tells QGIS that as the frame count increments by
+one the Raster Image Marker
should change to the next image in the sequence.
py
+ @project_home
+ ||
+ '/fish/fish_00'
+ ||
+ lpad(to_string( @frame_number % 32), 2, '0')
+ ||
+ '.png'
The user specifies the path of the image (@project_home/fish/fish_00
). Then the
+lpad(to_string( @frame_number % 32), 2, '0')
tells QGIS to convert the frame
+number to a string and then modulus the number of frames by the number of animation
+frames (32
) (i.e. QGIS divides the number of frames by 32 and then repeats the
+sequence when the remainder is zero). The 2
and '0'
in the snippet tell
+QGIS to pad the /fish/fish_00
with two zeroes at the end. Finally the '.png'
tells
+QGIS the type of file to finish off the path.
+
Frame Output location on Windows
+For users on a Windows machine who are interested in seeing the frames before they +are combined into an animation (GIF or movie) you can find them by going to +"C:\Users\Username\AppData\Local\Temp\animation_workbench-0000000000.png". Bear in +mind that AppData is a hidden file, so it's preferable to not make changes unless +explicitly told otherwise. +
+Frame Output on Linux
+The frames should be in your /tmp directory.
+1
): These determine the behaviour and type of animationSphere
: The coordinate reference system (CRS) will be manipulated to create a
+ spinning globe effect. Like Google Earth might do, but with your own data and
+ cartography.Planar
: The coordinate reference system (CRS) will not be altered, but the camera
+ will pan and zoom to each point. It lets you move from feature to feature on a
+ flat map, pausing at each if you want to.Fixed extent
: The frame of reference stays the same and you can animate the
+ symbology within that scene.
Animation Layer (2
):
Dropdown menu
: This allows you to select which map layer you want the animation
+ to follow.Loop from final feature back to first feature
: allows for a seamlessly looping
+ output GIF or movie(MP4).
Zoom Range (3
): The scale range that the animation should move through.
Maximum (inclusive): The scale (zoom level) used when we arrive at each point, + i.e. the most "zoomed in".
+Data defined settings (4
)
Scale
+Animation Frames (5
)
6
):Can be set as a rectangular extent using the Draw on Canvas
feature.
Pan and Zoom Easings (7
)
Zoom Easing (Z): The pan easing will determine the motion characteristics of the + camera on the Z axis as it flies across the scene (i.e. how the camera zooms in + and out of the points)
+Frame previews (8
): A preview of what each frame of the animation will look like. A
+ user can decide which Frame
to view.
Edit the intro section of the generated movie here.
+ +1
): Add images or moviesRemove Media (Minus sign) (2
): Remove images or movies
Duration (3
): For images, you can set a duration for each image (in seconds).
Preview Frame (4
): This shows what the media will look like.
Details: Provides details about where the media is stored on your computer.
+Edit the outro section of the generated movie here.
+ +1
): Add images or moviesRemove Media (Minus sign) (2
): Remove images or movies
Duration (3
): For images, you can set a duration for each image (in seconds).
Preview Frame (4
): This shows what the media will look like.
Details: Provides details about where the media is stored on your computer.
+1
): Add sound files (.mp3 or .wav) to play during the
+ generated movie.Remove Media (Minus sign) (2
): Remove sound files (.mp3 or .wav)
Duration (3
): The cumulative length of your soundtracks should be as long, or longer,
+ than your movie, including the intro/outro sections. If the soundtrack is longer
+ than the movie it will be truncated (shortened) when the movie ends.
Details: Provides details about where the media is stored on your computer.
+1
): This will not erase cached images on disk and will resume
+ processing from the last cached image.2
): For this export to work, you need to have the ImageMagick 'convert'
+ application available on your system.3
): For this option to work, you need to have the 'ffmpeg' application
+ on your system.4
): Allows a user to specify one of four image resolutions
+ for the output animation. The numbers in brackets for the first three options represent
+ the width and height of the output in pixels (i.e. width x height), and the fourth
+ option matches the output's size to the size of the Map Canvas
on the screen.5
): This lets a user select the location where the output
+ will be stored.1
): A preview of what each frame of the animation will look like.
+ It changes automatically as the workbench runs.2
): This provides a detailed look at what is happening while the workbench
+ runs.3
): A detailed list of what steps the workbench is doing (a record of processing)4
): A visual representation of the workbench's progression as a percentage.Run
: Starts the process of getting an output from the workbench. It is greyed out
+ until a user provides a destination for the output file.Close
: Closes the workbench.Cancel
: Ends the workbench processing at whatever point it has reached when the
+ button is pressed.Help
: Opens a link to the Animation Workbench documentation.Welcome to the QGIS Animation Workbench (QAW). QAW is a QGIS Plugins that will help you bring your maps to life! Let's start with a quick overview. Click on the image below to view a 14 minute walkthrough on YouTube.
"},{"location":"#why-qgis-animation-workbench","title":"\ud83e\udd16 Why QGIS Animation Workbench?","text":"QGIS Animation Bench exists because we wanted to use all the awesome cartography features in QGIS and make cool, animated maps! QGIS already includes the Temporal Manager which allows you to produce animations for time-based data. But what if you want to make animations where you travel around the map, zooming in and out, and perhaps making features on the map wiggle and jiggle as the animation progresses? That is what the animation workbench tries to solve...
"},{"location":"#features","title":"\ud83c\udfa8 Features","text":"Supports only English currently - we may add other languages in the future if there is demand.
"},{"location":"contribute/contribute/","title":"Contribute","text":""},{"location":"contribute/contribute/#pull-request-steps","title":"\ud83d\udd27 Pull Request Steps","text":"This project is open source, so you can create a pull request(PR) after you fix issues. Get a local copy of the plugins checked out for development using the following process.
"},{"location":"contribute/contribute/#pull-request","title":"Pull Request","text":"Before uploading your PR, run test one last time to check if there are any errors. If it has no errors, commit and then push it!
For more information on PR's steps, please see links in the Contributing section.
"},{"location":"contribute/contribute/#commit-messages","title":"Commit messages","text":"Please make this project more fun and easy to scan by using emoji prefixes for your commit messages (see GitMoji).
Commit type Emoji Initial commit \ud83c\udf89:tada:
Version tag \ud83d\udd16 :bookmark:
New feature \u2728 :sparkles:
Bugfix \ud83d\udc1b :bug:
Metadata \ud83d\udcc7 :card_index:
Documentation \ud83d\udcda :books:
Documenting source code \ud83d\udca1 :bulb:
Performance \ud83d\udc0e :racehorse:
Cosmetic \ud83d\udc84 :lipstick:
Tests \ud83d\udea8 :rotating_light:
Adding a test \u2705 :white_check_mark:
Make a test pass \u2714\ufe0f :heavy_check_mark:
General update \u26a1\ufe0f :zap:
Improve format/structure \ud83c\udfa8 :art:
Refactor code \ud83d\udd28 :hammer:
Removing code/files \ud83d\udd25 :fire:
Continuous Integration \ud83d\udc9a :green_heart:
Security \ud83d\udd12 :lock:
Upgrading dependencies \u2b06\ufe0f :arrow_up:
Downgrading dependencies \u2b07\ufe0f :arrow_down:
Lint \ud83d\udc55 :shirt:
Translation \ud83d\udc7d :alien:
Text \ud83d\udcdd :pencil:
Critical hotfix \ud83d\ude91 :ambulance:
Deploying stuff \ud83d\ude80 :rocket:
Fixing on MacOS \ud83c\udf4e :apple:
Fixing on Linux \ud83d\udc27 :penguin:
Fixing on Windows \ud83c\udfc1 :checkered_flag:
Work in progress \ud83d\udea7 :construction:
Adding CI build system \ud83d\udc77 :construction_worker:
Analytics or tracking code \ud83d\udcc8 :chart_with_upwards_trend:
Removing a dependency \u2796 :heavy_minus_sign:
Adding a dependency \u2795 :heavy_plus_sign:
Docker \ud83d\udc33 :whale:
Configuration files \ud83d\udd27 :wrench:
Package.json in JS \ud83d\udce6 :package:
Merging branches \ud83d\udd00 :twisted_rightwards_arrows:
Bad code / need improv. \ud83d\udca9 :hankey:
Reverting changes \u23ea :rewind:
Breaking changes \ud83d\udca5 :boom:
Code review changes \ud83d\udc4c :ok_hand:
Accessibility \u267f\ufe0f :wheelchair:
Move/rename repository \ud83d\ude9a :truck:
Other Be creative"},{"location":"contribute/contribute/#contributing","title":"\ud83d\udcac Contributing","text":"This plugin was developed by:
Tim Sutton Nyall Dawson Jeremy Prior Coder and Ideas Guy Genius Guru of Awesomeness Document and Logo Guy timlinux @ github nyalldawson @ github Jeremy-Prior @ github"},{"location":"credits/credits/#contributors","title":"Contributors","text":"Thanks to:
We are looking for contributors, add yourself here!
Also:
Documentation is written using mkdocs.
"},{"location":"develop/docs/#building-documentation-pdf","title":"Building documentation PDF","text":"You can build a copy of the documentation as a PDF file using the following steps:
pip install mkdocs-with-pdf\npip install mkdocs-material\npip install qrcode\nmkdocs build --config-file mkdocs-pdf.yml\nxdg-open pdfs/QGISAnimationWorkbench.pdf \n
"},{"location":"develop/setup/","title":"Developer Notes","text":""},{"location":"develop/setup/#setup","title":"Setup","text":"Fork main
branch into your personal repository. Clone it to local computer. Install QGIS and the following dependencies.
Before starting development, you should check if there are any errors.
git clone https://github.com/{your-personal-repo}/QGISAnimationWorkbench.git\nln -s QGISAnimationWorkbench ~.local/share/QGIS/QGIS3/profiles/<profile>/python/plugins\n
Enable the python in the QGIS plugin manager. You should also install the Plugin Reloader plugin so you can quickly deploy changes to your local session in QGIS as you are working.
"},{"location":"develop/setup/#debugging","title":"Debugging","text":"TODO\n
"},{"location":"develop/setup/#packaging","title":"Packaging","text":"TODO\n
"},{"location":"develop/setup/#run-test","title":"Run test","text":"TODO\n
"},{"location":"faq/faq/","title":"Frequently Asked Questions","text":""},{"location":"faq/faq/#can-i-add-any-image-to-the-intro-or-outro","title":"Can I add any image to the intro or outro?","text":"And the subsequent CPU load during processing:
After processing:
And here is the resulting video:
https://youtu.be/1quc3xPdJsU
"},{"location":"faq/faq/#i-get-an-error-when-rendering-because-of-my-intro-outro-images","title":"I get an error when rendering because of my intro / outro images","text":"Currently your filenames should not contain spaces or special characters (e.g.(, ), [, ], {, }, <, >, /, \\, :, *, ?, |, \", &, etc.).
"},{"location":"faq/faq/#can-i-use-a-movie-as-the-intro-outro-media","title":"Can I use a movie as the intro / outro media?","text":"This is planned but not yet implemented. Tim - check.
"},{"location":"faq/faq/#can-i-pay-you-to-add-some-features","title":"Can I pay you to add some features?","text":"This is a fun / hobby project, currently we want other contributors who also want to have a fun experience with building this plugin and contribute in-kind efforts to the project. Both Kartoza and North-Road offer commercial development services but not for this plugin which is a intended to provide an experimental, no-pressire space for us to work on something fun for QGIS.
"},{"location":"library/snippets/","title":"Snippets","text":""},{"location":"library/snippets/#qgis-support","title":"\ud83c\udf0f QGIS Support","text":"Should work with and version of QGIS 3.x. If you have QGIS 3.26 or better you can benefit from the animated icon support (see @nyalldawson's most excellent patch #48060).
For QGIS versions below 3.26, you can animate markers by unpacking a GIF image into its constituent frames and then referencing a specific frame from the symbol data defined property for the image file. Note that to do this extraction below you need to have the Open Source ImageMagick application installed:
First extract a gif to a sequence of images:
convert cat.gif -coalesce cat_%05d.png\n
Example of how to create a dynamically changing image marker based on the current frame count:
@project_home \n||\n'/gifs/cat_000'\n|| \nlpad(to_string( @frame_number % 48 ), 2, '0')\n|| \n'.png'\n
Note that for the above, 48 is the number of frames that the GIF was composed of, and it assumes the frames are in the project directory in a subfolder called gifs
.
In this example we use a geometry generator to create a line between the origin point and the destination point:
if (@from_feature_id = $id OR @to_feature_id = $id,\n -- read this from inside to out so \n -- last tranform the geometry back to the map crs\n transform( \n -- densify the geometry so that when we transform\n -- back it makes a great circle\n densify_by_count( \n -- move the geometry into a crs that \n -- shows a great circle as a straight line\n transform( \n -- make a line from the previous pont to the next point\n make_line( \n geometry(@from_feature), \n geometry(@to_feature)\n ), \n @map_crs, 'EPSG:4326'),\n 99), \n 'EPSG:4326', @map_crs),\n None)\n
"},{"location":"library/snippets/#showing-diagnostic-info-as-a-copyright-label","title":"Showing diagnostic info as a copyright label","text":"Showing diagnostic information in the QGIS copyright label:
[%\n'Feature Variables:' ||\n' \\n------------------------' ||\n' \\nPrevious Feature ' || to_string(coalesce(attribute(@previous_feature, 'name'), '-')) ||\n' \\nPrevious Feature ID ' || to_string(coalesce(@previous_feature_id, '-')) ||\n' \\n' ||\n' \\nNext Feature ' || to_string(coalesce(attribute(@next_feature, 'name'), '-')) ||\n' \\nNext Feature ID ' || to_string(coalesce(@next_feature_id, '-')) ||\n' \\n' ||\n' \\nHover Feature ' || to_string(coalesce(attribute(@hover_feature, 'name'), '-')) ||\n' \\nHover Feature ID ' || to_string(coalesce(@hover_feature_id, '-')) ||\n' \\n' ||\n' \\nFrom Feature ' || to_string(coalesce(attribute(@from_feature, 'name'), '-')) ||\n' \\nFrom Feature ID ' || to_string(coalesce(@from_feature_id, '-')) ||\n' \\n' ||\n' \\nTo Feature ' || to_string(coalesce(attribute(@to_feature, 'name'), '-')) ||\n' \\nTo Feature ID ' || to_string(coalesce(@to_feature_id, '-')) ||\n' \\n' ||\n' \\nTotal Hover Frames ' || to_string(coalesce(@hover_frames, 0)) ||\n' \\nCurrent Hover Frame ' || to_string(coalesce(@current_hover_frame, 0)) ||\n' \\nTotal Travel Frames ' || to_string(coalesce(@travel_frames, 0)) ||\n' \\nCurrent Travel Frame ' || to_string(coalesce(@current_travel_frame, 0)) ||\n' \\nTotal Frame Count ' || to_string(coalesce(@total_frame_count, 0)) ||\n' \\nFrame Number ' || to_string(coalesce(@frame_number, 0)) ||\n' \\nFrame Rate ' || to_string(coalesce(@frame_rate, 0)) ||\n' \\nwith Current Animation Action: ' || @current_animation_action ||\n' \\nTo Direction ' || coalesce(format_number(degrees(azimuth( geometry(@hover_feature), geometry(@previous_feature) ) ) ), 0) || \n' \\nFrom Direction ' || coalesce(format_number(degrees( azimuth( geometry(@hover_feature), geometry(@next_feature) ) ) ), 0)\n%]\n\n\n
Example output:
"},{"location":"library/snippets/#variable-size-of-labels","title":"Variable size of labels","text":"Variably changing the size on a label as we approach it in the animation:
```40 * ((@frame_number % @hover_frames) / @hover_frames)
\n## Calculating the angle between points\n\nYou can calculate the angle between the hover point and the previous point like this:\n\n```python\ncoalesce(\n format_number(\n degrees( \n azimuth( \n geometry(@hover_feature), \n geometry(@previous_feature) \n )\n )\n ), 0)\n
"},{"location":"library/snippets/#rotation","title":"Rotation","text":"You can set the angle of rotation for a symbol using this expression:
Using this technique you can also create an animation effect showing the source direction of travel and the new destination.
scale_linear (\n @current_hover_frame,\n 0,\n @hover_frames,\n degrees( \n azimuth( \n geometry(@hover_feature), \n geometry(@previous_feature) \n )\n ),\n degrees( \n azimuth( \n geometry(@hover_feature), \n geometry(@next_feature) \n )\n )\n)\n
Will produce something like this:
"},{"location":"library/snippets/#flying-points-cluster","title":"Flying points cluster","text":"Here is an example where we animate all the points in a cluster that are not the hover point. We use an easing function to make the animation have an interesting circular motion.
-- Taken from https://spicyyoghurt.com/tools/easing-functions\n-- t = Time - Amount of time that has passed since the beginning of the animation. Usually starts at 0 and is slowly increased using a game loop or other update function.\n-- b = Beginning value - The starting point of the animation. Usually it's a static value, you can start at 0 for example.\n-- c = Change in value - The amount of change needed to go from starting point to end point. It's also usually a static value.\n-- d = Duration - Amount of time the animation will take. Usually a static value aswell.\n-- Sinusoidal\n-- -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n\n-- Use with the animation in static mode\nif(@hover_feature_id != $id,\narray(\n (-@hover_frames / 2) * (cos( (pi() * @frame_number / @hover_frames ) - 1)) ,\n (-@hover_frames / 2) * (sin( (pi() * @frame_number / @hover_frames ) - 1)) \n),\narray (0,0))\n\n
This function should be applied to the offset X,Y property of the symbol.
"},{"location":"library/variables/","title":"\ud83e\uddee QGIS Expression Variables","text":"The animation workbench exposes or modifies a number of different QGIS Expression variables that you can use to achieve different dynamic rendering effects.
"},{"location":"library/variables/#common-variables","title":"Common variables","text":"These variables will always be available, regardless of the animation mode
Variable Notes frame_number Frame number within the current dwell or pan range. frame_rate Number of frames per second that the video will be rendered at. total_frame_count Total number of frames for the whole animation across all features."},{"location":"library/variables/#fixed-extent-mode-variables-with-layer","title":"Fixed extent mode variables (with layer)","text":"These variables are available when in the fixed extent animation mode when a vector layer has been set
Variable Notes hover_feature The feature we are currently hovering over hover_feature_id Feature ID for the feature we a current hovering over previous_feature The previously visited feature (or NULL if there isn't one) previous_feature_id Feature ID for the previously visited feature (or NULL if there isn't one) next_feature The next feature to visit after the current one (or NULL if there isn't one) next_feature_id Feature ID for the next feature to visit after the current one (or NULL if there isn't one) current_hover_frame The frame number for the current feature (i.e. how many frames we have hovered at the current feature) hover_frames Number of frames we will hover at the current feature for current_animation_action Always \"Hovering\""},{"location":"library/variables/#planarsphere-modes","title":"Planar/Sphere modes","text":"These variables are available in the Planar or Sphere mode.
Variable Notes current_animation_action Either \"Hovering\" or \"Travelling\""},{"location":"library/variables/#when-hovering","title":"When hovering","text":"These variables are available in planar or sphere mode, when the animation is currently hovering over a feature
Variable Notes hover_feature The feature we are currently hovering over hover_feature_id The feature ID for the feature we are currently hovering over previous_feature The previously visited feature (or NULL if there isn't one) previous_feature_id Feature ID for the previously visited feature (or NULL if there isn't one) next_feature The next feature to visit after the current one (or NULL if there isn't one) next_feature_id Feature ID for the next feature to visit after the current one (or NULL if there isn't one) current_hover_frame The frame number for the current feature (i.e. how many frames we have hovered at the current feature) hover_frames Number of frames we will hover at the current feature for"},{"location":"library/variables/#when-travelling","title":"When travelling","text":"These variables are available in planar or sphere mode, when the animation is currently travelling between two features
Variable Notes from_feature The feature we are travelling away from from_feature_id The feature ID for the feature we are travelling away from to_feature The feature we are heading toward to_feature_id The feature ID for the feature we are heading toward current_travel_frame The frame number for the current travel operation travel_frames Number of frames we will travel between the current features"},{"location":"library/variables/#example-expressions","title":"Example expressions","text":"Visit the snippets section of our documentation for example expressions.
"},{"location":"manual/project_preparation/","title":"How to set up a project to work with the animation plugin","text":"1. The first step for getting an output using the Workbench is to create a QGIS Project \u00a0 Open QGIS and click on Project
\u2794 New
Next, add new layers to your project. You will want a few layers; one, or more, backing layer(s) (vector layers or XYZ Tiles), a layer for the workbench to follow, and one, or more, layer(s) of animated points. The example in this section only has one animated layer. \u00a0
To add a layer, go to Layer
\u2794 Create Layer
and then select the type of layer you want to add. The example adds a point layer to a GeoPackage to make the project more portable.
Once you have added your layers you need to add features to the layers. This is done by selecting a layer and then clicking Toggle Editing
(1
) \u2794 Add PointFeature
(2
). Then click around on your map to add as few, or as many, features as you need.
The example project has four layers: two point layers (3
) and two backing layers (4
).
A simple way to add a vector base layer is to type \"world\" into the coordinate textbox
Finally, style your layers to make your project look aesthetically pleasing. To style your layers you must select the layer you want to style and then using the Layer Styling toolbar, play around with the style of the layer until it suits you. A good practice is to have your backing layers as more muted colours and your desired features as more eye-catching colours.
You now have a QGIS Project. \u00a0
2. The next step is to choose which features you want to be animated. \u00a0
Pick the layer (or layers) that you want to have animations. Then either find, or create, the animation for the layer. Make sure you have all the correct attribution for any animations you use. Below is an example of a simple fish animation split into its frames. The frames are repeated to slow down the animation's playback speed.
If you are using QGIS 3.26
you can simply use the new animated point symbol, or if you're using an older version of QGIS 3.x
follow the instructions below.
The layer should contain a Raster Image Marker
. Once you have selected the marker you want to use click on the QGIS Expressions dropdown menu (5
) and click on Edit
(6
).
You can also make a marker move along a line relative to the frame of the animation. Use the Code Snippets Section for more in-depth help.
The example below works with the animation from earlier.
@project_home\n|| \n'/fish/fish_00'\n||\nlpad(to_string( @frame_number % 32), 2, '0')\n||\n'.png'\n
3. Configure your animation
After animating your markers it's time to configure your animation. Open the Animated Workbench and begin choosing between the different modes and options. \u00a0
Open the Workbench by clicking the Animation Workbench
(7
) icon in the Plugin Toolbar.
Configure the settings for your animation. The screenshot below is configured for the example presented in this section. The Animation Layer is selected as route
(8
) because that is the path that the output animation will fly along. The Zoom Range (9
) was selected from the Map Canvas Extent, and the Frame rate per second (fps) (10
) was set to match the number of frames of the animated markers so that they will play nicely in the output. The other settings were selected as a personal choice.
Select the Output Resolution (11
) and a location for your output by clicking on the ellipsis (three dots) or by typing in the desired file path (12
).
Refer to the Workbench User Interface section for more information about what various settings and buttons accomplish.
4. Render your animation! \u00a0 Click Run
and render your output. The output below is the output from the example.
What does the workbench do?
The workbench creates animations from QGIS by generating multiple static frames (images) and then combining those frames into an animation. The user tells QGIS how the frames should change from one to the other. In QGIS 3.26
and later the animated markers allow markers to be animated without the use of the expressions system. \u00a0
How do the animated markers work?
In the code snippet below, the user tells QGIS that as the frame count increments by one the Raster Image Marker
should change to the next image in the sequence.
py @project_home || '/fish/fish_00' || lpad(to_string( @frame_number % 32), 2, '0') || '.png'
The user specifies the path of the image (@project_home/fish/fish_00
). Then the lpad(to_string( @frame_number % 32), 2, '0')
tells QGIS to convert the frame number to a string and then modulus the number of frames by the number of animation frames (32
) (i.e. QGIS divides the number of frames by 32 and then repeats the sequence when the remainder is zero). The 2
and '0'
in the snippet tell QGIS to pad the /fish/fish_00
with two zeroes at the end. Finally the '.png'
tells QGIS the type of file to finish off the path. \u00a0
Frame Output location on Windows
For users on a Windows machine who are interested in seeing the frames before they are combined into an animation (GIF or movie) you can find them by going to \"C:\\Users\\Username\\AppData\\Local\\Temp\\animation_workbench-0000000000.png\". Bear in mind that AppData is a hidden file, so it's preferable to not make changes unless explicitly told otherwise. \u00a0
Frame Output on Linux
The frames should be in your /tmp directory.
1
): These determine the behaviour and type of animationSphere
: The coordinate reference system (CRS) will be manipulated to create a spinning globe effect. Like Google Earth might do, but with your own data and cartography.Planar
: The coordinate reference system (CRS) will not be altered, but the camera will pan and zoom to each point. It lets you move from feature to feature on a flat map, pausing at each if you want to.Fixed extent
: The frame of reference stays the same and you can animate the symbology within that scene.
Animation Layer (2
):
Dropdown menu
: This allows you to select which map layer you want the animation to follow.Loop from final feature back to first feature
: allows for a seamlessly looping output GIF or movie(MP4).
Zoom Range (3
): The scale range that the animation should move through.
Maximum (inclusive): The scale (zoom level) used when we arrive at each point, i.e. the most \"zoomed in\".
Data defined settings (4
)
Scale
Animation Frames (5
)
6
):Can be set as a rectangular extent using the Draw on Canvas
feature.
Pan and Zoom Easings (7
)
Zoom Easing (Z): The pan easing will determine the motion characteristics of the camera on the Z axis as it flies across the scene (i.e. how the camera zooms in and out of the points)
Frame previews (8
): A preview of what each frame of the animation will look like. A user can decide which Frame
to view.
Edit the intro section of the generated movie here.
1
): Add images or moviesRemove Media (Minus sign) (2
): Remove images or movies
Duration (3
): For images, you can set a duration for each image (in seconds).
Preview Frame (4
): This shows what the media will look like.
Details: Provides details about where the media is stored on your computer.
Edit the outro section of the generated movie here.
1
): Add images or moviesRemove Media (Minus sign) (2
): Remove images or movies
Duration (3
): For images, you can set a duration for each image (in seconds).
Preview Frame (4
): This shows what the media will look like.
Details: Provides details about where the media is stored on your computer.
1
): Add sound files (.mp3 or .wav) to play during the generated movie.Remove Media (Minus sign) (2
): Remove sound files (.mp3 or .wav)
Duration (3
): The cumulative length of your soundtracks should be as long, or longer, than your movie, including the intro/outro sections. If the soundtrack is longer than the movie it will be truncated (shortened) when the movie ends.
Details: Provides details about where the media is stored on your computer.
1
): This will not erase cached images on disk and will resume processing from the last cached image.2
): For this export to work, you need to have the ImageMagick 'convert' application available on your system.3
): For this option to work, you need to have the 'ffmpeg' application on your system.4
): Allows a user to specify one of four image resolutions for the output animation. The numbers in brackets for the first three options represent the width and height of the output in pixels (i.e. width x height), and the fourth option matches the output's size to the size of the Map Canvas
on the screen.5
): This lets a user select the location where the output will be stored.1
): A preview of what each frame of the animation will look like. It changes automatically as the workbench runs.2
): This provides a detailed look at what is happening while the workbench runs.3
): A detailed list of what steps the workbench is doing (a record of processing)4
): A visual representation of the workbench's progression as a percentage.Run
: Starts the process of getting an output from the workbench. It is greyed out until a user provides a destination for the output file.Close
: Closes the workbench.Cancel
: Ends the workbench processing at whatever point it has reached when the button is pressed.Help
: Opens a link to the Animation Workbench documentation.There is nothing really to configure! We do provide a few options in the configuration dialog, but most users should not need to change them.
You can access the QGIS Animation Workbench plugin options by opening the standard QGIS Setting dialog and clicking on the animation workbench tab.
Settings \u2794 Options
1
)Currently there are just three configuration options:
2
): This is the number of concurrent tasks that will be used to render animations. The default is 1.3
): This is a developer option that enables the developers to see an icon in the toolbar which will start the debug remote server.4
): This will add extra messages in the logging pane to help you understand what is going on during the rendering process.\u26a0\ufe0f Please take note: We have not yet published the plugin in the QGIS Plugin Repository, but when we do you will be able to access it simply by clicking on the \"QGIS Animation Workbench\" option in the QGIS Plugin Manager.
"},{"location":"start/install/#manual-install-from-github-tagged-release","title":"Manual install from GitHub (tagged release)","text":"To install, visit the Github Repository, click on the Actions
tab, and click on the Make QGIS Plugin Zip For Manual Installs
workflow (the bottom one).
Click on the most recent workflow run (the top one).
Scroll down on the on the page.
And click on animation_workbench
to download the most recent build of the plugin
Download the animation_workbench.zip file and open it in QGIS using the plugin manager as described below.
\u26a0\ufe0f Please take note: We have not yet published the plugin in the QGIS Plugin Repository, in the mean time please follow the steps above to do the installation.
To access the QGIS Plugin Manager you simply need to select Plugins
\u27a1 Manage and Install Plugins...
(1
) in the Menu Toolbar.
Once the QGIS Plugin Manager loads, you need to navigate to the All
(2
) tab and type \"animation\" into the search bar (3
). Select QGIS Animation Workbench from the list of available plugins and then select Install Plugin
(4
).
Once the Animation Workbench is installed, you can access it by clicking on the Animation Workbench
icon (5
) in the Plugin Toolbar.
Note if you are on Ubuntu, you may need to install the Qt5 multimedia libraries.
sudo apt install PyQt5.QtMultimedia\n
"},{"location":"start/using/","title":"Using the Animation Workbench","text":"In this section, we describe the general workflow for using the Animation Workbench.
"},{"location":"start/using/#process-overview","title":"Process Overview","text":"1. Create a QGIS Project \u00a0 Open QGIS and click on Project
\u2794 New
Add new layers to your project
A simple way to add a base layer is to type \"world\" (1
) into the coordinate textbox
Style the layers you've added to make your project look a bit better. Select the layer (2
) you want to style and in the Layer Styling toolbar (3
), style the layer to look appealing to you.
2. Identify features that will be animated. \u00a0
Pick the layer (or layers) that you want to animate. Then either find or create the animation for the layer. Make sure you have all the correct attribution for any animations you use. Below is an example of an animation split into its frames.
3. Use the QGIS Expressions system with the variables introduced by the Animation Workbench to define behaviours of your symbols during flight and hover modes of your animation. \u00a0
Select the layer you want to animate and open the Layer Styling toolbar.
If you are using QGIS 3.26
you can simply use the new animated point symbol, or if you're using an older version of QGIS 3.x
follow the instructions below.
The layer should be a Raster Image Marker
. Once you have selected the image you want to use click on the QGIS Expressions dropdown menu (4
) and click on Edit
(5
).
Use the Code Snippets Section for more in depth help. The example below works with the bird animation from earlier
@project_home\n ||\n '/bird/bird_00'\n || \n lpad(to_string(@frame_number % 9), 2, '0')\n || \n '.png'\n
1. Open the Animation Workbench and configure your animation, choosing between the different modes and options. \u00a0
Open the Workbench by clicking the Animation Workbench
(6
) icon in the Plugin Toolbar.
Configure the settings for your animation. The screenshot below is configured for the example presented in this section. The Animation Layer is selected as route (7
) because that is the path the animation will fly along, the Zoom Range (8
) was selected from the Map Canvas Extent, and the Frame rate per second (9
) was set to 9 to match the bird animation.
Set your desired Output Options
(10
) Select a location for your output (11
).
Refer to the Workbench User Interface Section for more information about what various settings and buttons accomplish.
2. Render your animation! \u00a0 Click Run
and render your output. The output below is the output from the example.
This tutorial introduces the concept of moving a point along a line within your animated map.
1. Download and extract the Required Tutorial Zip Folder
2. Open the tutorial_1.qgz project file that is in the folder. When you first open it you you see something like this:
3. Select the premade line
layer (1
), and click on the Add Symbol Layer
(green plus symbol) button (2
) to it.
Change the new Symbol Layer
(3
) type to marker line and then style it (4
) so that it is more visible.
4. Change the Symbol Layer's
settings so that the point is only on the first vertex
(5
) and and not at equidistant intervals.
Change the offset along the line to be Percentage
(6
).
Click the Dropdown Menu
(7
) \u2794Edit...
(8
) and then add the following code snippet
-- Point Along Line Code Snippet\n (@current_hover_frame/@hover_frames) * 100\n
The snippet tells QGIS how far along the line (as a percentage of the line length) to render the point in each frame.
5. Open the Workbench and select Fixed Extent
(9
).
Click on Map Canvas Extent
(10
) and set the the Frames
to 300 (11
) (for a 10 second output at 30 frames per second).
6. Skip over the Intro
, Outro
, and Soundtrack
tabs. In the Output
tab, set the output format (12
) and resolution (13
), and set the output location's path (14
).
7. Click Run
and render your output.
After this tutorial you should have a better idea of how to make a point move along a line. An expansion to this example would be to make the moving point a dynamically changing marker (like the markers in tutorial 1). Go have fun!
"},{"location":"tutorials/#tutorial-2-basic-dynamically-changing-markers","title":"Tutorial 2: Basic Dynamically Changing Markers","text":"This tutorial aims to show you the basics of creating, and animating, a static layer to use with the Animation Workbench. There are three pre-made layers to allow the main focus of the tutorial to be on the Animation Workbench and not on QGIS as a whole.
1. Download and extract the Required Tutorial Zip Folder
2. Open the tutorial_2.qgz project file that is in the folder. \u00a0
3. Set the CRS of your project to WGS84/UTM zone 35S (EPSG: 32735).
4. In the Browser
, expand the tutorial_2.gpkg and add the three pre-made layers (VaalDam, SouthAfrica, and route) (A
) to your project.
5. In the Layers
Panel, arrange the layers in the following order: route
, VaalDam
, SouthAfrica
. Then right-click on the VaalDam
layer and Zoom to Layer(s)
(B
)
Style the three layers to your preferred style. \u00a0
6. Now create a new layer in the tutorial_2.gpkg by clicking Layer
\u2794Create Layer
\u2794 New GeoPackage Layer...
(C
).
Click on the Ellipsis
(D
), navigate to and select the tutorial_2.gpkg, and click Save
. Change the Table name to fish (E
), set the Geometry type as Point (F
), and change the CRS to match the Project CRS (G
).
Click on OK
and then click Add New Layer
on the window that pops up. \u00a0
7. Select the fish
layer and then click on Toggle Editing
\u2794Add Point Feature
(H
).
Add a few points wherever you feel they should go (Hint: This is a fish layer so adding them above the dam layer would be best). Don't worry about naming the points, just add them.
Save your changes by clicking on Save Layer Edits
just next to the Toggle Editing
button. Then stop editing the layer. \u00a0
8. Repeat steps 6. and 7. but change the Table name to bird and add the points over the land areas.
9. Select the fish
layer and then in the Layer styling
toolbar (I
) change the Symbol layer type
to Raster Image Marker
(J
).
Select the marker image by clicking the Dropdown menu
\u2794Select File...
(K
) and then choosing fish
\u2794fish_0000.png
.
Click Open
10. Change the marker's Size Unit to Meters at Scale
(L
)
and set the Width and Height to 1000. \u00a0
11. Repeat Steps 9. and 10. with the bird
layer but instead choosing bird
\u2794bird_0000.png
and setting the Width and Height to 3000.
In QGIS 3.26
, or later, the Symbol layer type
can simply be selected as Animated Marker
and Step 12. can be skipped.
12. To animate the fish
and bird
layers using the QGIS Expressions
system click the Dropdown Menu
\u2794Edit...
(M
).
For the fish
layer use the following expression:
@project_home\n || \n '/fish/fish_00'\n ||\n lpad(to_string( @frame_number % 32), 2, '0')\n ||\n '.png'\n
And for the bird
layer use:
@project_home\n ||\n '/bird/bird_00'\n || \n lpad(to_string(@frame_number % 9), 2, '0')\n || \n '.png'\n
Refer to the What is the Workbench doing? section for an explanation about what the above code snippet is doing.
13. Open the Animation Workbench (refer to the Using the Animation Workbench section if you are unsure how to open the Workbench).
In the Animation Plan
tab set:
Render Mode
to Planar
(N
),Animation Layer
to route
(O
) using the dropdown menu,Zoom Range
(P
) to 1:270000 for the Minimum and 1:135000 for the Maximum,Frame rate per second
to 9 fps (Q
),Travel duration
to 4,00 s (R
),Feature hover duration
to 2,00 s (S
)Enable both the Pan
and Zoom
easings and set them to linear.
14. Skip past the Intro
, Outro
, and Soundtrack
tabs to the Output
tab. Set the Output Format
as Animated Gif
(T
) and the Output Resolution
to 720p (1280x720)
(U
). The Output Resolution
can be set as any of the three choices but was set at 720
for this tutorial for the sake of speed. Set the output location to one you can find easily (V
)
15. Click Run
and watch what the Workbench is doing in the Progress
tab. Once the Workbench is finished running, you should end up with an output similar to this:
After this tutorial you should have a better understanding of how to create a point layer in your project and then to change the Single Symbol
markers into stationary animated markers. A key focus is the idea that you can tell versions of QGIS
before 3.26
to dynamically change markers using short code snippets. Versions of QGIS
post 3.26
allow a user to simply use the Animated Marker
feature without editing an expression.
This tutorial aims to show you how add a flying point animation to points on your map using built-in QGIS functionalities (The geometry generator line) and introduced variables from the workbench.
1. Download and extract the Required Tutorial Zip Folder
2. Open the tutorial_3.qgz project file. When you first open the project file you should be greeted with something like this:
3. Create a new point layer in a new geopackage by clicking Layer
\u2794Create Layer
\u2794 New GeoPackage Layer...
. Click on the Ellipsis
(three dots) next to the Database textbox and navigate to the folder that the tutorial_3.qgz file is located in. Type the File name \"tutorial_3\" (1
) and ensure the file will be saved as a GeoPackage
(2
) and click Save
(3
).
Change the Table name to flying_points (4
), set the Geometry type as Point (5
) and change the CRS to match the Project CRS (6
).
Click OK
(7
) \u00a0
4. Click on Toggle Editing
\u2794Add Point Feature
(8
).
And randomly add points to your map. Depending on your computer's capabilites, you can add more, or fewer, points than the example below.
Save your Layer Edits and toggle off the Editing tool. \u00a0
5. Style the points layer.
Select the flying_points
(9
) layer and in the Layer Styling
toolbar click on the Add Symbol Layer
(green plus symbol) button (10
).
Select the top Simple Marker
(11
) and change its Symbol layer type to Geometry Generator
(12
)
and then set the Geometry type to LineString / MultiLineString
(13
).
Change the line's Symbol layer type to Marker Line
(14
).
Add a second Simple marker
to the marker line so that you end up with something like this:
Style the various Simple Markers
to your preferred look.
6. Select the Geometry Generator
symbol layer (15
) and add this code to it:
wave_randomized(\n make_line(\n $geometry, geometry(@hover_feature)), \n 100, 1000, 1000, 10000, 1)\n
More information about what changing the numbers will affect can be found in the QGIS expressions editor. \u00a0
7. A few options need to be changed in the Marker Line
symbol layer (16
): The Marker placement needs to be set to On first vertex
(17
) and, the Offset along line needs to be changed to Percentage
(18
). The click the Dropdown menu
next to Offset along line and select Edit...
(19
).
In the Expression String Builder
add the following code snippet:
100 - to_int((@current_hover_frame / @hover_frames) * 100 )\n
Click OK
8. Select the first Simple Marker
symbol layer (20
) in the Marker Line
symbol layer. Scroll down to Offset and click on the Dropdown Menu
\u2794Edit..
(21
).
In the Expression String Builder
add the following code snippet:
-- Taken from https://spicyyoghurt.com/tools/easing-functions\n -- t = Time - Amount of time that has passed since the beginning of the animation. Usually starts at 0 and is slowly increased using a game loop or other update function.\n -- b = Beginning value - The starting point of the animation. Usually it's a static value, you can start at 0 for example.\n -- c = Change in value - The amount of change needed to go from starting point to end point. It's also usually a static value.\n -- d = Duration - Amount of time the animation will take. Usually a static value aswell.\n -- Sinusoidal\n -- -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;\n\n -- Use with the animation in static mode\n if(@hover_feature_id != $id,\n array(\n (-@hover_frames / 2) * (cos( (pi() * @frame_number / @hover_frames ) - 1)) ,\n (-@hover_frames / 2) * (sin( (pi() * @frame_number / @hover_frames ) - 1)) \n ),\n array (0,0))\n
Click OK
9. Open the Animation Workbench
(22
)
10. Set up the Animation Plan
with:
Render Mode
to Planar
(23
),Animation Layer
to flying_points
(24
) using the dropdown menu,Zoom Range
(25
) to 1:22000000 for the Minimum and 1:11000000 for the Maximum,Frame rate per second
to 9 fps (26
),Travel duration
to 2,00 s (27
),Feature hover duration
to 2,00 s (28
),Zoom Easing
as InCirc (29
)
With a decently specced computer you can up the fps and get the points to fly faster in your output. \u00a0
11. Add license-free media to the Intro
, Outro
, and Soundtrack
.
Make sure your Soundtrack
is as long as, or longer than, your final animation will be (including the Intro
, Animation
, and Outro
).
12. Set the Output Format
as Movie (MP4)
(30
) and the Output Resolution
to 1080 (1920x1080)
(31
). The Output Resolution
can be set as any of the three choices but was set at 1080
for this tutorial for the sake of speed. Set the output location (32
) to one you can easily locate.
13. Click Run
and get an output. The GIF below is the visual output of the tutorial if you followed step-by-step and set the parameters to exactly what was stated.
The link to a more complex output (with an Intro
, an Outro
, and a Soundtrack
) can be found here
After this tutorial you should have a better idea of how you can use a mixture of built-in QGIS functionalites and the workbench's introduced variables to generate interesting outputs.
"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml new file mode 100644 index 0000000..e2affed --- /dev/null +++ b/sitemap.xml @@ -0,0 +1,83 @@ + +There is nothing really to configure! We do provide a few options in the +configuration dialog, but most users should not need to change them.
+You can access the QGIS Animation Workbench plugin options by opening the standard +QGIS Setting dialog and clicking on the animation workbench tab.
+++ +Settings ➔ Options
+
1
)Currently there are just three configuration options:
+2
): This is the number of concurrent tasks
+that will be used to render animations. The default is 1.3
): This is a developer option that enables the developers
+to see an icon in the toolbar which will start the debug remote server.4
): This will add extra messages in the logging pane to
+help you understand what is going on during the rendering process.⚠️ Please take note: We have not yet published the plugin in the QGIS Plugin Repository, but when we do you will be able to access it simply by clicking on the "QGIS Animation Workbench" option in the QGIS Plugin Manager.
+To install, visit the Github Repository, click on the Actions
tab, and click on the
+Make QGIS Plugin Zip For Manual Installs
workflow (the bottom one).
Click on the most recent workflow run (the top one).
+ +Scroll down on the on the page.
+ +And click on animation_workbench
to download the most recent build of the plugin
Download the animation_workbench.zip file and open it in QGIS using the plugin manager as described below.
+⚠️ Please take note: We have not yet published the plugin in the QGIS Plugin Repository, in the mean time please follow the steps above to do the installation.
+To access the QGIS Plugin Manager you simply need to select
+Plugins
➡ Manage and Install Plugins...
(1
) in the Menu Toolbar.
Once the QGIS Plugin Manager loads, you need to navigate to the All
(2
) tab and
+type "animation" into the search bar (3
). Select QGIS Animation Workbench from the list
+of available plugins and then select Install Plugin
(4
).
Once the Animation Workbench is installed, you can access it by clicking on the
+Animation Workbench
icon (5
) in the Plugin Toolbar.
++Note if you are on Ubuntu, you may need to install the Qt5 multimedia libraries.
+
sudo apt install PyQt5.QtMultimedia
+
+
+
+
+
+
+
+ In this section, we describe the general workflow for using the Animation Workbench.
+1. Create a QGIS Project
+
+Open QGIS and click on Project
➔ New
+
Add new layers to your project
+ +++A simple way to add a base layer is to type "world" (
+1
) into the coordinate +textbox
Style the layers you've added to make your project look a bit better. Select the
+layer (2
) you want to style and in the Layer Styling toolbar (3
), style the layer to
+look appealing to you.
+
2. Identify features that will be animated. +
+Pick the layer (or layers) that you want to animate. Then either find or create the +animation for the layer. Make sure you have all the correct attribution for any +animations you use. Below is an example of an animation split into its frames.
+ +3. Use the QGIS Expressions system with the variables introduced by the Animation +Workbench to define behaviours of your symbols during flight and hover modes of your +animation. +
+Select the layer you want to animate and open the Layer Styling toolbar.
+++If you are using
+QGIS 3.26
you can simply use the new animated point symbol, +or if you're using an older version ofQGIS 3.x
follow the instructions below.
The layer should be a Raster Image Marker
. Once you have selected the image you
+want to use click on the QGIS Expressions dropdown menu (4
) and click on Edit
(5
).
+Use the Code Snippets Section for more in depth help. The +example below works with the bird animation from earlier
+ + @project_home
+ ||
+ '/bird/bird_00'
+ ||
+ lpad(to_string(@frame_number % 9), 2, '0')
+ ||
+ '.png'
+
+1. Open the Animation Workbench and configure your animation, choosing between the +different modes and options. +
+Open the Workbench by clicking the Animation Workbench
(6
) icon in the Plugin Toolbar.
+
+Configure the settings for your animation. The screenshot below is configured for
+the example presented in this section. The Animation Layer is selected as route (7
)
+because that is the path the animation will fly along, the Zoom Range (8
) was selected
+from the Map Canvas Extent, and the Frame rate per second (9
) was set to 9 to match
+the bird animation.
+
+Set your desired Output Options
(10
) Select a location for your output (11
).
+
+++Refer to the Workbench User Interface Section for more information about +what various settings and buttons accomplish.
+
2. Render your animation!
+
+Click Run
and render your output. The output below is the output from the example.
This tutorial introduces the concept of moving a point along a line within your animated +map.
+1. Download and extract the Required Tutorial Zip Folder +
+2. Open the tutorial_1.qgz project file that is in the folder. When you first open it you +you see something like this:
++
+3. Select the premade line
layer (1
), and click on the Add Symbol Layer
+(green plus symbol) button (2
) to it.
Change the new Symbol Layer
(3
) type to marker line and then style it (4
) so that it is more visible.
4. Change the Symbol Layer's
settings so that the point is only on the first vertex
(5
) and
+and not at equidistant intervals.
Change the offset along the line to be Percentage
(6
).
Click the Dropdown Menu
(7
) ➔Edit...
(8
) and then add the following code snippet
-- Point Along Line Code Snippet
+ (@current_hover_frame/@hover_frames) * 100
+
+
+The snippet tells QGIS how far along the line (as a percentage of the line length) to +render the point in each frame.
+5. Open the Workbench and select Fixed Extent
(9
).
Click on Map Canvas Extent
(10
) and set the the Frames
to 300 (11
) (for a 10 second
+output at 30 frames per second).
6. Skip over the Intro
, Outro
, and Soundtrack
tabs. In the Output
tab, set the output
+format (12
) and resolution (13
), and set the output location's path (14
).
7. Click Run
and render your output.
After this tutorial you should have a better idea of how to make a point move along a line. +An expansion to this example would be to make the moving point a dynamically changing +marker (like the markers in tutorial 1). Go have fun!
+This tutorial aims to show you the basics of creating, and animating, a static layer to use +with the Animation Workbench. There are three pre-made layers to allow the main focus of +the tutorial to be on the Animation Workbench and not on QGIS as a whole.
+1. Download and extract the Required Tutorial Zip Folder +
+2. Open the tutorial_2.qgz project file that is in the folder. +
+3. Set the CRS of your project to WGS84/UTM zone 35S (EPSG: 32735).
++
+4. In the Browser
, expand the tutorial_2.gpkg and add the three pre-made layers
+(VaalDam, SouthAfrica, and route) (A
) to your project.
+
+5. In the Layers
Panel, arrange the layers in the following order: route
, VaalDam
,
+SouthAfrica
. Then right-click on the VaalDam
layer and Zoom to Layer(s)
(B
)
Style the three layers to your preferred style. +
+6. Now create a new layer in the tutorial_2.gpkg by clicking Layer
➔Create Layer
➔
+New GeoPackage Layer...
(C
).
+
+Click on the Ellipsis
(D
), navigate to and select the tutorial_2.gpkg, and
+click Save
. Change the Table name to fish (E
), set the Geometry type as Point (F
), and
+change the CRS to match the Project CRS (G
).
Click on OK
and then click Add New Layer
on the window that pops up.
+
7. Select the fish
layer and then click on Toggle Editing
➔Add Point Feature
(H
).
Add a few points wherever you feel they should go (Hint: This is a fish layer so adding +them above the dam layer would be best). Don't worry about naming the points, just add +them.
+ +Save your changes by clicking on Save Layer Edits
just next to the Toggle Editing
+button. Then stop editing the layer.
+
8. Repeat steps 6. and 7. but change the Table name to bird and add the points over +the land areas.
++
+9. Select the fish
layer and then in the Layer styling
toolbar (I
) change the
+Symbol layer type
to Raster Image Marker
(J
).
Select the marker image by clicking the Dropdown menu
➔Select File...
(K
)
+and then choosing fish
➔fish_0000.png
.
Click Open
+
10. Change the marker's Size Unit to Meters at Scale
(L
)
and set the Width and Height to 1000. +
+11. Repeat Steps 9. and 10. with the bird
layer but instead choosing bird
➔bird_0000.png
+and setting the Width and Height to 3000.
+
++In
+QGIS 3.26
, or later, theSymbol layer type
can simply be selected as +Animated Marker
and Step 12. can be skipped.
12. To animate the fish
and bird
layers using the QGIS Expressions
system click the
+Dropdown Menu
➔Edit...
(M
).
For the fish
layer use the following expression:
@project_home
+ ||
+ '/fish/fish_00'
+ ||
+ lpad(to_string( @frame_number % 32), 2, '0')
+ ||
+ '.png'
+
+And for the bird
layer use:
@project_home
+ ||
+ '/bird/bird_00'
+ ||
+ lpad(to_string(@frame_number % 9), 2, '0')
+ ||
+ '.png'
+
+++Refer to the What is the Workbench doing? section for an explanation + about what the above code snippet is doing.
+
13. Open the Animation Workbench (refer to the Using the Animation Workbench section +if you are unsure how to open the Workbench).
+In the Animation Plan
tab set:
Render Mode
to Planar
(N
),Animation Layer
to route
(O
) using the dropdown menu,Zoom Range
(P
) to 1:270000 for the Minimum and 1:135000 for the Maximum,Frame rate per second
to 9 fps (Q
),Travel duration
to 4,00 s (R
),Feature hover duration
to 2,00 s (S
)Enable both the Pan
and Zoom
easings and set them to linear.
14. Skip past the Intro
, Outro
, and Soundtrack
tabs to the Output
tab. Set the
+Output Format
as Animated Gif
(T
) and the Output Resolution
to
+720p (1280x720)
(U
). The Output Resolution
can be set as any of the three
+choices but was set at 720
for this tutorial for the sake of speed. Set the output
+location to one you can find easily (V
)
+
+15. Click Run
and watch what the Workbench is doing in the Progress
tab. Once the
+Workbench is finished running, you should end up with an output similar to this:
After this tutorial you should have a better understanding of how to create a point layer
+in your project and then to change the Single Symbol
markers into stationary animated
+markers. A key focus is the idea that you can tell versions of QGIS
before 3.26
to dynamically
+change markers using short code snippets. Versions of QGIS
post 3.26
allow a user to
+simply use the Animated Marker
feature without editing an expression.
This tutorial aims to show you how add a flying point animation to points on your map using +built-in QGIS functionalities (The geometry generator line) and introduced variables from +the workbench.
+1. Download and extract the Required Tutorial Zip Folder +
+2. Open the tutorial_3.qgz project file. +When you first open the project file you should be greeted with something like this:
++
+3. Create a new point layer in a new geopackage by clicking Layer
➔Create Layer
➔
+ New GeoPackage Layer...
. Click on the Ellipsis
(three dots) next to the Database
+textbox and navigate to the folder that the tutorial_3.qgz file is located in. Type the File
+name "tutorial_3" (1
) and ensure the file will be saved as a GeoPackage
(2
) and click
+Save
(3
).
+
+Change the Table name to flying_points (4
), set the Geometry type as Point (5
) and
+change the CRS to match the Project CRS (6
).
Click OK
(7
)
+
4. Click on Toggle Editing
➔Add Point Feature
(8
).
+
+And randomly add points to your map. Depending on your computer's capabilites, you +can add more, or fewer, points than the example below.
++
+Save your Layer Edits and toggle off the Editing tool. +
+5. Style the points layer.
+Select the flying_points
(9
) layer and in the Layer Styling
toolbar click on the
+Add Symbol Layer
(green plus symbol) button (10
).
+
+Select the top Simple Marker
(11
) and change its Symbol layer type to
+Geometry Generator
(12
)
and then set the Geometry type to LineString / MultiLineString
(13
).
+
+Change the line's Symbol layer type to Marker Line
(14
).
+
+Add a second Simple marker
to the marker line so that you end up with something like
+this:
+
+Style the various Simple Markers
to your preferred look.
+
6. Select the Geometry Generator
symbol layer (15
) and add this code to it:
wave_randomized(
+ make_line(
+ $geometry, geometry(@hover_feature)),
+ 100, 1000, 1000, 10000, 1)
+
++
+++More information about what changing the numbers will affect can be found in the +QGIS expressions editor. +
+
7. A few options need to be changed in the Marker Line
symbol layer (16
): The Marker
+placement needs to be set to On first vertex
(17
) and, the Offset along line needs to be
+changed to Percentage
(18
). The click the Dropdown menu
next to Offset along line and
+select Edit...
(19
).
+
+In the Expression String Builder
add the following code snippet:
100 - to_int((@current_hover_frame / @hover_frames) * 100 )
+
++
+Click OK
+
8. Select the first Simple Marker
symbol layer (20
) in the Marker Line
symbol layer. Scroll
+down to Offset and click on the Dropdown Menu
➔Edit..
(21
).
+
+In the Expression String Builder
add the following code snippet:
-- Taken from https://spicyyoghurt.com/tools/easing-functions
+ -- t = Time - Amount of time that has passed since the beginning of the animation. Usually starts at 0 and is slowly increased using a game loop or other update function.
+ -- b = Beginning value - The starting point of the animation. Usually it's a static value, you can start at 0 for example.
+ -- c = Change in value - The amount of change needed to go from starting point to end point. It's also usually a static value.
+ -- d = Duration - Amount of time the animation will take. Usually a static value aswell.
+ -- Sinusoidal
+ -- -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b;
+
+ -- Use with the animation in static mode
+ if(@hover_feature_id != $id,
+ array(
+ (-@hover_frames / 2) * (cos( (pi() * @frame_number / @hover_frames ) - 1)) ,
+ (-@hover_frames / 2) * (sin( (pi() * @frame_number / @hover_frames ) - 1))
+ ),
+ array (0,0))
+
++
+Click OK
+
9. Open the Animation Workbench
(22
)
+
+10. Set up the Animation Plan
with:
Render Mode
to Planar
(23
),Animation Layer
to flying_points
(24
) using the dropdown menu,Zoom Range
(25
) to 1:22000000 for the Minimum and 1:11000000 for the
+ Maximum,Frame rate per second
to 9 fps (26
),Travel duration
to 2,00 s (27
),Feature hover duration
to 2,00 s (28
),Zoom Easing
as InCirc (29
)+
+++With a decently specced computer you can up the fps and get the points to fly +faster in your output. +
+
11. Add license-free media to the Intro
, Outro
, and Soundtrack
.
++Make sure your
+Soundtrack
is as long as, or longer than, your final animation will be +(including theIntro
,Animation
, andOutro
).
+
12. Set the Output Format
as Movie (MP4)
(30
) and the Output Resolution
to
+1080 (1920x1080)
(31
). The Output Resolution
can be set as any of the three
+choices but was set at 1080
for this tutorial for the sake of speed. Set the output
+location (32
) to one you can easily locate.
+
+13. Click Run
and get an output. The GIF below is the visual output of the tutorial if you
+followed step-by-step and set the parameters to exactly what was stated.
+
+The link to a more complex output (with an Intro
, an Outro
, and a Soundtrack
) can
+be found here
+
After this tutorial you should have a better idea of how you can use a mixture of built-in +QGIS functionalites and the workbench's introduced variables to generate interesting outputs.
+ + + + + + + +