 Hello, welcome back to my YouTube channel. In today's video I'm going to show how to create an animation of a Meteor shower. Here we are looking at a Meteor map made by Tamoyan Daikuma and it's based on data from CAMHS. CAMHS is an automated video surveillance of the night sky with many people around the world participating and creating these nice data sets. Now we're looking at a normal day, but let's switch to a date where we see many more meteors because there is a Meteor shower from the Perseids. I choose 12 August 2021 and you see here that there are many meteorites that night and the map is shown in the ground track. There's a nice blog on Meteor news about this website. So have a look if you want to know more about this data on the ground tracks of meteors. So when we scroll down on the page we can find the table for this data set that we are looking at and we see that it has several attributes like the start of the observation, the longitude and latitude of the beginning of the observation, the height of the beginning, the longitude and latitude of the end of the observation and the height at the end. We can download this data as a CSV file, let's do that. We can import a CSV file in QGIS, use add layer, add the limited text and then open the CSV file and it's comma separated, it's automatically recognized, when we look at the sample that looks good. Make sure you choose that it has point coordinates and use the beginning coordinates and choose the correct projection which in this case is EPSG4326, so it's in geographic coordinate system. Let's add some reference data so we know where we are, I will use the quick map services plugin and I choose from CartotDB, one of those dark matters, let's choose the one without labels and there we see where we are. But let's also change the projection of this project, our focus here is the Netherlands so I use the Dutch projection and now we have the project in the correct projection. Let's see if the attribute table looks still okay. Yes, that's all that we need so let's change these points now into lines with the starting coordinate and the end coordinates that are in the attribute table. So I go to the layer styling panel, click on simple marker and I change this now to geometry generator and we can now generate a line, so we indicate here that the geometry type is line string or multi line string, then I'm going to edit this expression here and if you search for the make functions then you see there are different types and we can make a line. So we use the make line function and it basically needs coordinates on the line. Our first coordinate is the geometry itself, the point. When we import it we use the beginning coordinate, then the second coordinate of the line we need to use make point and we use there the coordinates from two fields in the attribute table that is the long end, the longitude of the end and the lot end. Close it with brackets and there we see in the preview geometry line string, so that's indeed what we want. Click OK and now you see the lines there because of the background they're not very visible but here is. Next step is to style these lines with the interpolated line renderer. So you go to a simple line and we change the symbol layer type to interpolated line and we're going to vary the width and we are going to use varying color and then it's a matter of playing with the numbers to have the correct scaling of the width and the color as you like to see. Now it looks close to what we want. I'm using a ferridis color ramp here, it can change this to any that makes sense. Ferridis is nice because it goes from blue to yellow and it will look nice on the background. I think this looks nice. Now let's have a look at how to animate this. I go to the layer properties of meteors and there under the temporal tab I switch on the dynamic temporal control and it will find the field that contains these start date and times, the observations. So now we recognize the little clock next to the layer name and we can change the temporal controller settings and we see there are the correct dates and we see the animation but the steps go in hours so I switch it to minutes and this looks already close to what we want. If you click the gear you can change the frame rate to control the speed. Now it would be really nice to have also a counter for the date and the time so I'm going to create a temporary scratch layer, of course you can make a permanent layer to do this. I call it time, give the geometry type point, keep the projection as it is and I'm going to add a point where I want the label and then I go to the label settings and I choose single labels and I go to the expression dialog and I want some text meteors as a stream then I use the concatenate button and add a new line, you can see it in the preview below and then I need a variable to add a time and that's the map start time variable. If I double click it's added but we still need to format it so we will have the date extracted from it and we use there the format date function and in the help text on the right you can see how to format it and we need to put it in a stream so that's the date number then the full month name and then the year, let's do bracket and there you see in the preview 12 August 2021 I concatenate and a new line and there I copy the part that I already had because I'm going to add the time so I want them in 24 hours in notation so use capital H and then the minutes I will leave out the seconds if you want them you can add them as SS and just some units here otherwise people wonder what the number is and let's style the label to make it visible let's choose another font in this case maybe consolas is nice and they use white change the placement settings it's centered and makes it a little bigger and then I'm going to remove the marker so no symbol and then we only have the label save the layer and now we need to add the timestamp so I switch on dynamic temporal control and I use here redraw layer only and let's see what happens and now we see the meteors animated and the time is running minutes are increasing so this is exactly what we want now it's always good to give credits to the data that you use and at the bottom of the screen you see already some text so I use this decorator and I remove what was automatically added and make sure that everything is there and you can change the font color to white so it will be showing nicely on this black background map and now I can export the animation and save to the folder precedes and keep the defaults to use the map frame and you can still change the range of the temporal settings there and it will save them for every frame a PNG file in that folder so after exporting I'm going to use gimp to create the animated gifs I open the image as layers and I choose all the layers all the PNG files that we created and it takes a while so now all the map frames are in PNG format as a layer in gimp and we can go now to filters animation and choose then the option to optimize for gif that normally takes a long time here I've sped it up a bit now we can export this as a gif and you simply need to give a file name with the extension give and then it will understand what you want to create of course we need to choose that it's an animation and you can play with a delay between the frames to change the speed of the give I keep the default here and let's have a look here we see our animation so in this video you've learned how to create an animation of the ground tracks of meteors from a CSV file and to use styling from the interpolated line renderer and the temporal controller to animate this through time I hope you've enjoyed this video if you like these videos please subscribe to the YouTube channel and looking forward to see you again