QGIS 3.14 time handling and map animation demo

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments

Nyall Dawson, a major contributor to the QGIS development team, demos the new Temporal features. This is essentially the TimeManager plugin which is being brought into native QGIS, integrating as a new type of filter on layers, and introducing new variables.

👍︎︎ 3 👤︎︎ u/Procrastine 📅︎︎ May 15 2020 🗫︎ replies

Nyall Dawson is awesome, has really helped turn QGIS into an excellent GIS tool. As a fellow aussie I certainly hope to meet him someday.

👍︎︎ 5 👤︎︎ u/GeoResearchRedditor 📅︎︎ May 16 2020 🗫︎ replies

This is something O've been waiting for for years. There was a pretty clunky plugin previously that was buggy as hell and required a ton of tweaking to make work. Thrilled I can finally animate historical maps as a native feature.

👍︎︎ 2 👤︎︎ u/InfiNorth 📅︎︎ May 16 2020 🗫︎ replies

Super cool, thanks for sharing!

👍︎︎ 1 👤︎︎ u/walrusrage1 📅︎︎ May 16 2020 🗫︎ replies
Captions
hi everyone I hope you can hear me and I hope this is all working well it's my first time doing one of these live a livestream session so I hope I hope we don't have any technical glitches it's always Oh add a little bit nerve-racking when you're doing a live demonstration of software especially when it sounds pretty release software so fingers crossed fingers crossed if you can if someone could just let me know in the live chat if you can hear me and if you could see my screen and it always looking good can someone give me a thumbs up or any way oh I'll keep going and just trust that this is working great thanks for the confirmation okay so my name is Niall Dawson I'm from a company called North Road but I'm also a cutest developer so I've been involved in the cutest project for mmm I think maybe over ten years now and it's been a fantastic time so it's been a fantastic journey and I'm you know I'm really pleased to have being part of this community today I wanted to give a bit of a rundown on one of the exciting features that's coming up in qgis 3.14 which is a whole new framework that's landed in cutis for time handling and for temporal filtering and animation creation so if you're not aware of the the cutest release schedule with the current stable release is 3.12 which has been out for a number of months now 3.14 is coming out in just over a month so it basically went down into into its own kind of lockdown state last night and it's now in a in a stabilization state where there we focus on bug focusing and is getting that 3.14 release in top shape for when it hits and uses like a lot of you're tuning in today the nice thing is anybody can get their pre-release now so you can go on to the cutest org website and follow the links to one of the nightly or the weekly releases and you can start testing this out and definitely if you do that and you have feedback or you run into bugs or run into issues or just have suggestions and how it could be improved definitely pass that feedback on to the project it's it's very very valuable all right let's kick off let me just find my get rid of this let's fire up my cutest window so here we have everyone you can see me now here we have a brand new copy of hugest 3.14 we can test this if we look up here in the about screen we've got hugest version is 3.13 master version so it's again it's a it's a beta version what you see today might look a little bit different in the final release might be a little less buggy in the final release fingers crossed we don't see any bugs today again alright I've got a I got a whole bunch of stuff I'm going to run through today so I'll start with what we're gonna start with us gonna start with this little project here alright so here I've just fired up a really simple cutest project so this one has got a bunch of raster layers in here and these these particular raster's represent different let me just change something here for a second different periods of time so it's it's a serials a series of aerial imagery that's been captured over a number of years of the same area there's nothing special about these layers these are just just JPEG files so it's just a standard geographic JPEG file that I've loaded into the queue just nothing fancy at all this is basically like that that the simplest you can get when I go into my lair properties here impute is free 14 for a standard raster layer like this I can go now there's a new temporal tab here you see so temporal and this has a few options so first off in my project here I've I've ticked on this little temporal state to say I actually want this layer here to be managed by the whole time framework computer's 3.14 um by default if I just put this layer in by the by drag-and-drop or adding the layer this would be unchecked but I've just tick it for my my really basic JPEG layer here I only have a single option so the option that I get to set for this layer is a fixed time range so this this option as the little helper text here says this layer will only be shown if the animation time is within this current range so I've set this manually this I took this from the metadata for the layer but I've set a time range here to say that this layer applies between 2017 and so December 2017 to May 28th eeen and like I said I've got about half a dozen of layers in my project here if I look at the next one up so this is similar I've loaded this in I've said it to temporal and I've just put the fixed time range for this is slightly different because it's a different time range so this one starts at the time that my previous might end of that and then goes to to mid-july all the way up to this layer here which is from 2019 to basically into the map so if I switch all these on we can say something's a little bit different in that the layers have this little temporal icon next to it and I feel hover over that it's indicating that it's a temporal lamp so that's just a little bit of a a guide to say hey this layer here is being managed by that the cutest time frame work so its behavior will be a little bit different to a standard layer and if I went in here I turned this off so that's not temporal that indicator disappear so now it's just a plain old raster layer same as any old wrestler but this is basically like a little guide to say hey things with this layer will be a will be different to what you expect alright now if we actually want to see how the the time framework works there's a new toolbar button appear that looks like a clock so if I hit this one we get a new panel at the top of my screen here that the temporal controller it defaults to being off so I'm just going to switch this across to the animation mode and we get a few controls here that we need to we need to tweak initially so first off the most important one we've got here is the overall time range so this this date time represents the basically the earliest time that I want a view in my project and this one here is the latest time and these quite nice if I just feel all this and just change this a bit there's a button here that auto calculates this so as it says matches the time range to the project when I hit that it'll scan through all my temporal layers and try and work out the extents that that temporal extent based on the data that's present and the settings that are present for each of these time manage layers so in this case it's it's nice and simple because it's looking at our fixed time ranges and it's save basically taking the earliest so 2017 1208 becomes the earliest time in our in our animation here and then the latest is getting taken from the delay with the the most the biggest time value so that's now populated so basically this little slider here at the top is going to go from 2017 December 2017 all the way up to may may 20 20 is the first thing that I need to set up in my in my new time time aware project the second thing I need to set up is this step over here so each each map or each sort of frame in this animation or when I'm when I use a time manage project it represents a time range and that tight the length of that time range is set by this control here so currently it's defaulted here to a 1-day time length and we can see at the top there's a little label here that gives me the current time range like the little slice of time that I'm viewing right now in my canvas so you can see right now this this view is the time frame from 2017 12:08 so hey for December 2017 to the night for December 2017 so it's a one day length our our time interval here is dictating the overall input time that we can actually view in our map if I bump this up and say changed it to 10 days then let me just step through 2 and refresh that so now my visible time range here is going from 2017 the 8th for December to the 18th of December so time range of 10 days and you get lots of choice of units here as well because you know some projects will be on on a centuries level of time some might be on milliseconds so you can you can tweak the time unit depending on what what makes sense for your particular project I only say this back to one day for this for this data set as I drag this little slider around that tapia you'll see that D the current time slice that we're viewing in the map is changing so it's still keeping that one day length that I've got here but where getting a different one day depending on where the current slider of sits and you can see here as I drag this backwards and forwards the maps changing so when I go from around about here we've got to we've got to change so we're at about 2020 1850 May 11 2008 team um we're seeing one of these layers switch off because of that that static time range that's sitting here it's actually this one so this one here is no long no longer becomes visible because it's past its end date and the next one kicks in which is this one where I'm saying it starts at this time at this date so as I kind of stepped through you get past that that period we go you could see one of the rest is switching off and the next one switching on so the visitor it's it's mm kind of like our if I had set up a scale visibility for this layer it's a good way of thinking about it with this mode but instead of switching on and off the raster in a certain scale range we're switching it on and off in a certain time range so now as I drag my my way for this slider I can see the different aerial imagery is kicking in and out depending on the current it's slice of time that I'm looking at um so the next thing we'll look at is we've got these controls up here this little navigation object which gives us this sort of standard playback controls so at the moments in this pause mode which means that I can just drag this around it's not moving by itself but if I put this back here and I let me just check uh sitting here you said that if I hit the play button my animation will start playing by itself so now you can see the the frame is advancing by my one-day interval so it's going stick tick-tick-tick through that overall time range that we've set up yep and it's stepping forward by our one-day jump um by default it it's using a it's advancing one frame every second so it's like a one frame per second animation I can go to this little Settings cogwheel icon up in the top right here and change that so if I boost this up to say 30 frames a second to get a bit of a smoother animation there you can see it's advancing a lot quicker because the ever 30 times a second we're jumping forward one day as it goes will see those layers that layer updates it's different one switch in and out again so when I hit play it'll basically play until it hits the end of that time frame and then stop um I could then I could hit the reverse button which will play that animation that time backwards so I could see see they're going back in time there's also bands here if I'm in there say the pause that I could step forward frame by frame with this advance frame button or reverse frame which is steps backwards by one frame we've also got rewind to start and jump to end and right on the far side here there's also a handy setting for looping the animation so if I've got that on as soon as the animation hits the end it'll just jump back to start and keep repeating and basically just repeat indefinitely until I hit I stop it so let's let that go to the end and see that action there so when it hits the end just jumps back to the start of the time frame it just keeps repeating so I can see em yeah just a few that animation multiple times okay let's stop that so this is um the simplest way of setting up an animation it's basically like the a blunt force approach where you've just got non time aware datasets I've put them in there and I've manually made them time aware by giving them this this fixed time range setting it works well for certain data sets like I said for for kind of non time aware datasets it's it's a great fall back but if I had say a hundred different layers here it would be pretty tedious to go in here and set up there the time slice for each of those so yeah so let's have a look at some other ways we can get that time aware data into a project so this this whole temporal framework in QGIS was started by an organization called Carcosa and we have developer Samwell II from cat oza in the chat at the moment says Sam well he's actually the one who kicked all this off big thanks to you do you and one of the the motivators for this temporal framework was initially to get handling of WMS services WM w MST services say you've got I've probably got this backwards me off but um you have W MTS which is like the tiled service and then you have W mm s T which is like a time aware WMS server so I'm gonna load one in here from meteorological Service of Canada Web Services so this is just a WMS server but it's also WMS we've time aware metadata in there you can load this service into an older version of kudos and it will just appear like a sort of static WMS layer but when you pull it into queue just 3.14 you can see it's actually automatically set up some temporal capabilities for this layer so what it's done is it's checked the WMS and it's it's queried its metadata and said ah you've got this time capabilities so I'm going to make things easy for users all as much as possible like this in advance um so let's have a look and see what's actually done here I go to my little time indicator and I click on that so in this case the layers been made temporal again with that tick box under the the temporal tab but unlike my plain JPEG layers it's not set to a fixed time range it's actually now set to this automatic mode which wasn't available for my my basic JPEG files so it's pulled this in and set it to the automatic and what automatic actually means is that it's going to delegate responsibility for that time handling to the back end so in this case the the WMS server itself and basically say hey you've got all that that knowledge about this data that's been set up by the data custodians so we're gonna let you be responsible for how this layer handles the time dimension and make things easy for users because we don't have to go in there and do any kind of configuration so let's have a look at this one let's go back to the animation mode for this and I'm just gonna change a few settings here for values that make sense for this data set um so this is a air temperature over time layer which is coming from the WMS and let's just zoom in somewhere a bit interesting unfortunately this WMS is a little bit slow to access for myself so there's you could see there's quite a delay between each each request and when it comes back which is a little bit annoying but alright so this this when I loaded this WMS time aware layer into my new project it's automatically set up the overall time range here so it's saying that this particular data set has data available between 15th of May to 25th of May and that's best basically the time range that's been set up by the getting that custodian of health where that data is available and as I step through this just going through frame by frame it's getting a it's requesting a new slice of that of that layer from the the back end takes a little bit of time again because I it's not quick to access this particular service formally but after it's done it once then that image is cached so at least it's it's fast to jump back in them start navigating through that and I can see the change in time in this case in four hour increments like so um now because this is like a unified time handling capabilities if I had this layer in my project I could add other ones that are like I showed just before that sort of static time frame setup and they'll all be managed by this single slider so it doesn't matter what the sort of source of the data is this applies to all the layers in your project right so there's a that's a WMS we've time aware capabilities now and again you'll notice this mostly because when you load a layer in from a WMS you'll see it gets a little time indicator straightaway okay the next one I'm gonna look at ease I'm gonna load in a in a mesh data set so meshes if you're not familiar with them they've whilst started landing in queue just may be around the 3.4 year I think and they've basically been made more and more powerful over time a lot of this is driven by the crayfish plugin and users who use these mesh datasets for things like water modeling and flood management and this kind of thing um but they also used a lot with with weather data so in this case I'm gonna pull in a data set that's got some so this is hurricane Michael data let's add this one and a lot of these mesh data types sort of inherently time aware um so again when I pull this one into my project it's automatically defaulted to a time being a time or wear layer so it knows that May this particular one it's got temporal metadata so it's kind of set that up for us if we have a look in here mesh layers will be different so here the settings are different to what we saw for the raster's so for meshes we have things like that of time units we have the reference time which is basically like the start of that data set and a few other things F but let's just bring up the styling panel for this one because this is where it gets interesting so at the moment for this mesh layer I'm looking at one of the data sets or one of the groups inside this data which is the the wind data and let's have a look as we slide this time slider through we can see there there's a ton of data in here in in really nice increments so as I as I step through looking better if I play it you could see the this weather data change over time let's make it a little bit smoother by pulling down the the increment so while this is playing I can still get in there and interact with my map in all the usual ways zooming in and out and switching our flyers and whatnot but it's the time slider up here is the exactly the same as we've seen before so it's still using the same approach of having a interval for this frame in this case one hour so from 1500 to 1600 and the overall time range here that dictates the earliest and latest times so I could slide this time slider through here I could actually change if I want to visualize a different data set here so let's say I want to look at the temperature data Misha's are kind of cool because they can sometimes have these contour based stuff in here as well so I could set up something like this so now I can see the temperature data in the background along with the wind with little arrows and they can see again that's that's animating and changing over time as my time slice advances through this layer so really great for visualizing modeling results especially if you've got stuff like I said from water modeling programs like to flow you can pull it in here and you can kind of mate that over time and see exactly how that changes okay so that's raster's and look it out WMS we looked at mesh now I'm going to explore my personal favorite which is the vector time handling I really like this because it's heaps of heaps of ways that you can tie time aware vectors in with you just as symbology engine to make some awesome awesome effects so that's what we're going to cover now from my my cutest market okay I'm going to pull in for my Victor data so I've just loaded in a Geo package here that has some historic earthquake data so if I have a look at the table for this one we can see that we've got the critical field here he is a is our time field so this this particular data set is seismic events over time and it has attributes like the actual time that that measurement was taken and if we scroll right here the other interesting one that we'll look at today is there's a magnitude attribute here which is varying from null for whatever reason so from varying from about two point six to six point three so that's sort of the you know the magnitude of that seismic event fortunately in this data set I can see that my my time column is a date/time type by hovering over the header bar here so that's great it's already a it's already a native date/time type so I don't have to do any messing around with converting string based dates or times into native date times so I can just jump straight to visualizing this by going into my layer properties oops in the temporal tab so when I tick this one I have a whole bunch of different configuration options here for how this vector layer will be time aware so might like my basic JPEG demo from the start the one option we've got is just it at the fixed time range so the little helper text here describes exactly what that means that's when I'm set to fixed time range all the features from that layer will be rendered whenever the maps temporal range overlaps the range defined below so this one lets me to set up that kind of overall static time range to say just turn on this layer render all the dots inside it when my time is between the 6th of May and 29th of May so again it's basically the the equivalent of that raster mode where it's just a just this time range applies to the whole of that data set not particularly interesting but it could be useful if you had say if that time data was split over multiple layers with what are the options here for a whole lot of different configurations that will apply depending on how the fields are actually structured inside that that Victor laughs so we have one for a single field with date/time separate fields for start and end date time separate fields for a start and event duration starting in time from expressions and one that we'll cover later so in this case our dataset had a single field it had just that one time field in this case the fields actually named time but we had just that one one field that was basically like the the measurement time it's kind of like it zero length instant instantaneous event so you picked the single field with date time mode pick our field and the little helper text here says in individual features from the layer will be rendered if that fields value falls within the Maps temporal range so if the time value from any of these little dots sits within that current slider definition interval then we'll see that particular dot so let's do that go back into our animation mode I'll hit this button here to recalculate that overall time range so it's picked up that the earliest earliest date in that field was 2010 the latest was 20 team in this case a one-hour step is not very useful so I'm going to make this a free week step and as I just scrub through this timeline here you can see that different events are turning on and off depending on what they're the value for that time field is if it sits within this current free worry quench so let's go back to the start here and I'm just going to quickly throw some data in the background here so that we're not looking at a white screen so I'm just gonna grab let's put this in some natural earth country layer and let's just make it a bit less ugly do something like this alright so now at least we've got some some reference in the background and I'll also make these a bit less likely because ok if I if I play this animation now let's see what happens yeah it's pretty useless okay so let's start off by pulling this frame rate down a bit so we don't want it to go through our animation quite as fast so I'm going to pull it down to say ten frames a second starts stepping for a little bit slower now I could also change maybe my time slice interval to one week and that's also obviously going to slow down the overall progression from just dining our animation to the end because we're stepping through it's smaller jumps and we can see there the events switching on and off there over time if I stop that I can again scrub this to get particular slices of time honestly I see like quite a lot of animations that look like this where someone will load in the temporal data and just you know export that and you get a lot of dots kind of moving really quick on a map that doesn't really show you anything it's moving so quickly for a start that it's it's really hard to actually pick out patterns in this data and it's it's hard for the brain to kind of comprehend that it just looks like movement everywhere it's just just overload but there's a lot of tricks we can use that it'll help ticks that and it'll improve the look of this animation but before I get to those I just like to cover what this button up here does so these little controls on the top left of our temporal control the dock they dictate the overall time handling for this for this view so when you first load it up and you hit the time button it will be on this mode which is temporal navigation disabled and you can see when I do that I get all my events so now it's no longer applying this filter here it's still set up so that I can quickly jump back to it but when I've got this on it's saying that this map view here it's everything it's just that then whole layer is if it wasn't time away the one I've been looking at up till now is the last one here which is the animated mode which gives us these controls and you're stepping through it in a certain fixed time interval so we're jumping through one week by one week per frame but the middle one here is the fixed range temporal navigation so this one is really handy when you have a particular time range like an exact start and end time that you want to visualize on that map so when I'm doing this mode here like I said it's jumping through one week by one week and if I had a particular time that I want to see like if I wanted just to see the events that happen between the start of May and the end of May it's almost impossible to do I could I could drag this around until I get too close to that but now you know that's not that's not a month long if I change this to save 30 days I'm gonna have to try and find a start it's really hard to get a precise slice of time visualized in in this in this mode and that's what the fixed time range mode is for so if I go here this just gives me two controls which give me the earliest time and the latest time I want of you on that map so I could say here nice and quickly give me all the events that happened in May May 2015 to the end of May something like that so the end of May 2015 so now we've got an exact time range that we've defined there and that's the only events we'll see other ones that's it exactly within that time range so this is good if you yeah you have a particular range that you want to see one nice thing is that if I bring up a print layout here and from a map onto this print layout I actually get this control now for my print layout map as well so I could put a little map in my my layout by default again that's not filtering by time but I could turn on the temporal range mode and say hey this one here this one here should be showing me everything in let's do let's do the whole of 2015 okay said so now this map in my print layout is showing me all the events that happen from start of 2015 to the end of 2015 and I can actually put a fixed range for my layout there so this is cool because now I could say put another one here change this time range to 2016 so we've got one view for the 2015 events one view for the 2016 events and I could set up like a a small multiples type layout where I see a bunch of different time ranges here and get like a kind of a static layout which shows me a change over time 2018 did I do that right yeah any one of them like so and so I could make a a really cool layout here put some labels in here saying 2017 totally misleading because I think that was 2015 was now say 2015 16 17 and 2018 and we've got a nice well nearly nice small multiples layer so I could export that as a single page PDF or if I wanted to kick it up a notch let's get rid of that I actually could have the option here next to these start and end times you can click on this and you can actually make that data define so I could take that from like a field in an analyst layer so make a print Palace which instead of being said of moving around in a different spatial extents over time it actually moves through different time ranges so it could show me a page for January February March April and just throw it all out as a as an Atlas so that's a cool feature as well all right let's go back to here so that's our filter modes so we've got they're off turn off the time filtering show me everything a fixed range where I can put it in precisely and then the animation control that we looked at before I've got I've got a little visitor here hey Cece this is my daughter Cece it's 5:00 a.m. here so kids just waking up alright okay yeah that was a shame um when I'm in my animation mode and I've got my my animated map here showing me those those events changing over time there's a button here next to all these controls for exporting so if I hit that one this one actually gives me the option to save out those animation frames to PNG files or JPEG files or whatever you want and it will give it'll fill in the frame number into this little hash hash kind of template so I could say frame - put it in a an output folder and hit save and it will dump out each of those frames one by one so you have like frame 0 0 0 0 0 1 etc which you could then use with an external program or a tool like ffmpeg or what is command-line tools to turn into a video type animation um and I should have got one here cuz Richard sent me one overnight so let me show you the one that he did using this he beat the workshop by a day so here's use this to set up a vector animation save it out frame by frame and then using a I think it was ffmpeg tool to actually turn this into an mp4 animation so you've got the the capability to create a video file from from these maps that you could then upload to YouTube or whatever um it's kind of nice here because you get you get defined control over the exactly output width and height so I could say this should be whatever it is 1800 by 1200 locked that ratio and then I'll draw of the actual extent that I want to output there um and you've got that overall time choice again there so you can set it up exactly how you want it in terms of the output size and the extent and such right let's get to some really fun stuff near um where my ass okay so like I mentioned before when I'm going through this particular animation the events are turning on and off really quickly they're basically showing for one frame and then switching off so it's they're showing for one frame because in this case we had that we're using the mode where how events are defined there's like a single time instant so it's like a zero length zero second long interval that basically occurs at this time and that's it if I was using one of the other time modes like a separate field for a start and end time then our events might actually happen over a few different frames so if they say you might have a year long event that happens so they'll it'll show for a longer period on this map and that would help get rid of that flickery kind of turning on and off effect ah but what we're gonna do with this particular data set is I'm gonna try and avoid this this flashy turn on/off effect by fudging the data a little bit so I'm going to say in my temporal settings I'll leave it at this single field of date and time so my events happening at that the value is from the time field but I'm actually going to make it have a duration so instead of being like a zero length time interval let's put we're gonna make these go for I said turn on for three weeks so my events go for three weeks let's change this a little bit okay so now when I'm paging through my events aren't turning on and off during that sort of single frame where they intersect that time because now my events actually go for three weeks so they're going to show four well twenty-one frames so as I play let me speed this up because that's going to slow 30 frames a second so now we've helped reduce that effect of things turning it off too quickly so instead of them just being turning on turn off turn on turn off they're staying for a little bit longer which gives you your brain a little bit more time to sort of process that event and see oh there's a cluster that happened here there's something happen up here and then they'll disappear over time but instead of just being like a flash you actually can see get a bit more of a feel for that the pattern of that data um so that's cool but let's let's make it a bit cooler because what we can do here is we can start to take advantage of cue just symbologies data to find options to to control the appearance of these dots over time if you're not familiar of data defined controller see these little widgets that sit to the right of a lot of settings in huges and in this case I'm going to data define the size of these events so I'm going to click here and I'm going to use the assistant mode so what this does usually you use the assistant mode to say scale these dots by a fixed quantity so I could scale them by the magnitude for instance and now we get a map that show actually showing me the magnitude of these events as the size of those dots they're turning off and on over time so that's what this assistant is usually used for but in my animation I'm going to change the way we use this instead of using this size as a fixed quantity so is it from an attribute in there I'm gonna actually set up a little expression here that looks a bit like this so first off I'm going to look under my variables panel my variables group sorry I'm gonna kind of my fields group and I'm going to get the time from my event so that's that the actual time that that observation was taken and from that I'm gonna subtract a variable and the variable I'm going to take away is this one that's called map start time so the help over here says this variable stores the start of the maps temporal time range so if I do that my expression is now the time value taking away the start time so it's basically the difference in time between when that map that frame started and when the event actually occurred and you can see in the little preview here it's giving me a value as a as an interval so I'm just gonna wrap that in let's wrap it in the function de which gets the day length ahead of that interval so now we've got a numeric value that comes out of that and I'll just hit OK we need to define here as well the expected value range so in this case we expect this to go from zero to 21 days actually I've got this around their own way so let me just fix this all right so I'm missing something here what am I missing I have this 21 weeks should be 21 days okay so now what we're getting is let's stop the animation and find a point in time so when my event first occurs say there this little expression that I set up in my assistant the number of days between the start of that map time frame so this one and the actual event time that should be 0 and it should keep counting up so it goes 0 days as I step through that annex frame that'll be 1/2 three four five six seven eight nine ten all the way up to 21 at which case my event I've said pegs 21 days so it'll fall off the map it will disappear so this value is increasing from 0 to 21 as we step through our animation now and that's changing the size of that dot so it's getting bigger over time this is actually the opposite of what we want because we want our events to basically like pulse so what I'm to start big and just like fade out over time so I'm gonna use this option here to apply a transform curve and let's tweak this a little bit so I want my events to start big and then over time sort of gradually fade off so let's just mess around of this a little bit this transform curve is dictating how the these values that come in so from a value from 0 over here or basically map across to a size of 10 and as we go a value of 21 or map across to a size of I want 0 so it'll start off big like you can see and quickly fades out or quickly drops in size and slowly gets to 0 so it comes in and then fades out over time so it means that we see there the events that actually happened at that slice in time a nice and big because they're the ones that just happened like this and then as we as they get older they disappear off our map so now I've my player you can see we start to get a better feel for these clusters and it's definitely taken away that that really flashy field at our initial map had um we could make this even better actually because instead of just starting at a size of 10 let's make them pop in and then fade out so I'm going to tweak this little slider these little just a little bit so I want this to look something like this so they're gonna come in really quick my dots bouncing quickly so they're starting at size of zero they've they bounced in and then they fade off so really fast attack slow decay let's jump back here cuz we will if we make them a little bit transparent we'll get a better feel for this as well this one off and I'm just gonna speed this up a little bit to make it faster the view that's a bit too much drop that back down so now we've got an animation where those those events are kind of pulsing in bouncing in and then they fade out the bounce in they fade out and it's really cool because I can go into this assistant and I can tweak this or interactively while my animations playing so I could see or what would happen if I set up something crazy like this and and now my events are kind of bouncing in there taking a while to come in and they're taking just as long to fade back out again and I could just mess around with this until I'm really happy with how this looks and the actual appearance of how these go I kind of like something like this maybe maybe a bit faster like that to there they're bouncing in Zeitung out bouncing in fading out right so that's how I'm so now we've got our now we're seeing those events the the one disadvantage of this though is all our all our dots basically showing at the same size there regardless of the magnitude of that event I actually might want to tweak this a little bit and maybe I'm going to take my magnitude field and multiply that in there and I know that my magnitude went up to about 6 so our expected values have to be about 126 so now what we will have is the overall size of the dot that's bouncing in and out will be scaled by that magnitude value as well so the bigger events will show as bigger dots but they'll all still fade in it sizing it out pulsing it out over time so now it's looking pretty sweet I could still think that's a little bit too slow so it's going to tweak this a bit yeah anyway I could be noticed tweaking it but definitely much improved over our first version now our cool thing is we can actually use these data to find options to change other parts of this map as well so one common request and actually I should say before I go any further if your views took you just up to version 3 point 14 there's a really cool plugin called time manager which is offered a lot of this functionality going right back to the sort of queue just two days and a lot of this new inbuilt functionality was based off the time manager plugin so time manager still has functionality that the native time handling doesn't have but the plan is basically to to mesh the two so that they'll be just one one framework that does everything and one of the things that time manager does that the inbuilt one doesn't do yet is an option to show the current time on your map so when you're exporting those frames you could see that time change in that X book I'm gonna do this in slightly different ways and the way I'm going to do this is first off I'm going to add a new layer to my map with just a single point in here so I'm gonna just fudge it by doing a temporary layer a point temporary layer and I'll put one dot on my map inside this temporary life this little dot here I'm gonna go into there turn on the labels for that and I want to show for my the label for that little dot and take it from a variable and the variable will be the start time of that of that animation frame so the map start time this is a again it's a date/time value so I'm just going to put a wrap this up in format date format it is a day so there we go so now my previews giving me a string value and I can see this little dot here now has a label that is the start date of the map or make it bigger just so we can see it right and if I play my animation it's not really looking how I expect because I want this to change over time the reason that's not changing is because when I'm stepping for this animation frame by frame QGIS is being smart about which layers it's actually redrawing here so it's basically looking through and it's only updating the layers that have got this little temporal icon so it says well my my country boundaries they're not changing I don't need to redraw that I'll save some processing time and speed up the animation by just leaving them in this case it's doing it for my my point label time one as well which is not what I want I actually wanted to redraw this so I'm going to go into my label properties for this one my layer properties turn on the temporal mode and in this case I'm gonna go to this special option that is the redraw layer only configuration so this one here it says the layer will automatically be redrawn whenever the temporal range has changed so whenever we go to the next frame but no time based filtering is applied and a bit more Texas the configurations useful when the layer has symbology settings which vary based on the temporal range exactly this case so let's turn that mode on and as we play now we're getting our labels are being redrew and same thing as well so and we could see we've now got a nice display here of the current time in my animation I probably go here change that to no symbols to get rid of little dot and I could go in and I could set up make this look nicer by whatever putting on you know text buffers and any kind of labeling stuff you feel like in here I would not do that drop shadow or something to make it stand out a bit more so we've got now a nice little time readout um I can actually take this a little bit further let's do something a bit more involved I'm gonna make another point layer a little temporary one throw a dot in here this one and I said it also to our redraw only mode I'm gonna turn this little dot into a time like a progress bar that fills up over the animation time so to do that I'm going to go into my dots symbology and change it from a simple marker to an ellipse marker which is oddly named because in this case I actually don't want to in lips I want a a rectangle shape like this and in this case I'm gonna get I want to data define the symbol width so what this little rectangle to grow over time so I'm gonna go into my assistant here again into the expression builder and in this case I need to set up an expression that will scale from 0 to 1 as my animation advances so it's going to look like this I'm gonna get the variable which is my map start time yeah and I'm gonna take away yeah that's right I'm gonna take away the one that's called animation start time which is the over all-time range of the animation to the very earliest like the time from the first frame again that gives me an interval values so I'm just going to pull the seconds of those out to get a numeric value and I'm going to divide that by the animation interval which is that the length of my entire time range so that will give me a value from 0 to 1 and as the animation progresses it will go from 0 at the very start closer we get towards the animation or get to a value of 1 so let's put that's that range in here so our values are going from 0 to 1 and our output values should be going from well this looks fine let's say 1 to 100 maybe and here's we've got a little progress bar now it's not really progress by yet we've got a little bar that's growing over time let's make it move a little bit faster all right so it's it's growing over time it's not quite what I want because I don't want to be like that so I'll change there the anchor from horizontal to left so now it's growing but it's growing from the left side and we'll just do some other little things here like I'll make this a bit higher I'm going to duplicate that turn off that make this 200 that's too much let's do 100 again 2200 fix that back up again and my background one can be like a kind of gray color so now we've got a [Music] symbol which is a progress bar that basically fills up as my animation progresses and slide back yeah we can see see how that works um a really nice fingers there's nothing in this symbol that has got hard-coded values so it's all being done by the expression that is using variables to take the map start time and the animation start time the animation interval so if I messed around with these values say refining my animation so it only shows 2012 I don't have to change anything in that simple definition it's it's basically adapted immediately so I could save that one to my style library so we give it a tag of animation and this is the progress bar symbol um I could share that with someone else or I could reuse that at a later stage without having to do any kind of tweaks of it um right I've used up my I've used up my hour that I said I was gonna allocate but I'm gonna give one one little bonus thing that I was playing with just before we started this which i think is kind of cool so if you can give me an extra five minutes I'll show you this too um I was setting up this animation just before going live with this demo and I thought let's try something a bit adding on something else on top of this and what I'm gonna do is I try and use the animation framework here to give me some animated water lines that that come out of the edge of our maps so let's see if I can do this what I do first off is I'm just going to duplicate this land layer so duplicate that I'm gonna call this one water and in this case again I'm gonna say it's a temporal layer but it's just a redraw only way out okay now for my my water line test I'm gonna make this layer it's just a simple line outline with a nice blue color and what I want to do is I want to get this offset control that I can manually set but I want this to be dynamic so I want it to grow so sort of like yes and flow out from the coast so what I could do here is I'm gonna go back in and tweak this put an expression in for my offset for the the line um what I'm gonna do for this one is I'm gonna use a different variable that we haven't used before which is the map where the frame number variable so the frame number gives me the current frame number during animation playback so I want to take my frame number I'm gonna do a like a remainder calculation here so this this value for my offset will vary between 0 and 30 as the animation progresses but it should loop so let's just see think I might need to scale it scale at 5.10 I know what's happening go their own way reverse that all right so now we're getting some some kind of crazy stuff going but we have a little we have this offset is now going from every 30 frames it's repeating and it's growing out from our coast this might be the wrong way probably actually should be going into the coast but yeah whatever it's also way too fast so let me just tweak this a little bit let's change this that could be say ninety and three alright that's that's a bit smoother the other thing I want to do is I want these to fade out because that that needs to disappear over time so let me get that bit of the expression and I'm gonna use something called set color part from the original color change the opacity so that the pasady is going to vary from see how that works yeah so now they're now they're basically fading out as they get further and further out so I could set up all these kind of rules in my project to animate other parts as well so I've got my um I've got my actual temporal events that F quakes are showing and they're doing that nice bounce effect that we set up earlier we've got our progress bar here and now I've got other little bits that are just adding some more motion in that map as well so then I'd save it out to a PNG turn it into a video and I'm done I've got my awesome you just 3.14 animated project um and that's the end of today's session so thanks for thanks for tuning in my my name is Niall Dawson where did my slide go that I was going to show at the end it's disappeared let me bring that out here we go if you're interested you know subscribe to this YouTube channel I guess I'd love to do more like this if you think they're valuable follow on Twitter and so go ahead that's my personal Twitter and also North Road geo won't post a lot of tips like this as well and the North Road blog as well has lots of tips like this that will help you know what's coming in qgis new versions and getting the most out of them um but if you did yet if you like this video please let me know because if it's valuable if you want to see more like this if this particular topics you want to see comment on this or on Twitter and let me know but thanks for tuning in Cheers
Info
Channel: Nyall Dawson
Views: 16,840
Rating: 4.9795399 out of 5
Keywords:
Id: vgDg5cRwPRw
Channel Id: undefined
Length: 68min 45sec (4125 seconds)
Published: Sat May 16 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.