Introduction to spatial and spatiotemporal data in R
Hengl, Tomislav
The first 30 minutes are dedicated to Software/libraries preparations and user support; Software requirements: Python, Jupyter, QGIS, GRASS GIS, R This tutorial starts with the explanation of general concepts and main advantages of docker containers, answering questions such as: What is Docker image and where to find it? Starting with the docker image opengeohub/py-geo.g? The first 30 minutes are dedicated to Software/libraries preparations and user support; Software requirements: Python, Jupyter, QGIS, GRASS GIS, R This tutorial starts with the explanation of general concepts and main advantages of docker containers, answering questions such as: What is Docker image and where to find it? Starting with the docker image opengeohub/py-geo.g? Which tag/version should I use? The session also shows how to install new OS and python packages inside the container, how to share files between the host machine and the container, OSGeo live ready to use in the VirtualBox.
 From the program, we are using this virtual box, so I'll be using this virtual box. Don't get confused. I can switch, in my Windows 10 system, I can switch to Ubuntu, so I just press the button and now I'm on Ubuntu. If I do Ctrl-F, then it looks like I'm on Ubuntu computer, but it's running on my local machine. It's really magical. We will be doing this virtual box. Why we do virtual box? Because we want that you can all access exactly the same and we don't lose any time on installing downloading, setting up. Also have in mind that these slides you can make available offline. If I shared all the slides, you can find them in the Metamoss channel. I shared all the slides and you can access the slides. If you want to save bandwidth, then just go and make them available offline. That will be something like here. These ones we are starting. I will just go File, make available offline. This way you save bandwidth. If you don't make it, then switching between the slides can cause bandwidth conjuction. That's why you should try to do it, save things offline. I can start with this first block. The block is one and a half hour. We will leave every block. We will leave about 15 minutes, which we will stop doing YouTube broadcast and then we focus more on your questions. In the meantime, we will answer questions from people that are online. We will have every day, I think we will have maybe 50 to 100 people following online depending on the block. Some people in different times also probably the way to connect later on. Let me start the presentation here. I can just use like this, I think. We have today and tomorrow, I will be the teacher. I will have some help from Carmela. He is not with us now, but Carmela will help with the special temporal ensemble machine learning, especially because he is working with the real data. That's the one in the afternoon. Then also we will do one more technical session working with cloud alternatives. Something maybe new to many of you. We will do quite the gentle steps. We will guide you step by step how you use the cloud alternative and again, especially with the intent to show you how to do it in R. The guys upstairs, they will do practically similar sessions, but more focus on Python. Python and R, of course, are not one-to-one. There's many functionality that is really different in Python and from R. There's many packages that exist only in R. There's many packages that in functionality exist only in Python. Some things computationally, it's more suited for Python. Some things for plotting and statistics is more suited for R. When people ask, okay, which one should I learn? Usual question, my answer is both. It's very simple. You can, we can maybe show that, but in R studio, today you have also functionality to connect to, so if I go to R studio, there is a functionality also to connect to reticulate to connect to the using, so here if I go under, let me see, send the tools, I think, so you can connect to the, we reticulate to Python and then you can do Python programming also. So that's about Python and R going back. So this morning, first block, it's a, let's say, gentle introduction to spatial temporal data, specific to the data. Some things maybe aware of, some things maybe here for the first time. I'm hoping most of things you will hear in this block for the first time. And then after that, after the break, we'll do some modeling exercises and then slowly I will start jumping from R to Python, sorry, from R to slides. So you can see me actually doing programming and working with real data. And then this morning, basically it's a kind of warm up for the real session, which is the spatial temporal ensemble machine learning. So and that's something I think possibly new for you. And this is going to be really hands on. But then we just explain you how it's done. And some people tell me, you know, you think like it's simple, but actually this ensemble machine, if you do it for the first time, it's, there's a lot of components and it's really highly complex. So it requires like really, I think gentle introduction and that you feel the data and the code. Everything I will do, it's basically in this notebook. So there's this notebook. So it's here. And you see this notebook is under our training. And I did share it with you over the last week. I don't know if you managed to look at it, but this one, it has all the, it has all the examples and even has text. So you can really follow it. It's really like a computational notebook. So you can really follow it. And at the beginning, there's a bit of introduction, but then very quickly you have, you have functions and you run the functions. And then you can, let's say you can test your own thing. So we will be moving through this tutorial just here in our studio. And we will be looking at different things. And so you see, I can move to some section. I can run a function, I source the function and then I can, I got some warning message. I don't know, but I can compute something and they get the number. So that's this computational notebook. And that's what the guys use in Python upstairs, this Jupyter, whatever. So it's basically looks the same. And we can scroll through the different sections. And then we will test things. And then you can, you can modify that code, by the way. The art studio, you can modify it. You can play with it. It's no problem. If you do something wrong, there is a shortcut. Let me see. So you can do git stash and this will remove all the changes. So it's very, very nice to know the git command. So I can just do git stash. If I go here, sorry. Let's see. So if I do this, I have to get to the folder though first. So that's somewhere under, let me see where am I? I need to remind myself. So that's under the home odsc work directory. Then odsc work directory and then code and then odsc workshop. So I first change here and then I can do this git stash. And this git stash will basically remove all the changes. It will leave all the new files you make. But if you mess up something, I don't know what they did. And then you just do git stash and that will reward it into the original. Okay. So you see I have this cheat sheet. I can share this with you, but more or less it's just a basic survival. If something happens, we have to restart the docker. So that's also survival. But I can share that with you. So that's the plan for the, plan for these days is we use this tutorial and then we will go step by step through different steps. And then you can ask questions and we can slow down and we can zoom in into things. Also, I shared, as I said, I shared the slides with you. So you don't have to write anything down. You don't have to make screenshots. Remember, this is also video recorded. Everything I say I do the code. You can follow after the course. So you can really be relaxed and just really focus on the course and ask questions to see if you can reproduce something on your laptop. Why we like that people use laptops? Well, it's less containers for us and obviously you can use different operating systems. But also we wanted to learn how to use software. So as soon as you go back to your office and to your work that you can continue using the software. Also, why we wanted to use laptops is you can interact with us. You can ask questions and the metermost is very important because you can do a screenshot if you have a problem. I say I have a bug or something happening. You can send a screenshot and then we can try to help you. And as you can see, there were many people asking questions about the virtual box and there was screenshots people send. I have this problem. I have this problem. So people were sending. So we were debugging already and helping people. And I hope now you all have that virtual box running. By the way, I'm also new to virtual box. I didn't use it before. You would just connect to my workstation at the office using a no machine or team viewer. But now Landro convince me it is the best way. It's very elegant and you just it's kind of that's why it's called box. So you have everything out of box. You have all the software. Everything is customized. We all see the same and you can easily just turn it off and you can put it in standby. I don't know if you tested it. You put it in standby and and then when you start the machine, you get exactly the same thing where you left. So it's really magical. Okay, so that's the matter most anybody not connected or the art development group, please connect. If you don't see the art development group, you have to go to this plus sign and you say you have to say bros channels and then then pick up the channels you want to see. If you are if you're a physical participant, if you have questions about logistics here in the week, then you should ask it in this group. Don't mix it if it's a general question about methods problems with code. Then you ask in the town square or you ask in our dev. But if you have a question specifically, I have to with Wi-Fi. I have the then you ask it here. So that's and it's a very important to use matter most because it's a it gives a track of everything and you can open lots of discussion groups and each everything you post basically becomes a little discussion group. And if you reply on something as you see here, when you reply, you can see all the the thread. So that's also nice about the matter most now that you can go back to the same issue raised and then you can respond there. And usually if we responded to something that you ask, we will not respond back, but we are going to just send you the link and you can link to any thread or any post in a matter most. It's a it's kind of like in Github and so so you can link any to any post and this way this way we can debug but we cannot if we debug a problem once we don't want to debug it two times. I hope you understand that because that's a waste of time. Okay, everybody looks very serious. There's no exam by the way this course so you can relax. This is a and it's also special times. This is Corona pandemic times and we are really doing our best and improvising. We had to teach ourselves how to do parallel broadcast and you know how to use all the zoom functionality we haven't used it before. And also there were many cancellations by the way for physical attendance. 25 people cancelled so really high cancellation rate. But we had the last year exactly here at week we had a summer school and there were more people almost two times more people last year when there was no vaccinations and more chaos. And now that you would think okay there's vaccinations but the delta unfortunately arrived and that made it a bit complicated. But nevertheless we'll keep it in we'll keep everybody safe of course and so we will do our best to follow the Corona rules of course and and we think it's going to be successful event. Nevertheless, when you if you're new to R it's not I don't I cannot promise you you're going to leave this place and you say I went to this training course two days and I learned I'm some ensemble machine learning and R never used R before that will be very difficult. This is quite advanced topic. So you know there are ways to teach somebody in one day things with the right motivation. But I mean imagine this person here you know trying to satisfy Kim you and if he fails something of course it's not a good probably for him. But there's very difficult to teach something very advanced in one day. So what I recommend is that you kind of if you are new to many things open your mind and just make sure you you know take the copies of the slides and remember there's going to be a video published also so you can go back to some of the discussion points and you can see me coding and you can you can teach yourself after the course you can go back and try to learn things. The reason why we are here of course is because we have we have a European funded project which is called actual products called geoharmonizer. But that's a two technical names so we renamed it to open data science EU. And so that's the reason why we have this because we had some budget to organize this type of workshops and to do core development sessions. So this falls under the one of the core development sessions because we also expect to get feedback from you. But so this is our project and you can read on the bottom you see that it's been funded. It used to be called in there innovation networking agency. Now it's called there but you can read about this project here under the link and it's mentioned on the bottom of the page. I can see that some people now connected from US which is really crazy because I think it was probably like 4am or something. But they see lots of people connected now following around Europe and there's some people following looks like from India. So you can read more about the project and we pull posts here if you have the news then we post some articles how we did processing and but they're very short. So we are hoping we're writing our articles to explain how we did the process. So that's thanks to this. And as you see in that project we made this data portal which is under maps open data science. So if I actually here I can go. So under the maps open open data science.eu we made this what we call a European environmental data cube. And this is the data cube here. So we made this data portal and and as you see we are here in the lens and we can zoom in. So let's say we are now here. And so what we did that we created this land cover predictions using ensemble machine learning. So the things we're teaching you this is what we did but we did it with the 7 million points and with about 400 covariates or the regression classification matrix is only on the classification matrix about 3 gigabytes and so we computed all these things and we we also put we can show you we put the points here. And so we trained with 7 million points and we made the predictions and you can go and scroll through time and you can see how the land cover changes. And what you can see here is that this for example, Fenendal like this area you can see that there's a growth. So this all these places are new. And we did the proper I think the land cover mapping because we mapped every class. So if you if you look at urban we we mapped every class is a probability. So you can see also probability of each class mapped. And so if I click somewhere here, I will get it will do a query on the geotifs and it will get the values of that probability changing through time. So we can see in which time they started building our estimate. Yes. And also when I say we do things properly, we also put the uncertainty. So if I if I turn this off, we put also the uncertainty and you can see uncertainty per pixel. We estimate which of the pixels if it's a brighter yellow, it means there's a high uncertainty and it will pop up some places you will see a high uncertainty. And it means that you should be careful using that data. So I think it's a let's say a proper framework to do land cover mapping and we are proud that we did it using ensemble machine learning. In this case, this this predictions and the modeling was done in Python actually. But we also have the vegetation map that Carmelo and me went to show this was all done in R. So once you choose our Python, it's not easy to mix, but some projects we chose to use our or some projects we chose to use Python. So yeah, that's this project. And that's what we're going to talk about. And we're very excited that Carmelo, who is PhD student at Open Geohub and working in university, he's going to show you in the afternoon, really, with a really large data set, we're going to show you how we compute space time distribution of forestry species. And we will show you that it really matches the ground data. We also have about one million points, I think training points. So we are very excited to show you that results. This is also first time we're showing to public this results. Okay, space time data. So I personally work a lot with the spatial data, and I did a lot of predictive mapping projects. And I even produce some global data sets, European data sets, Africa, United States, we didn't want some awards for some publications on doing predictive mapping. But I also got interested over the year 2012, I knew that it will be very interesting to do space time, and then I published my first paper, I think on space time in 2012, space time prediction. And so we will use that paper. It's one of the case studies is the mapping the daily temperatures. And then later on somewhere in 2018, 2019, I wanted to switch from doing spatial to space time. And this project is a proof of concept that you could do all the mapping projects you can switch to space time as long as you have enough data. So when you look at the land cover mapping, we don't map a land cover of year 2020, we map a land cover of last 20 years, or maybe we can map 30 years. But so we switch from doing a spatial modeling to space time. But when you look at the space time data, it's not just like if you have a space, you have a 2D, when you look at the space time data, it's not that you just got the third dimension, so you got 2D, 3D, but you have a 2D plus time. And it's a special dimension. And so what's special about it? Well, number one is, for example, in a spatial dimension, XY dimension, if you look at left and right, then the left can impact the right and right can impact left. Yeah, it can be connected. There can be a, let's say, the diffusion movement in the space. But when you look at the time, the future cannot impact past, right? So you have the causality, it's only one direction. Then also with the time data, I will show you there's a whole field, there's a whole field of statistics, which is called time series analysis, which looks at the behavior of variables through time. And it's a way more complex, there's just changes of variables through space. So we are going to talk about that. Time dimension, it's easy to plot, remember that, but it's difficult to model, basically. And then what is especially very difficult is to predict the future. And that's what some people in time series analysis, when they blindly use the models, they say, okay, now I predict the future. But they predict the future can be very poor. And so it's very difficult, especially to predict the future. You can predict inside the observed space and time. So if we predict land cover for the last 20 years, then we can do lots of testing. But if I have to predict a land cover for 2022, you understand, it's going to be very difficult because you need something on the level of magic really to do it. But you could, for some variables, you get very close. So you can actually predict future also. If the variables are kind of like the train component, the systematic component, it's let's say you would screw them to be like dominant, then you can also predict some models you can extrapolate in the future. So we're going to talk a bit about time series analysis, visualization of data. And I will point you to many books and references. So you can maybe some things are new, maybe some things you know, but I will point you. Any data that has a so-called special temporal reference is a special temporal data. So obviously you need the coordinates. If you talk about geographical data, the coordinates are a lot to do. Then what is also very useful to know is the location accuracy. So that tells you about this x, y coordinates, whether they should, they relate to something, you know, which is plus minus 100 meter, 500 meter, I don't know. But also there is the size of the block you sample. You know, you could also do block sampling. And you have a, for example, for soils that do block sampling. So they say this is the value that relates to a volume of a soil. It doesn't relate to a point. And then you have the height above surface, the elevation, because this is elevation as of terrain. But you can also have, for example, temperature, the early temperature. Is it the surface temperature? Is it the two meter or is it the 100 meter? You know, so you can have a different vertical dimension. And that's this third dimension. And then we have the time. And time you represent actually with two columns. That's the beginning of the measurement and end of the measurement. I will show you that that's very important because time has also so-called temporal support. So some things we measure like the daily values, monthly values, value at the second. So it also, it's very important. And then you get the spatial temporal data. And once you know, once you know this coordinates of the data, once it's a spatial temporal reference, then you can import it and do spatial temporal modeling. So this is actually, whether it said time is just not a spatial dimension. And there are specific methods that develop for space-time data. And when I started in R, when I was using R, I think in 2013, I think then or 2012 already, Edzer and the colleagues, they made this space-time package and it was really a great solution because at that time there was only spatial data, SP. And then he says, okay, he looked at some problems in the data and then he made this space-time package. I don't know if you ever used it, but when you read some of the tutorial, then you actually becomes a bit complex because there's this full spatial stack and irregular data stack. So he made these classes of data. So it's a quite complex to understand. It's a bit abstract. But in principle, the most important is that you have correctly for data, you know, the space-time reference. And then if you have that, then you can import it in R, organize as a space-time class. And then we will show you with some data examples, you can plot the data, you can do a space-time overlay, you can do a space-time modeling. And this is this paper also from Edzer called Space-time. It's published in the Journal of Statistical Software. Have you used Space-time? Do you anybody use Space-time completely new? It's also magical when you think about this. So the space-time data imagine you can have a space-time time series of satellite images and you load them into R. And if you organize them as you say, this is the class space-time regular data frame of space-time full data stack. And then you prepare the point data and this can be irregular. And then you say over the points versus the space-time time series, and it will do a space-time overlay. And then you match the points with the cells in the space-time. And so that's really magical because you then do it in one line. The problem is when you work with the large data, you cannot load it in R. Your RAM is not going to handle it. The R is not so, let's say we are not so efficient with putting things in RAM. So then you have to maybe this space-time package wouldn't work. And I don't use it by the way because we work now exclusively with large data sets. So I will show you we're going to use the Terra extract, which will do then the space-time overlay. But my code, unfortunately, maybe not so easy because this space-time overlay, I will show you just very quickly how the code looks like. So it's a bit longer code. Don't get scared and it runs in parallel. So this is the space-time overlay for meteorological data. We have a time series of modus length surface temperatures, and we'll do a space-time overlay. And so I made this code. So it's not in a package yet, but I should put it in a package. And you see this code will run in parallel. So it runs in parallel. And I made a little function called extractsd, extract space-time. And this thing is a universal function. So this function, if you use this code with your data, it will, I promise, it's the fastest way you can overlay a large amount of points over large stacks of geotifs. And they don't even have to be stacked to exactly the same thing. They can be loose structures. So that's the space-time overlay. And then when you do after the overlay, you will get this so-called space-time regression matrix, and then you can do modeling. So I'm going to do this code today. I'm going to show you how it works. And we're going to go step by step. And then I will show you the data structure, what comes out. I will also show you when I do computing, how it goes into parallel. So we will look at it, observe it here when it goes to parallel, and so that you get the feeling that you understand what's behind. But again, I built up the thing that I showed you. I built it up on top of the package made by Robert Thomas, which is called Terra package. And this one allows, so that's this extract STUC. This is the function that allows to do very quick overlay. And it's actually magically fast. We overlay millions of points over like, I don't know, one terabyte of data, and it will take two minutes. So it's a magically fast. And this is mainly because the Terra is a program mainly in C++. It's another language that is something you should consider, but C++ is a different story. Okay, going back to the slides. So there is also a new book called Spatial Data Science. Have you heard of this book? And this is the URL. The URL is very critical, Keem Schwartz 3146c4. It's a very critical URL. Don't ask me, but Edzel is the main author. And they are writing it. You can subscribe to it and you will get the notifications every time they write a new thing and the things they discuss, you can follow it. So it's a live book. Basically they write the book and you can follow them. You can see all the mistakes they do and the fixes. So they write book in front of everyone. So it's a new age writing of science. I think it's the right way, by the way. It is a book down base. So you can see all the code, everything which you see in a code. And you see there's a chapter 13, a multivariate and spatial temporal data. I don't know how much they have, but they have, I think, only spatial temporal geostatistics. So if you go to this book, which will be cutting edge, you will not find anything basically that we are going to teach you. I don't know, very little. So everything we teach you, it's not in the book because we do the machine learning for space time. So I think we have a lot of original things for you. But maybe they will add it, I don't know, because as I said, it's open book. Maybe at one point they will say, okay, we add one chapter on space time machine learning for mapping. Okay, this is just to share the space time reference. If you use Google or any type of data in KML, keyhole markup language, then you can see how it looks like a space time reference. So you see here I have a name. This is a station, a station that we use in the first exercise. And we see that there's a measurement at some point and point has the coordinates and it has a begin and end time. And you see that's all this theoretical concept that tell you there are implemented in any software. So for me, actually, as I said, for me, now mainstream is to do space time modeling, space time analysis. And for me, any GIS where I cannot set up a space time, for me, it's a cumbersome. We cannot do our work. So we have to use only the GIS where we can do space time. And so one of the most popular GIS is the QGS. Does it support space time? Does it support space time? Do you know? Pablo, you don't think so? I don't know. There is a plugin. There is a plugin to go around it, but it's not. If you just start the QGS and you say here I have a time series, you know, you're not going to get a slider, right? That's one of the reasons why we develop original interface because you see all of our data, it has a slider. There's only a few data sets. There's no slider, but 95% of data is sliders. So as soon as you start the data, there is a slider, right? And so when you go to QGS, if I open some project, you know, you say, well, I have a, this is this temperature data. I want to slide through time. You won't get it, but there is a plugin. There's a plugin for time series data. And this is not going to animate changes. You have to play with the animation. But if you move around with the mouse, you will get the curves. You will see the curves of the values. And that's also amazing. Somebody made this plugin. What's the name of the plugin? Do you remember Camilo? No, another value for the time series. I have to also remind myself, but there is a plugin which allows to time series, time series explorer. There's a couple of plugins, but I have to actually remember which one is the one that Landro uses upstairs. Maybe please check with the Landro. So, but there is a plugin and you, there's more plugins, of course, as I said, but there is a planning plugin to put it and then you can see how the values change if you have a time series of values, how does it change through time? At the moment, if I want to see changes to try and I have to do this, I have to click on and off. That's the only way that's QGS. People that are experts in QGS, if they watch this video, they will say, no, no, no, you are doing it the wrong way, you should do like this, but officially, it's not easy to just go, hey, here's the space time data, I want to see changes. It's not easy QGS, but it's possible to set up. So, when you have a moving object, and if you may be following me now, I might sketch it on the screen there. So, when you have like something like a bird, right, bird is very complex, maybe car is better. When you say car, then the car moves to some streets, right, and goes somewhere here, goes from location A to B. But when you put it in, let's say somewhere mapped up, it's just a point moving. But you could also put it as a trajectory. So you put that line of movement, and you can put the trajectory in space time, so you can make a space time Q, something like this. So that's will be X, Y, and then this was the time, and time goes this way. So you should plot it, then you have something like trajectory moving up in time. Have you ever seen this? So I was doing that for two years when I was in Amsterdam, I was plotting this trajectory, it's a bird movement. And it's very funny because you can then in this space time Q, you can see that how this overlaps between species through time, which you wouldn't be able to see if you just have a 2D view. So you can see the density, you can rotate the cube and you can see the density where they overlap in the movement, right. And so this is also another way to look at it. And so now you have this, so you have objects, and objects have trajectories. And then you have also fields. And so what are the fields, regions? So I wrote here what could be the fields, regions, the next slide. Basically, it can be one of the three things. It can be a quantity or density of material. So it's not a physical entity. So that's like molecules, you know, quantitative molecules, let's say, you know, some element in soil. Or if you think about pH of soil, this is quantity of elements. And so these are all density. Then it can be energy flux, energy flux, because energy also moves like if you look at the heat, it moves through space, right. It's not a physical entity. It's a movement of energy. So you can also model that. And then this is where it gets a bit confusing. You can also do modeling probability for currents. And so this bird movement, I could also represent it with probability of occurrence, and then represent it as a region. Okay. But actually in the original sense, it's entities, physical entities, but I could also model them as regions. And when you look at this map, I showed you basically on the open data science viewer, this one, it's basically urban fabric. It's a physical entity, so most of land cover is physical entities, but we model that as a probability of occurrence. So if you say theoretically speaking, how could we model this? Well, we could model every house as a unique entity. You understand? If you want the total land cover, GIS, then I will model every tree, every house, everything which is a physical entity, I will model it as a physical entity. And this is maybe in about 10 years, this is how the land cover maps will look like. Because maybe 10 years in the Netherlands already they inventory all the trees, I think. Did you know that if you're not from Netherlands, they have a data set you can access. They map the whole country one to 1000 now, I think, and they mapped basically every tree. And the next thing they would chip every tree. Yes, so they know how the tree is doing, and there's already a concept called tree talker. Have you heard of it? So they put a chip on a tree and they follow the health of the tree every 10 minutes, you get the automated sensor network. And so that will be a land cover in the future, that you wouldn't map the probabilities, but you will take any object that you consider as a land cover, land use, and then you will take it through time. And so when you come to GS like this, maybe if I'm still working in maybe 15 years, we go here's the Netherlands and here are the homes that disappeared and the new homes built and that are the right, that's how the land cover maps will look like. So but this is just talking about concepts. First distinguish that there are models, space time models of objects, physical entities, and there's models of quantities and quantities can be densities or masses of volumes, or it can be energy fluxes or it can be a probability of occurrence. This is the space time cube. This data set you see here, this is this data set we're going to use here, which is this meteorological stations for creation, and you will see that when we make on the end, we will make predictions and predictions will look something like this. Now I have to actually show you that in the, because I don't have it computed, but I have to show you here. So we will make these predictions and they will look something like this. So you will see we will do space time interpolation of daily temperatures, and we will predict for every day, we will predict how the daily temperature changes. And you see these are the stations, and these are the predictions. So this is the same data set. This is this data set is shown in a space time cube. And here is shown on a 2D map. Yeah, it's not easy to match, right? You'd like, well, no, it's not the same, but they are meteorological stations and you have the measurements every day, their measurements. You see some stations, they are not, they are no measurements. So what happened here? How come there are no measurements? They had a day off on the meteorological service. No, so what we did when we first started working with this data, so I said, let's do space time. So we say meteorological data space time is high quality, is lots of data. So let's do meteorological data. And when we started working, if you look at it, they have something like 160 stations, and they may have measurements daily. Yes? So you have 365 days by 160 stations. That's a lot. When you load it in R, when I started doing, whoa, this is not going to work. It looks like it's only 160 points. But when you load all the space time data, and if you take, let's say, three years, you are suddenly loading millions of values. And that's the difference between space time and space. In space time, you get overloaded with the data very quickly. So what I had to do, just to do this plot, just to make this plot, I had to subset to think maybe 2%. This is what you see here is a 2% of something like this, because I couldn't plot it in R, and I needed it for the book and for the paper. So I said, oh, this is not going to work. Let me subset. So I just randomly took out some points. So you get an idea, but for the sake of plotting, I may be plotting here maybe 50,000 points. Sometimes when I say point, by the way, now imagine this, when I say a point, if you're in a space time modeling, then you say, well, you're talking space time points. You understand? Because the point, still in many GIS, when you say point, the point is, it's just this thing with the location, the station location. They said, that's the point. But in a space time modeling, the point is every measurement in time. So one station can have millions of points. So also be careful with that when you say, I have a problem with that point. When you do space time projects, then when you say, I have a problem with that point, they said, I have a problem with this coordinate and this time, this day. That's where I have the problem. But there's no problem just with the station coordinates. So this is this thing. Back in 2012, when I started going, let's work with space time. In this thing, we call 2D plus time. So you have two dimension and you have the time. We don't model changes above surface below whatever. We didn't model it. So we did this 2D plus time. And at that time, I work a lot with technique and geostatistics. I work with geostatistics. And one of the techniques I work a lot with, what's called regression creating or universal creating. And then I said, let's do this. Let's apply universal creating to space time data. And we managed to publish this paper. And you see there's quite smooth predictions. So we published that data set and predictions. But we did it using universal creating. It means we only use basically linear statistics. And what we're going to do here is the same, basically same thing. We do special temperature calculation, but using ensemble machine learning. So we don't use creating, et cetera. We use ensemble machine learning to do space time interpolation. And you will see it's a bit more computational. When I say a bit more computational, it's about 10,000 times more computational. But the effect that you can gain is that you can possibly increase the mapping accuracy. And that's why we, of course, use it. That's the magic. If you get the machine learning to better represent some nonlinear phenomena and to better subset and optimize fine tune parameters, then you are motivated to switch to machine learning. That's usually why people switch to machine learning. And we're going to talk about that also in the second block today and in the third block. This is the, so this is what I said what we did 2012. Fast forward, 2020. So last year, we started doing this. We prepared a 10 terabyte cloud option as GeoTiff, a Landsat time series. We get, fill it, we removed all the artifacts. We prepared it. It's a 10 terabyte dataset. Then we do space time overlay. Space time overlay takes about four hours. So Camelo, do you remember for the land cover or longer? How long will it take? No, not to overlay, just the overlay. One day. So like a 20 hours or something. So it takes 20 hours to over like 7 million points over 10 terabytes of data. Okay. You would think, wow, it's a one day. But if you try to do it with any other method, if you get it faster, we will be very much like to hear from you. This is the fastest we could get it. Imagine the fastest we could get is a one day to overlay. And then so basically one day you will leave it also overnight and we run it in parallel, right? We run it in parallel and you can parallelize maybe further, but eventually it takes a long time. So we did a space time overlay. We add also some other covariates and then we fit the model. We do space time overlay, fit the space time machine learning. And we made these predictions and this is what you see here. This is the predictions. And you know, there's people criticized as some homes, you know, they appear and disappear. So we have some places where you have a home one year and then next year there's no home. They say it's impossible, right? So there is absolutely there's noise. But we did some time series analysis to that. And when you smooth out the noise, we get accuracy on the second level and third level. It comes to 80%. So it is comparable. If you look at the Corine, let's say LandCover, this is now the state of the art European data set. So this is Corine and this is what we did. And they have also space time. So you can scroll, but it's every, I think every five years. And so, and also the polygons are quite large. And when you look at our data, we have it every year and we have 30 meter resolution. So much, much, much higher resolution. And we can update. We don't need, you know, every time they do new Corine, they start from scratch, not from scratch, but they have to, you know, get all the data and, and, and we only fit a single model. Imagine a single model to model LandCover. It's mind blowing. We had a single model. And now for the 2022, we don't need any point data. We don't need it. We only need the satellite images and the nightlight images. That's it. And we make the provision of LandCover. And so that's, that's, that's also one of the reasons to use the, the space time. And so you can play with all these things. It's super cool, super important to have this functionality to do this swiping. And so you can see the differences in different datasets. And we will keep on adding datasets. And also if you do a European project, if you produce a pan European data set that matches the specifications we use, we are most happy to host it. So we hosting it's on us. So we're most happy to host it. Let me go further. This is, this is also predictions. This is just a one tile. When we do predictions, we, we split the whole European tiles. I think it's 8,000 tiles. We use the 30 by 30 kilometer tiles. And then we do predictions and you can see this is the one, one tile in Sweden and you can see the changes at the start of the project. I was thinking, oh my God, LandCover changes 20 years Europe. Maybe you won't see so many changes. Maybe we'll think, oh, maybe this is, it will be difficult to see changes. Then when we got the results, we were surprised actually, lots of Europe is very dynamic. First you have urbanization happening in Sweden. There's a lot of, I think forest management is more dynamic than in Southern Europe. So we saw a lot of, a lot of changes. And now we're actually very excited because we would like to go back. We will go not back to the future. We would like to go back to the past and we would like to map it up to 1990s so that you can even see what was the history of Europe, LandCover wise and environmental data wise going from 1990, even 1985 if possible up to today. All these things I'm telling you, by the way, there is a paper and you can read it. It's not, it's still in review. So it's not accepted yet, so use it with a grain of salt, but more or less it's all described here and you can read. And if you want to cite this, you can, you can over the site. So one thing worth learning is that, and noting is that when you have a 2D data, you know, if you do geostatistics, you have a volume of three parameters and you have NS locations and SS was like station or space. When you have the 3D data, you have a depth, then you have four, when you do 2D plus time, then you have many more measurements. They go exponentially up. And if you do 3D plus time, then it's mind blowing. Then you have not only changes to time, but also true to vertical dimension. And then you have literally can have like a billion, so observations. And there is in our tutorial, there is a one data set also super happy. We published that paper, it's called Cook Farm data set. And this is a four dimensional GIS. So you have measurements with the automated sensor network where the sensors on different depth in soil. And you can do predictions also in 4D. And so I will show you also the here we use this altitude. So we use a depth also as a covariate. And then we model machine learning, machine learning changes using the depth. And here I show you only one prediction, I think I make the one prediction because it's of a depth of 30 centimeter. But I could make predictions through space time for the different times and for different depths. Now, how do you visualize that statically? How do you visualize the 4D when you can only do it in a paper? How do you do it? Well, it's not too bad. Let me show you how we did it. So we did this. So I downloaded all these papers locally, so I don't have to look online. So here's the papers. And this is the 2015 paper. And so how do you visualize the predictions in 4D? You have to make something like this one. So you have the, this is the time. The time. And then you have this direction and then this is the depth. And believe it or not, you can visualize that as GS, the 4D data. You can visualize in GS. In which GS you can visualize 4D data. Which is the GS that supports 4D data? Do you know? It's Google Earth. In Google Earth, you can visualize 4D data. And I will talk about this in the second block. And also tomorrow I have a session on Google Earth. So please come to Google Earth. I will show you that you can actually put these slices and you can visualize them through time. So you can see how variable changes through depth and through time. It's possible. But then you have to move to Google Earth to KML basically. But it's possible to visualize 4D data. I don't know about QGS. Time series. This is a time series example from Wikipedia. I think this is just some noise with the trend. Yes? But so they use it to visualize, this is like time series. Time series data can look something like this. It can be very noisy. When you do time, time dimension, then you have to consider I have to understand time series analysis. Time series analysis is a lot of things. I don't have time to talk about all these things. So what I just give you a really, really super short, like a one minute run through time series. So number one about time series is that lots of analysis is focused on so-called decomposition. If you look, this is the original signal, it's obvious when you look at it. So you see there's some trend component and there's some seasonality component. They can be split. You split them. Then you say, this is the trend, this is the reality. And then you have a random component. And this many time series does this decomposition. And then also how you feed this trend, which smoothing you use. How do you separate from what is the noise, what is the malation, what is trend? This is the whole science of time series analysis. One example of the time series data is the coronavirus in the Netherlands. These are the infections. There is a corona dashboard for Netherlands. And so you can go here in this dashboard. It's in Dutch, of course, but it's very well done. I don't know if your country has it, but at any stage it's kind of like in sports. You can follow the scores and tables, but it's a dark humor, of course. It's a serious thing. So you can follow the people getting into hospitals, a number of vaccinations. And these are the positive tests. So we can go. It is also GS. GS is very important, so I can go and find this is Ada. We are here. Ada Rachening. So we have 10 positives on 100,000, so that would be about four. It's about four. So four, yesterday, I don't know, four people had the coronavirus positive. And then you can follow. Unfortunately, they had also a time slider, so you can go through the time. You can slide through the time and see where in space there was more. Now it's very chaotic. It's really like leopard skin, so it's very chaotic. You used to be big cities. They used to be the hotspots, which you will expect. But now even Amsterdam has less infections than some little area in Filsland, I don't know. But this one is a time series. And this plot is, of course, wrong because it looks like the last year in March, there was less infections. So this plot is wrong, by the way. It's bias plot. And why do they give a bias plot? That's another question. I wouldn't have done it. I would have normalized it, so it gives the correct picture. But imagine the correct picture would be here is a peak. Here's a peak that goes down because then there was no testing. The testing just started, I don't know, in April or something. Then when they started testing, then it went down because there was a lockdown. And then there was the, we had the summer school here. Summer school, when we had the summer school, they started going up, but still less than now. And now it's in the, and now this was the vaccination starting somewhere here. From April, vaccination starting, then the numbers dropping, dropping, dropping. And this was the delta. Delta came from, I don't want to put geographical location, but in Netherlands, most likely via England, the delta came and delta was a big problem. But not so scary when you go back to the hospital, people having really problems, they had to go to hospital. Then you see that the delta was not as a big problem as in October last year. So it's about even like seven, eight times less. So it means the virus is less deadly for us, basically. But you see, this is the correct picture because this is in April last year. So there was probably much more infections, but there was no testing. So they never normalized the data. So that plot is actually, it's a bias plot. It doesn't show you the real picture of what you're interested in. And so you see this was the peak. So Netherlands never went back to that peak from the last year. So we went to some little peaks here and here. So you can say there were three, there were like say three distinct peaks. And then this was like a fourth, fourth milder. And this one, there's a lead, this is delta here, but less deadly. So that's, let's say some good news in a way. The reason why we're doing this workshop is that we knew that it's a less, less deadly, like way less, five times less deadly. So otherwise we would have done everything we're trying. But we said, look, it's getting people get vaccinated. Congratulations to Netherlands. Netherlands is, I think, in the five most vaccinated countries in percent, fully vaccinated. They're top five in the world. From the big, bigger countries than one million, I think there's Canada, Netherlands, Israel, so a couple of countries, they have really high vaccination rates. And I think as far as I know, 90% of people do want to get vaccinated in Netherlands. There's only 10% don't want to get vaccinated. Okay, so you see, this is the time series and you have these components and you have the trend component. So what is this trend component? So we will take a look at that and what is the similarity. So let's look at the temperature. Let's say, doesn't matter if it's surface above two meter, but the world temperature. If you look, this world temperature have these components from time series data. And one interesting component is the long term oscillations of the temperature. And they are connected also with ice ages. So this here was the ice age. Yes, so this is the ice age. Then the ice age finished about 9,000 years ago. And then you have the global mean temperature going up. But it's a gentle change. It's going from minus 0.3 to plus 0.3. So it's a change of 0.6 degrees. And this is how normally the temperature of the planet goes through this interglacial pyrus goes up and down. And there are some oscillations also here. If you want to read about this glaciation and why does the global temperature changes, it's very complex, actually, it's the whole field of physics. But what you have to know is that there is a distinct long term trend and the temperature change. And this is industrial evolution going 150 years ago. And now in this plot, that's why the industrial evolution is scary and global warming is scary. Because in this plot, you see this red line, this is what happened now with temperature. We are going to rise the temperature one and a half degree. It goes beyond this plot. It goes beyond this is a bit older plot. It's only up to year 2000. But we completely disrupted this long term trend in the global temperature. And then when you zoom into years, years and days, then you can see the temperature and also here water content. Temperature is much more regular. This is actual data. And then we just fit a spline. This is the Cook-Far data set. And we fit the spline for different depths. And super interesting. When you look at the soil, soil is like a buffer for temperature. So you see on the surface, you have higher and lower oscillations. And as you go deeper in the soil, the temperature stabilizes, oscillates more. And the soil moisture, all the way around, you have actually more smoother oscillations on surface and then more oscillation in the deeper soil. Because the water goes through the soil, it doesn't stay usually on the surface, but it goes through the soil and then accumulates somewhere. So when it accumulates, it becomes more stable. And you see there's this seasonality effect. And this is something that seasonality can happen. There's a daytime seasonality. So you have a day and night oscillations in temperature. And you have the seasonal oscillations. So that's like winter, summer, et cetera. So the temperature still has two cycles. It has the oscillations inside the day and oscillations inside the year. And they're both very systematic. There's always nights are cooler than the day, summers are warmer than the winter, et cetera. So it's always very systematic. OK, so that's the spatial temporal data. How do you visualize spatial temporal data? So you can do static plots. So some of the plots I showed you, this will be a static plot. And you can visualize four-dimensional data. It's possible. And is this objects or is this regions? Am I plotting here objects or regions? Somebody? So obviously, there's no, like, I don't use any vector structure. And we're talking about water content. Right? So water content, what did you say? It's kind of a density. So it's definitely a field. You represent it as a field. So I presented with a grid of data. So I just show what is the percent of the water in soil going from 0.15, so 15% to 60%. So there are some pixels that potentially get to 60% water, depending on the period. So that's a static visualization. And then I can do time slices. Time slices is doing something like here in the QGS. These are the time slices. When I do this, you see these are two days. This is 2006, August 15. And this is 2006, August 18. So when I produce time slices, if I do this, I visualize space time. Yes? So this is visualization using slices. So that's another way to visualize. And then the other thing we can do, we can do animation or interactive plots. And animation interactive plots, this is this thing here that you go and you create animation and you can choose your speed. You can slow down or do it faster. Yes? But you can visualize space time data. So these are the main ways, as far as I know, that you can visualize space time data. The most simple way actually is to have just one static image and then put a point of that time series data and then just show something like this. Then you just show the cross through that moment for that spatial entity. That's the most simple way to visualize. Then you simplify the data from 2D plus time, you simplify it into the time only. And you just have then the time series data. This is kind of the most simple way to visualize. And this is when you go in the data portal here. And if I, for example, click somewhere here, I don't know, then as you see, then I get this thing and this is the most easy way to visualize space time data, just having a one static image and then having a time series of the values for that specific query point. And then you will also visualize space time data, but we only know about the point. Now here's a nice example. This is the package I made years ago, but I'm very sorry. I don't maintain it so well. So I'm not sure if it runs still smooth. What I can do, I can put this data here. I can load the package. This is called a foot and mouth disease data. And as you see, I can load the data. It's in the package already. And I can pick up the points, pick up the dates, and I add to the dates. I add a new column, which is the report the day of disease. So foot and mouth is that someone UK where they observed location and time when some cow got the disease. And so that's a space time dataset. And you see I can put the data into the special temporal irregular data frame. SDIDF, this is from the space time package. So I start with having just the dataset looks like this. Let me see. So I have something like this, or it's already converted. Let me see. I have to do like this. So I have it as a simple spatial object first. So this is just a spatial point data frame. So I have the 648 observations. And I have the report the date, but it's just a spatial object. So you see that some of the coordinates, if it was not irregular, if it was a regular, then it would have been repetition in coordinates. But because an irregular, every space time point has a new coordinate. And then I could work that into the space time data frame. And then this one looks like this. So now it's a space time object. And it's a bit more complex structure because it has the data, the values. Then it has this locations and it has the time. You see, and even has some time index, etc. Okay, so it's a different, it's a higher complexity object. In this case, it's a higher complexity object, but it's the most simple extension. And it's called space time irregular data frame. It's a more simple extension because basically it's just a 2d plus time point dataset where time is not kept as a location in the SP in the SP part, but the time is kept in a separate slot, which is the time slot. And if you do it, if you do it like that, when you come to this, when you come to this example, if you use the plot KML package, you can go in and make the plot. You do plot KML. And then we create it. We create a KML file that I can open in Google Earth. And we can now look at it. If the Google Earth starts. No, maybe I'll have to restart it, but we can look at that data, how the values change through space time. Let's see. How do I kill the Google Earth? No, I think I have to check with the land or how was the installation made for Google Earth. I could try to pass this data I made. Let me just see if I can do it. What's here, I made it the dataset. And I think I can pass it to this Windows 10. And it should be visible from my windows. Yes, let's see if I can open in Windows. And I will check, I will check in the break. What's up with the Google Earth under Ubuntu. So here now we're looking at this dataset, foot and mouth disease. And here's the data. I ported it with port KML and purpose I put going from blue color to red color. Blue color is the early cases. Red color is the most recent cases. Have to remove all these other things. And so here's a space time dataset. And imagine now we can visualize it. The guys who make Google Earth, they understand statistics. So you see they have this temporal support. So I can play with the temporal support. And I can scroll to going up or forward and it will go very fast. So why do I use this visualization? Well, it's a complex thing, this foot and mouth disease. And what do you see from that foot and mouth disease? This is so at the beginning there were a couple of let's say outbreaks. So there will be only like three outbreaks and they started spreading. They're spreading all around. And then they spread also further down here. And then again, there will be just the one because here they stopped. Here more or less they stopped. And at the beginning it was very fast. Then it stopped. And then kind of a second outbreak here. And but you see interesting like this outbreak here. It happened, but then it nothing happens serious. But when I look at here, then it got again bad. And that's the way you can visualize space time data. Is this a region or other objects? Come on guys, wake up. This is obvious from the image. Well, how do I use to represent it? What do I use to represent? I use like a vector structure. So obviously these are the actual cows that observed as getting sick. And so these are kind of objects. But I could now, what could I do to convert that into grids? What could I do? Well I could calculate the density. I could for every let's say a week because it goes a couple of weeks. I mean it's over from March to August, September. I could take every week and I will calculate the density of cases like a kernel density. And then I have a time series. Yes? So anyway, but you see it's a nice thing to be able to go from R directly to Google Earth. Yeah, and you can play with that and that's something I will talk tomorrow. I will show the plot came out. And you can easily change the way you use the color. You put another color scale and you can add also elevation. I don't know. You can play with this, what we call space time aesthetics and then you can create your own resolutions. So that's the other very nice thing is the Google time lapse. So if you look at the Google time lapse, have you looked at the Google time lapse, you can pick up any location in the world. And this one is the Wageningen. And you can see last 40 years, you can see this Landsat images last 40 years, it plays animation. So I cannot zoom in more because the resolution is limited, but you can see how the Wageningen change going back all the way back from the 1980s. So it starts from 1985. And you can see that you can see also Landsat getting better. You can see campus growing, you know, so you can see campus growing. It used to be very small, of course, 1980s was like two buildings, I don't know, nothing, but with just the cows there, I think, just the farm. And now it's a big campus. So you can play the three-deframe location in the world. And there's also, of course, the Google pick up the ones that are most interesting. So that would be some really construction sites or somewhere in, I don't know, tropical forest disappearance and things. But please play with it. I don't have time for that now, so I will turn it off. But please play with it. Google time lapse, it's a history, history of the planet, except it's just history through images. There is excellent book on space time data by Oscar Perpignan. He was also in Osama still one year, but he has all these workout examples and there's tutorials. So please take a look at that if you're interested. The book is just behind the link. And lots of things, it's available just in the code so you can reproduce it with your own data. You can also make animations with it. So if you never heard of it, it's a fantastic book, slightly outdated now. There's a lot of new developments. There's the team app package, which you can watch the tutorial from our summer school last week, a tutorial by Martin Tenekes and also excellent package. And there is also animation in the tutorial. So if I look at the, if I will go back, then you can see, then you can see these animations. And there is also a book called Geocomputation with R. Also fantastic book by Robin Loveless and Jacob Ganes. So also fantastic book. And you can also read about how do you visualize space time using, for example, in your book. So you can have a book, you can make a, with R, you can make a book, online book or tutorial, which will have animations. So you visualize things with animation. So you don't have like a classical book with a static image, but you scroll through images and you will see the, you will see actually animations of things. So that's somewhere, a chat animated maps. You see some looking at the book. It's really magical that one picture in a book, it's actually animation, right? So it's not interactive animation. There will be books soon that you have interactive space time animation. So you can play with the things like the things I showed you here. Imagine if I had inside a book that you can go and play directly with Google Earth or something. So that would be also awesome. But you will soon have a book that will have that to leaflet or to some other way that you will be able to play in a book with the space time data. And with this thing, I think I'm done with everything just the conclusions. So what's important, what I said today, well, you may be no more than me, what's important, but if I can emphasize myself, what's very important to understand that the extending from space to time is not trivial. There's a lot of things you have to teach yourself, especially the time series analysis. And the second thing, prepare for the large data, jumping from space to space time can be from 10 times to 10,000 times more data. And then if you want to do space time, don't forget you cannot force any data to space time analysis. If you miss, if you miss, for example, time for some locations, you, with many data sets, we have to drop the data because so unfortunate, the surveyors didn't record the date when they went to the field. And many points we have to drop from the space time data. Sometimes when you drop so many data from space time analysis, let's say if you drop 80%, then your slippery slope, because you really are trying on force to do some analysis with the data, which is not fit for that analysis. So that's something you should also think about. And then to analyze the data, you can use geostatistics. And I showed you, I did that with the space time cringing. You can do process-based modeling, or you can do hybrid methods, and you can do machine learning. And we're going to focus this course, we're going to focus on number two, the machine learning. So we're not going to talk about process-based modeling, and we're not going to talk about geostatistics. But my interest next thing is to do hybrid methods, so to combine machine learning with process-based modeling. But that's another extra layer of complex. There are some groups that are doing it, by the way, experimentally, but that will be another, let's say, paradigm in spatial-temporal data science. And with this thing, I close the first session, I will stop the live broadcast, and then we have some time, so I stop the live broadcast, and we have some time now for questions and discussion, and also people that are online. Yeah, they were guessing good, you see, they're more awake than you. So they were guessing good, very good. I see two people said objects, and grass GS, some of them mentioned grass GS, yes. There's a space-time grass GS. Very good, Nita, thank you so much. Yes, there is a grass, space-time grass GS, and there is a leader from our summer school from last week, and also Vera is going to talk about space-time grass GS, think tomorrow, and also on Wednesday. So they will be mentioned, it's also a fantastic development that you can do space-time in grass GS. But please, if there are questions, so you people that are online, you can use the chat. If there are any questions, we have about five minutes, and then we're going to make a break half an hour, and then we continue with the modeling, so we'll start doing some modeling, and then we'll do more and more art, and it will be good that you try to follow that in the art markdown. Are there any problems with the virtual box? Do you all have it running? Virtual box, yes? Okay, screenshot, where's the error? You need to screenshot. You can customize, as I said, it's really amazing virtual box, and you see it runs very smooth, I can switch from Ubuntu to Windows, and they're not intermixed. I can exchange data, you see I can exchange data from Ubuntu, I make it in Ubuntu, and I open it in Windows, if I have a problem with Google Earth or something. So also fantastic, you see I look at the same folder, this is the same folder in the virtual box, and this one is in Ubuntu. So that's very nice with this virtual box, so when I turn it off here, I go turn it off, it will say, just save the machine's state, so always do that, don't shut down. Yes, so if I do that, it takes about 10 seconds, it will save everything that I was doing, so when I restart Ubuntu, I get exactly the same, so you lose very little time, so it's actually very robust, it's way more robust than I thought, but there was issues with the first image, first image was working, then we added some software, they didn't have Google Earth and stuff, so we added some software, we met a second image, then we had some problems, and then we resolved it eventually. So the last instruction, let's see, the Leandro, the last instruction said there was all working or functioning, now there's still some issues we will see, but these instructions that I think maybe the Leandro sent it in here, here he sent the last instructions, great news, new version, that's the last one, maybe I copied that to the, no I don't know. So this one was working, and as you see on my machine, it's not no problem to set up, there was only issue with the RAM, I think, so you can customize it a bit, so I went and customize the RAM use, so I increased, I have a 16 gig laptop, so I increased the RAM to 10 gig, and I think with 8 gig you can run everything, no problem, but in my case I increased it to 10 gig, and also I increased, do I have 12 CPUs, and I increased to using 6 CPUs on Ubuntu and 6 on my Windows, so I split the CPUs, that's kind of the good way to do it. And as you see when I start the machine, it will get me back exactly to what I need. Let me see, there's some questions, Mark Dev, yes, is the code for your demos in the, yes, so the answer is yes, a question by Nick Ham, so yes, it's all, everything I do, it's in the demo, and the demo, it's loading, the demo is here, under the R training, so everything I will do, it's here, there's no extra code, only this little code I made for the, this is the code for the foot-mouth disease data, so you can play with it, this is by the way, Mark, the MetaMode supports Markdown, so you can, if you make some code, and if you want debugging with the code, then please write it as a code, so this was the code I did to plot, and so I can send a code like this, and if I preview it, it renders the code as a code, okay, so, so you can copy paste that code now with you, and it's going to create that space time point data. Let's see, how is the Python group doing, I think it's going okay, we can watch them on YouTube, if you get bored in my session, you can watch them on the YouTube while they are going upstairs, but yes, questions. No, no, you can ask, they hear you online, they hear, it's no problem, so you can just ask here, please. Sure. Yes, yes, yes, yes, I don't know if you do this integration, so there are two parts, this one is the disaggregation, the second part is that you take all the code and that you take statistical aggregates for that polygons, so you can take a mean value, minimum value, highest value, so you take the statistical aggregates, and then you model it as a space time matrix, and then you just put the results to polygons, that's something very simple that comes to my mind, that's very simple, but they are caveats, so if the polygons are like the large polygons, small polygons, that can have different effects on the predictions, so that increases complexity. The disaggregation is another part, so you try to bring these polygon values, you desegregate them to match the grid values, and then you can use all the pixels, something I will show you today, I use all the pixels then, and I build a space time regression matrix with all pixels, but then you have to be careful about the resolution because if you get, I don't know, one billion pixels, then you cannot model it, so what I do at your P I will show you have a 30 meter resolution daytime, and then I aggregate to one kilometer, and then I bring everything to one kilometer, and then I match on the pixels and I fit machine learning, and that works. So there are two parts, the desegregation and aggregation, but when you do aggregation, then you don't take only the mean value, you should take more, more measures, and in machine learning it's very nice, you can extend, it doesn't have a problem, like in mean statistics you have problem if you have too many covariates, you have a problem if they overlap, multicollinearithmic, in machine learning, no, so you can extend not to infinity, but if it's worth it, you say, well, it helps model, extend, then you take mean, mean, minimum, you know, variation, interquantity range, whatever, you have lots of way you can aggregate. Any more questions? Very interesting question, good. Any more questions? One more? Sure. Yes, the process is very modest, then you have one state, and then basically your predictions go to a next state iteration by iteration, this is a process based model, but you implement kind of physical formulas, so you understand the process, you kind of simulate physical behavior, when in data science you don't simulate basic, data science is actually primitive, I mean primitive in a sense, ignores physics more or less, it's just you look for patterns, you have the patterns, you have correlations, you look for repeating things, you look for significance, you want to distinguish between noise and signal, so that's data science, that you don't understand. This thing we did here on the mapping the land cover, this is purely data science, we don't understand what drives the urban growth, we don't understand the processes, it would be very complex to have it for Europe, so we only have these points, and these points allows us to find, because we can find a relationship with the satellite images, and then if we find that relationship then we just apply that relationship to all the pixels, and that's how we can map, but it's data science is quite basically, it's primitive, it's kind of like data mining, looking for data patterns and relationships, but without understanding these patterns, why do I have these patterns? We just detect them, and the hybrid is that you focus the primary is the processes, you model the processes, and then you have the data, so let's say you do have a lot of data, then you re-calibrate anything about the process you do, any parameter you can re-calibrate, so you still data science, use the data science, but for calibration of the process based models, and that's super interesting.
 From the program, we are using this virtual box, so I'll be using this virtual box.  Don't get confused.  I can switch, in my Windows 10 system, I can switch to Ubuntu, so I just press the button  and now I'm on Ubuntu.  If I do Ctrl-F, then it looks like I'm on Ubuntu computer, but it's running on my local  machine.  It's really magical.  We will be doing this virtual box.  Why we do virtual box?  Because we want that you can all access exactly the same and we don't lose any time on installing  downloading, setting up.  Also have in mind that these slides you can make available offline.  If I shared all the slides, you can find them in the Metamoss channel.  I shared all the slides and you can access the slides.  If you want to save bandwidth, then just go and make them available offline.  That will be something like here.  These ones we are starting.  I will just go File, make available offline.  This way you save bandwidth.  If you don't make it, then switching between the slides can cause bandwidth conjuction.  That's why you should try to do it, save things offline.  I can start with this first block.  The block is one and a half hour.  We will leave every block.  We will leave about 15 minutes, which we will stop doing YouTube broadcast and then we focus  more on your questions.  In the meantime, we will answer questions from people that are online.  We will have every day, I think we will have maybe 50 to 100 people following online depending  on the block.  Some people in different times also probably the way to connect later on.  Let me start the presentation here.  I can just use like this, I think.  We have today and tomorrow, I will be the teacher.  I will have some help from Carmela.  He is not with us now, but Carmela will help with the special temporal ensemble machine  learning, especially because he is working with the real data.  That's the one in the afternoon.  Then also we will do one more technical session working with cloud alternatives.  Something maybe new to many of you.  We will do quite the gentle steps.  We will guide you step by step how you use the cloud alternative and again, especially  with the intent to show you how to do it in R. The guys upstairs, they will do practically  similar sessions, but more focus on Python.  Python and R, of course, are not one-to-one.  There's many functionality that is really different in Python and from R. There's many  packages that exist only in R. There's many packages that in functionality exist only  in Python.  Some things computationally, it's more suited for Python.  Some things for plotting and statistics is more suited for R. When people ask, okay,  which one should I learn?  Usual question, my answer is both.  It's very simple.  You can, we can maybe show that, but in R studio, today you have also functionality  to connect to, so if I go to R studio, there is a functionality also to connect to reticulate  to connect to the using, so here if I go under, let me see, send the tools, I think,  so you can connect to the, we reticulate to Python and then you can do Python programming  also.  So that's about Python and R going back.  So this morning, first block, it's a, let's say, gentle introduction to spatial temporal  data, specific to the data.  Some things maybe aware of, some things maybe here for the first time.  I'm hoping most of things you will hear in this block for the first time.  And then after that, after the break, we'll do some modeling exercises and then slowly  I will start jumping from R to Python, sorry, from R to slides.  So you can see me actually doing programming and working with real data.  And then this morning, basically it's a kind of warm up for the real session, which is  the spatial temporal ensemble machine learning.  So and that's something I think possibly new for you.  And this is going to be really hands on.  But then we just explain you how it's done.  And some people tell me, you know, you think like it's simple, but actually this ensemble  machine, if you do it for the first time, it's, there's a lot of components and it's  really highly complex.  So it requires like really, I think gentle introduction and that you feel the data and  the code.  Everything I will do, it's basically in this notebook.  So there's this notebook.  So it's here.  And you see this notebook is under our training.  And I did share it with you over the last week.  I don't know if you managed to look at it, but this one, it has all the, it has all the  examples and even has text.  So you can really follow it.  It's really like a computational notebook.  So you can really follow it.  And at the beginning, there's a bit of introduction, but then very quickly you have, you have functions  and you run the functions.  And then you can, let's say you can test your own thing.  So we will be moving through this tutorial just here in our studio.  And we will be looking at different things.  And so you see, I can move to some section.  I can run a function, I source the function and then I can, I got some warning message.  I don't know, but I can compute something and they get the number.  So that's this computational notebook.  And that's what the guys use in Python upstairs, this Jupyter, whatever.  So it's basically looks the same.  And we can scroll through the different sections.  And then we will test things.  And then you can, you can modify that code, by the way.  The art studio, you can modify it.  You can play with it.  It's no problem.  If you do something wrong, there is a shortcut.  Let me see.  So you can do git stash and this will remove all the changes.  So it's very, very nice to know the git command.  So I can just do git stash.  If I go here, sorry.  Let's see.  So if I do this, I have to get to the folder though first.  So that's somewhere under, let me see where am I?  I need to remind myself.  So that's under the home odsc work directory.  Then odsc work directory and then code and then odsc workshop.  So I first change here and then I can do this git stash.  And this git stash will basically remove all the changes.  It will leave all the new files you make.  But if you mess up something, I don't know what they did.  And then you just do git stash and that will reward it into the original.  Okay.  So you see I have this cheat sheet.  I can share this with you, but more or less it's just a basic survival.  If something happens, we have to restart the docker.  So that's also survival.  But I can share that with you.  So that's the plan for the, plan for these days is we use this tutorial and then we will  go step by step through different steps.  And then you can ask questions and we can slow down and we can zoom in into things.  Also, I shared, as I said, I shared the slides with you.  So you don't have to write anything down.  You don't have to make screenshots.  Remember, this is also video recorded.  Everything I say I do the code.  You can follow after the course.  So you can really be relaxed and just really focus on the course and ask questions to see  if you can reproduce something on your laptop.  Why we like that people use laptops?  Well, it's less containers for us and obviously you can use different operating systems.  But also we wanted to learn how to use software.  So as soon as you go back to your office and to your work that you can continue using the  software.  Also, why we wanted to use laptops is you can interact with us.  You can ask questions and the metermost is very important because you can do a screenshot  if you have a problem.  I say I have a bug or something happening.  You can send a screenshot and then we can try to help you.  And as you can see, there were many people asking questions about the virtual box and  there was screenshots people send.  I have this problem.  I have this problem.  So people were sending.  So we were debugging already and helping people.  And I hope now you all have that virtual box running.  By the way, I'm also new to virtual box.  I didn't use it before.  You would just connect to my workstation at the office using a no machine or team viewer.  But now Landro convince me it is the best way.  It's very elegant and you just it's kind of that's why it's called box.  So you have everything out of box.  You have all the software.  Everything is customized.  We all see the same and you can easily just turn it off and you can put it in standby.  I don't know if you tested it.  You put it in standby and and then when you start the machine, you get exactly the same  thing where you left.  So it's really magical.  Okay, so that's the matter most anybody not connected or the art development group, please  connect.  If you don't see the art development group, you have to go to this plus sign and you  say you have to say bros channels and then then pick up the channels you want to see.  If you are if you're a physical participant, if you have questions about logistics here  in the week, then you should ask it in this group.  Don't mix it if it's a general question about methods problems with code.  Then you ask in the town square or you ask in our dev.  But if you have a question specifically, I have to with Wi-Fi.  I have the then you ask it here.  So that's and it's a very important to use matter most because it's a it gives a track  of everything and you can open lots of discussion groups and each everything you post basically  becomes a little discussion group.  And if you reply on something as you see here, when you reply, you can see all the the thread.  So that's also nice about the matter most now that you can go back to the same issue  raised and then you can respond there.  And usually if we responded to something that you ask, we will not respond back, but we  are going to just send you the link and you can link to any thread or any post in a matter  most.  It's a it's kind of like in Github and so so you can link any to any post and this way  this way we can debug but we cannot if we debug a problem once we don't want to debug  it two times.  I hope you understand that because that's a waste of time.  Okay, everybody looks very serious.  There's no exam by the way this course so you can relax.  This is a and it's also special times.  This is Corona pandemic times and we are really doing our best and improvising.  We had to teach ourselves how to do parallel broadcast and you know how to use all the  zoom functionality we haven't used it before.  And also there were many cancellations by the way for physical attendance.  25 people cancelled so really high cancellation rate.  But we had the last year exactly here at week we had a summer school and there were more  people almost two times more people last year when there was no vaccinations and more chaos.  And now that you would think okay there's vaccinations but the delta unfortunately arrived  and that made it a bit complicated.  But nevertheless we'll keep it in we'll keep everybody safe of course and so we will do  our best to follow the Corona rules of course and and we think it's going to be successful  event.  Nevertheless, when you if you're new to R it's not I don't I cannot promise you you're  going to leave this place and you say I went to this training course two days and I learned  I'm some ensemble machine learning and R never used R before that will be very difficult.  This is quite advanced topic.  So you know there are ways to teach somebody in one day things with the right motivation.  But I mean imagine this person here you know trying to satisfy Kim you and if he fails  something of course it's not a good probably for him.  But there's very difficult to teach something very advanced in one day.  So what I recommend is that you kind of if you are new to many things open your mind  and just make sure you you know take the copies of the slides and remember there's going to  be a video published also so you can go back to some of the discussion points and you can  see me coding and you can you can teach yourself after the course you can go back and try to  learn things.  The reason why we are here of course is because we have we have a European funded project  which is called actual products called geoharmonizer.  But that's a two technical names so we renamed it to open data science EU.  And so that's the reason why we have this because we had some budget to organize this  type of workshops and to do core development sessions.  So this falls under the one of the core development sessions because we also expect to get feedback  from you.  But so this is our project and you can read on the bottom you see that it's been funded.  It used to be called in there innovation networking agency.  Now it's called there but you can read about this project here under the link and it's  mentioned on the bottom of the page.  I can see that some people now connected from US which is really crazy because I think it  was probably like 4am or something.  But they see lots of people connected now following around Europe and there's some people following  looks like from India.  So you can read more about the project and we pull posts here if you have the news then  we post some articles how we did processing and but they're very short.  So we are hoping we're writing our articles to explain how we did the process.  So that's thanks to this.  And as you see in that project we made this data portal which is under maps open data  science.  So if I actually here I can go.  So under the maps open open data science.eu we made this what we call a European environmental  data cube.  And this is the data cube here.  So we made this data portal and and as you see we are here in the lens and we can zoom  in.  So let's say we are now here.  And so what we did that we created this land cover predictions using ensemble machine learning.  So the things we're teaching you this is what we did but we did it with the 7 million points  and with about 400 covariates or the regression classification matrix is only on the classification  matrix about 3 gigabytes and so we computed all these things and we we also put we can  show you we put the points here.  And so we trained with 7 million points and we made the predictions and you can go and  scroll through time and you can see how the land cover changes.  And what you can see here is that this for example, Fenendal like this area you can see  that there's a growth.  So this all these places are new.  And we did the proper I think the land cover mapping because we mapped every class.  So if you if you look at urban we we mapped every class is a probability.  So you can see also probability of each class mapped.  And so if I click somewhere here, I will get it will do a query on the geotifs and it will  get the values of that probability changing through time.  So we can see in which time they started building our estimate.  Yes.  And also when I say we do things properly, we also put the uncertainty.  So if I if I turn this off, we put also the uncertainty and you can see uncertainty per  pixel.  We estimate which of the pixels if it's a brighter yellow, it means there's a high uncertainty  and it will pop up some places you will see a high uncertainty.  And it means that you should be careful using that data.  So I think it's a let's say a proper framework to do land cover mapping and we are proud  that we did it using ensemble machine learning.  In this case, this this predictions and the modeling was done in Python actually.  But we also have the vegetation map that Carmelo and me went to show this was all done in  R.  So once you choose our Python, it's not easy to mix, but some projects we chose to use  our or some projects we chose to use Python.  So yeah, that's this project.  And that's what we're going to talk about.  And we're very excited that Carmelo, who is PhD student at Open Geohub and working in  university, he's going to show you in the afternoon, really, with a really large data  set, we're going to show you how we compute space time distribution of forestry species.  And we will show you that it really matches the ground data.  We also have about one million points, I think training points.  So we are very excited to show you that results.  This is also first time we're showing to public this results.  Okay, space time data.  So I personally work a lot with the spatial data, and I did a lot of predictive mapping  projects.  And I even produce some global data sets, European data sets, Africa, United States,  we didn't want some awards for some publications on doing predictive mapping.  But I also got interested over the year 2012, I knew that it will be very interesting to  do space time, and then I published my first paper, I think on space time in 2012, space  time prediction.  And so we will use that paper.  It's one of the case studies is the mapping the daily temperatures.  And then later on somewhere in 2018, 2019, I wanted to switch from doing spatial to space  time.  And this project is a proof of concept that you could do all the mapping projects you  can switch to space time as long as you have enough data.  So when you look at the land cover mapping, we don't map a land cover of year 2020, we  map a land cover of last 20 years, or maybe we can map 30 years.  But so we switch from doing a spatial modeling to space time.  But when you look at the space time data, it's not just like if you have a space, you  have a 2D, when you look at the space time data, it's not that you just got the third  dimension, so you got 2D, 3D, but you have a 2D plus time.  And it's a special dimension.  And so what's special about it?  Well, number one is, for example, in a spatial dimension, XY dimension, if you look at left  and right, then the left can impact the right and right can impact left.  Yeah, it can be connected.  There can be a, let's say, the diffusion movement in the space.  But when you look at the time, the future cannot impact past, right?  So you have the causality, it's only one direction.  Then also with the time data, I will show you there's a whole field, there's a whole  field of statistics, which is called time series analysis, which looks at the behavior  of variables through time.  And it's a way more complex, there's just changes of variables through space.  So we are going to talk about that.  Time dimension, it's easy to plot, remember that, but it's difficult to model, basically.  And then what is especially very difficult is to predict the future.  And that's what some people in time series analysis, when they blindly use the models,  they say, okay, now I predict the future.  But they predict the future can be very poor.  And so it's very difficult, especially to predict the future.  You can predict inside the observed space and time.  So if we predict land cover for the last 20 years, then we can do lots of testing.  But if I have to predict a land cover for 2022, you understand, it's going to be very  difficult because you need something on the level of magic really to do it.  But you could, for some variables, you get very close.  So you can actually predict future also.  If the variables are kind of like the train component, the systematic component, it's  let's say you would screw them to be like dominant, then you can also predict some models  you can extrapolate in the future.  So we're going to talk a bit about time series analysis, visualization of data.  And I will point you to many books and references.  So you can maybe some things are new, maybe some things you know, but I will point you.  Any data that has a so-called special temporal reference is a special temporal data.  So obviously you need the coordinates.  If you talk about geographical data, the coordinates are a lot to do.  Then what is also very useful to know is the location accuracy.  So that tells you about this x, y coordinates, whether they should, they relate to something,  you know, which is plus minus 100 meter, 500 meter, I don't know.  But also there is the size of the block you sample.  You know, you could also do block sampling.  And you have a, for example, for soils that do block sampling.  So they say this is the value that relates to a volume of a soil.  It doesn't relate to a point.  And then you have the height above surface, the elevation, because this is elevation as  of terrain.  But you can also have, for example, temperature, the early temperature.  Is it the surface temperature?  Is it the two meter or is it the 100 meter?  You know, so you can have a different vertical dimension.  And that's this third dimension.  And then we have the time.  And time you represent actually with two columns.  That's the beginning of the measurement and end of the measurement.  I will show you that that's very important because time has also so-called temporal support.  So some things we measure like the daily values, monthly values, value at the second.  So it also, it's very important.  And then you get the spatial temporal data.  And once you know, once you know this coordinates of the data, once it's a spatial temporal reference,  then you can import it and do spatial temporal modeling.  So this is actually, whether it said time is just not a spatial dimension.  And there are specific methods that develop for space-time data.  And when I started in R, when I was using R, I think in 2013, I think then or 2012 already,  Edzer and the colleagues, they made this space-time package and it was really a great solution  because at that time there was only spatial data, SP.  And then he says, okay, he looked at some problems in the data and then he made this  space-time package.  I don't know if you ever used it, but when you read some of the tutorial, then you actually  becomes a bit complex because there's this full spatial stack and irregular data stack.  So he made these classes of data.  So it's a quite complex to understand.  It's a bit abstract.  But in principle, the most important is that you have correctly for data, you know, the  space-time reference.  And then if you have that, then you can import it in R, organize as a space-time class.  And then we will show you with some data examples, you can plot the data, you can do a space-time  overlay, you can do a space-time modeling.  And this is this paper also from Edzer called Space-time.  It's published in the Journal of Statistical Software.  Have you used Space-time?  Do you anybody use Space-time completely new?  It's also magical when you think about this.  So the space-time data imagine you can have a space-time time series of satellite images  and you load them into R. And if you organize them as you say, this is the class space-time  regular data frame of space-time full data stack.  And then you prepare the point data and this can be irregular.  And then you say over the points versus the space-time time series, and it will do a space-time  overlay.  And then you match the points with the cells in the space-time.  And so that's really magical because you then do it in one line.  The problem is when you work with the large data, you cannot load it in R. Your RAM is  not going to handle it.  The R is not so, let's say we are not so efficient with putting things in RAM.  So then you have to maybe this space-time package wouldn't work.  And I don't use it by the way because we work now exclusively with large data sets.  So I will show you we're going to use the Terra extract, which will do then the space-time  overlay.  But my code, unfortunately, maybe not so easy because this space-time overlay, I will show  you just very quickly how the code looks like.  So it's a bit longer code.  Don't get scared and it runs in parallel.  So this is the space-time overlay for meteorological data.  We have a time series of modus length surface temperatures, and we'll do a space-time overlay.  And so I made this code.  So it's not in a package yet, but I should put it in a package.  And you see this code will run in parallel.  So it runs in parallel.  And I made a little function called extractsd, extract space-time.  And this thing is a universal function.  So this function, if you use this code with your data, it will, I promise, it's the fastest  way you can overlay a large amount of points over large stacks of geotifs.  And they don't even have to be stacked to exactly the same thing.  They can be loose structures.  So that's the space-time overlay.  And then when you do after the overlay, you will get this so-called space-time regression  matrix, and then you can do modeling.  So I'm going to do this code today.  I'm going to show you how it works.  And we're going to go step by step.  And then I will show you the data structure, what comes out.  I will also show you when I do computing, how it goes into parallel.  So we will look at it, observe it here when it goes to parallel, and so that you get the  feeling that you understand what's behind.  But again, I built up the thing that I showed you.  I built it up on top of the package made by Robert Thomas, which is called Terra package.  And this one allows, so that's this extract STUC.  This is the function that allows to do very quick overlay.  And it's actually magically fast.  We overlay millions of points over like, I don't know, one terabyte of data, and it will  take two minutes.  So it's a magically fast.  And this is mainly because the Terra is a program mainly in C++.  It's another language that is something you should consider, but C++ is a different story.  Okay, going back to the slides.  So there is also a new book called Spatial Data Science.  Have you heard of this book?  And this is the URL.  The URL is very critical, Keem Schwartz 3146c4.  It's a very critical URL.  Don't ask me, but Edzel is the main author.  And they are writing it.  You can subscribe to it and you will get the notifications every time they write a new  thing and the things they discuss, you can follow it.  So it's a live book.  Basically they write the book and you can follow them.  You can see all the mistakes they do and the fixes.  So they write book in front of everyone.  So it's a new age writing of science.  I think it's the right way, by the way.  It is a book down base.  So you can see all the code, everything which you see in a code.  And you see there's a chapter 13, a multivariate and spatial temporal data.  I don't know how much they have, but they have, I think, only spatial temporal geostatistics.  So if you go to this book, which will be cutting edge, you will not find anything basically  that we are going to teach you.  I don't know, very little.  So everything we teach you, it's not in the book because we do the machine learning for  space time.  So I think we have a lot of original things for you.  But maybe they will add it, I don't know, because as I said, it's open book.  Maybe at one point they will say, okay, we add one chapter on space time machine learning  for mapping.  Okay, this is just to share the space time reference.  If you use Google or any type of data in KML, keyhole markup language, then you can see  how it looks like a space time reference.  So you see here I have a name.  This is a station, a station that we use in the first exercise.  And we see that there's a measurement at some point and point has the coordinates and it  has a begin and end time.  And you see that's all this theoretical concept that tell you there are implemented in any  software.  So for me, actually, as I said, for me, now mainstream is to do space time modeling, space  time analysis.  And for me, any GIS where I cannot set up a space time, for me, it's a cumbersome.  We cannot do our work.  So we have to use only the GIS where we can do space time.  And so one of the most popular GIS is the QGS.  Does it support space time?  Does it support space time?  Do you know?  Pablo, you don't think so?  I don't know.  There is a plugin.  There is a plugin to go around it, but it's not.  If you just start the QGS and you say here I have a time series, you know, you're not  going to get a slider, right?  That's one of the reasons why we develop original interface because you see all of our data,  it has a slider.  There's only a few data sets.  There's no slider, but 95% of data is sliders.  So as soon as you start the data, there is a slider, right?  And so when you go to QGS, if I open some project, you know, you say, well, I have a,  this is this temperature data.  I want to slide through time.  You won't get it, but there is a plugin.  There's a plugin for time series data.  And this is not going to animate changes.  You have to play with the animation.  But if you move around with the mouse, you will get the curves.  You will see the curves of the values.  And that's also amazing.  Somebody made this plugin.  What's the name of the plugin?  Do you remember Camilo?  No, another value for the time series.  I have to also remind myself, but there is a plugin which allows to time series, time  series explorer.  There's a couple of plugins, but I have to actually remember which one is the one that  Landro uses upstairs.  Maybe please check with the Landro.  So, but there is a plugin and you, there's more plugins, of course, as I said, but there  is a planning plugin to put it and then you can see how the values change if you have  a time series of values, how does it change through time?  At the moment, if I want to see changes to try and I have to do this, I have to click  on and off.  That's the only way that's QGS.  People that are experts in QGS, if they watch this video, they will say, no, no, no, you  are doing it the wrong way, you should do like this, but officially, it's not easy to  just go, hey, here's the space time data, I want to see changes.  It's not easy QGS, but it's possible to set up.  So, when you have a moving object, and if you may be following me now, I might sketch  it on the screen there.  So, when you have like something like a bird, right, bird is very complex, maybe car is  better.  When you say car, then the car moves to some streets, right, and goes somewhere here, goes  from location A to B. But when you put it in, let's say somewhere  mapped up, it's just a point moving.  But you could also put it as a trajectory.  So you put that line of movement, and you can put the trajectory in space time, so you  can make a space time Q, something like this.  So that's will be X, Y, and then this was the time, and time goes this way.  So you should plot it, then you have something like trajectory moving up in time.  Have you ever seen this?  So I was doing that for two years when I was in Amsterdam, I was plotting this trajectory,  it's a bird movement.  And it's very funny because you can then in this space time Q, you can see that how this  overlaps between species through time, which you wouldn't be able to see if you just have  a 2D view.  So you can see the density, you can rotate the cube and you can see the density where  they overlap in the movement, right.  And so this is also another way to look at it.  And so now you have this, so you have objects, and objects have trajectories.  And then you have also fields.  And so what are the fields, regions?  So I wrote here what could be the fields, regions, the next slide.  Basically, it can be one of the three things.  It can be a quantity or density of material.  So it's not a physical entity.  So that's like molecules, you know, quantitative molecules, let's say, you know, some element  in soil.  Or if you think about pH of soil, this is quantity of elements.  And so these are all density.  Then it can be energy flux, energy flux, because energy also moves like if you look at the  heat, it moves through space, right.  It's not a physical entity.  It's a movement of energy.  So you can also model that.  And then this is where it gets a bit confusing.  You can also do modeling probability for currents.  And so this bird movement, I could also represent it with probability of occurrence, and then  represent it as a region.  Okay.  But actually in the original sense, it's entities, physical entities, but I could also  model them as regions.  And when you look at this map, I showed you basically on the open data science viewer,  this one, it's basically urban fabric.  It's a physical entity, so most of land cover is physical entities, but we model that as  a probability of occurrence.  So if you say theoretically speaking, how could we model this?  Well, we could model every house as a unique entity.  You understand?  If you want the total land cover, GIS, then I will model every tree, every house, everything  which is a physical entity, I will model it as a physical entity.  And this is maybe in about 10 years, this is how the land cover maps will look like.  Because maybe 10 years in the Netherlands already they inventory all the trees, I think.  Did you know that if you're not from Netherlands, they have a data set you can access.  They map the whole country one to 1000 now, I think, and they mapped basically every tree.  And the next thing they would chip every tree.  Yes, so they know how the tree is doing, and there's already a concept called tree talker.  Have you heard of it?  So they put a chip on a tree and they follow the health of the tree every 10 minutes, you  get the automated sensor network.  And so that will be a land cover in the future, that you wouldn't map the probabilities, but  you will take any object that you consider as a land cover, land use, and then you will  take it through time.  And so when you come to GS like this, maybe if I'm still working in maybe 15 years, we  go here's the Netherlands and here are the homes that disappeared and the new homes built  and that are the right, that's how the land cover maps will look like.  So but this is just talking about concepts.  First distinguish that there are models, space time models of objects, physical entities,  and there's models of quantities and quantities can be densities or masses of volumes, or  it can be energy fluxes or it can be a probability of occurrence.  This is the space time cube.  This data set you see here, this is this data set we're going to use here, which is this  meteorological stations for creation, and you will see that when we make on the end,  we will make predictions and predictions will look something like this.  Now I have to actually show you that in the, because I don't have it computed, but I have  to show you here.  So we will make these predictions and they will look something like this.  So you will see we will do space time interpolation of daily temperatures, and we will predict  for every day, we will predict how the daily temperature changes.  And you see these are the stations, and these are the predictions.  So this is the same data set.  This is this data set is shown in a space time cube.  And here is shown on a 2D map.  Yeah, it's not easy to match, right?  You'd like, well, no, it's not the same, but they are meteorological stations and you  have the measurements every day, their measurements.  You see some stations, they are not, they are no measurements.  So what happened here?  How come there are no measurements?  They had a day off on the meteorological service.  No, so what we did when we first started working with this data, so I said, let's do space  time.  So we say meteorological data space time is high quality, is lots of data.  So let's do meteorological data.  And when we started working, if you look at it, they have something like 160 stations,  and they may have measurements daily.  Yes?  So you have 365 days by 160 stations.  That's a lot.  When you load it in R, when I started doing, whoa, this is not going to work.  It looks like it's only 160 points.  But when you load all the space time data, and if you take, let's say, three years, you  are suddenly loading millions of values.  And that's the difference between space time and space.  In space time, you get overloaded with the data very quickly.  So what I had to do, just to do this plot, just to make this plot, I had to subset to  think maybe 2%.  This is what you see here is a 2% of something like this, because I couldn't plot it in R,  and I needed it for the book and for the paper.  So I said, oh, this is not going to work.  Let me subset.  So I just randomly took out some points.  So you get an idea, but for the sake of plotting, I may be plotting here maybe 50,000 points.  Sometimes when I say point, by the way, now imagine this, when I say a point, if you're  in a space time modeling, then you say, well, you're talking space time points.  You understand?  Because the point, still in many GIS, when you say point, the point is, it's just this  thing with the location, the station location.  They said, that's the point.  But in a space time modeling, the point is every measurement in time.  So one station can have millions of points.  So also be careful with that when you say, I have a problem with that point.  When you do space time projects, then when you say, I have a problem with that point,  they said, I have a problem with this coordinate and this time, this day.  That's where I have the problem.  But there's no problem just with the station coordinates.  So this is this thing.  Back in 2012, when I started going, let's work with space time.  In this thing, we call 2D plus time.  So you have two dimension and you have the time.  We don't model changes above surface below whatever.  We didn't model it.  So we did this 2D plus time.  And at that time, I work a lot with technique and geostatistics.  I work with geostatistics.  And one of the techniques I work a lot with, what's called regression creating or universal  creating.  And then I said, let's do this.  Let's apply universal creating to space time data.  And we managed to publish this paper.  And you see there's quite smooth predictions.  So we published that data set and predictions.  But we did it using universal creating.  It means we only use basically linear statistics.  And what we're going to do here is the same, basically same thing.  We do special temperature calculation, but using ensemble machine learning.  So we don't use creating, et cetera.  We use ensemble machine learning to do space time interpolation.  And you will see it's a bit more computational.  When I say a bit more computational, it's about 10,000 times more computational.  But the effect that you can gain is that you can possibly increase the mapping accuracy.  And that's why we, of course, use it.  That's the magic.  If you get the machine learning to better represent some nonlinear phenomena and to better  subset and optimize fine tune parameters, then you are motivated to switch to machine  learning.  That's usually why people switch to machine learning.  And we're going to talk about that also in the second block today and in the third block.  This is the, so this is what I said what we did 2012.  Fast forward, 2020.  So last year, we started doing this.  We prepared a 10 terabyte cloud option as GeoTiff, a Landsat time series.  We get, fill it, we removed all the artifacts.  We prepared it.  It's a 10 terabyte dataset.  Then we do space time overlay.  Space time overlay takes about four hours.  So Camelo, do you remember for the land cover or longer?  How long will it take?  No, not to overlay, just the overlay.  One day.  So like a 20 hours or something.  So it takes 20 hours to over like 7 million points over 10 terabytes of data.  Okay.  You would think, wow, it's a one day.  But if you try to do it with any other method, if you get it faster, we will be very much  like to hear from you.  This is the fastest we could get it.  Imagine the fastest we could get is a one day to overlay.  And then so basically one day you will leave it also overnight and we run it in parallel,  right?  We run it in parallel and you can parallelize maybe further, but eventually it takes a long  time.  So we did a space time overlay.  We add also some other covariates and then we fit the model.  We do space time overlay, fit the space time machine learning.  And we made these predictions and this is what you see here.  This is the predictions.  And you know, there's people criticized as some homes, you know, they appear and disappear.  So we have some places where you have a home one year and then next year there's no home.  They say it's impossible, right?  So there is absolutely there's noise.  But we did some time series analysis to that.  And when you smooth out the noise, we get accuracy on the second level and third level.  It comes to 80%.  So it is comparable.  If you look at the Corine, let's say LandCover, this is now the state of the art European  data set.  So this is Corine and this is what we did.  And they have also space time.  So you can scroll, but it's every, I think every five years.  And so, and also the polygons are quite large.  And when you look at our data, we have it every year and we have 30 meter resolution.  So much, much, much higher resolution.  And we can update.  We don't need, you know, every time they do new Corine, they start from scratch, not from  scratch, but they have to, you know, get all the data and, and, and we only fit a single  model.  Imagine a single model to model LandCover.  It's mind blowing.  We had a single model.  And now for the 2022, we don't need any point data.  We don't need it.  We only need the satellite images and the nightlight images.  That's it.  And we make the provision of LandCover.  And so that's, that's, that's also one of the reasons to use the, the space time.  And so you can play with all these things.  It's super cool, super important to have this functionality to do this swiping.  And so you can see the differences in different datasets.  And we will keep on adding datasets.  And also if you do a European project, if you produce a pan European data set that matches  the specifications we use, we are most happy to host it.  So we hosting it's on us.  So we're most happy to host it.  Let me go further.  This is, this is also predictions.  This is just a one tile.  When we do predictions, we, we split the whole European tiles.  I think it's 8,000 tiles.  We use the 30 by 30 kilometer tiles.  And then we do predictions and you can see this is the one, one tile in Sweden and you  can see the changes at the start of the project.  I was thinking, oh my God, LandCover changes 20 years Europe.  Maybe you won't see so many changes.  Maybe we'll think, oh, maybe this is, it will be difficult to see changes.  Then when we got the results, we were surprised actually, lots of Europe is very dynamic.  First you have urbanization happening in Sweden.  There's a lot of, I think forest management is more dynamic than in Southern Europe.  So we saw a lot of, a lot of changes.  And now we're actually very excited because we would like to go back.  We will go not back to the future.  We would like to go back to the past and we would like to map it up to 1990s so that you  can even see what was the history of Europe, LandCover wise and environmental data wise  going from 1990, even 1985 if possible up to today.  All these things I'm telling you, by the way, there is a paper and you can read it.  It's not, it's still in review.  So it's not accepted yet, so use it with a grain of salt, but more or less it's all  described here and you can read.  And if you want to cite this, you can, you can over the site.  So one thing worth learning is that, and noting is that when you have a 2D data, you know,  if you do geostatistics, you have a volume of three parameters and you have NS locations  and SS was like station or space.  When you have the 3D data, you have a depth, then you have four, when you do 2D plus time,  then you have many more measurements.  They go exponentially up.  And if you do 3D plus time, then it's mind blowing.  Then you have not only changes to time, but also true to vertical dimension.  And then you have literally can have like a billion, so observations.  And there is in our tutorial, there is a one data set also super happy.  We published that paper, it's called Cook Farm data set.  And this is a four dimensional GIS.  So you have measurements with the automated sensor network where the sensors on different  depth in soil.  And you can do predictions also in 4D.  And so I will show you also the here we use this altitude.  So we use a depth also as a covariate.  And then we model machine learning, machine learning changes using the depth.  And here I show you only one prediction, I think I make the one prediction because it's  of a depth of 30 centimeter.  But I could make predictions through space time for the different times and for different  depths.  Now, how do you visualize that statically?  How do you visualize the 4D when you can only do it in a paper?  How do you do it?  Well, it's not too bad.  Let me show you how we did it.  So we did this.  So I downloaded all these papers locally, so I don't have to look online.  So here's the papers.  And this is the 2015 paper.  And so how do you visualize the predictions in 4D?  You have to make something like this one.  So you have the, this is the time.  The time.  And then you have this direction and then this is the depth.  And believe it or not, you can visualize that as GS, the 4D data.  You can visualize in GS.  In which GS you can visualize 4D data.  Which is the GS that supports 4D data?  Do you know?  It's Google Earth.  In Google Earth, you can visualize 4D data.  And I will talk about this in the second block.  And also tomorrow I have a session on Google Earth.  So please come to Google Earth.  I will show you that you can actually put these slices and you can visualize them through  time.  So you can see how variable changes through depth and through time.  It's possible.  But then you have to move to Google Earth to KML basically.  But it's possible to visualize 4D data.  I don't know about QGS.  Time series.  This is a time series example from Wikipedia.  I think this is just some noise with the trend.  Yes?  But so they use it to visualize, this is like time series.  Time series data can look something like this.  It can be very noisy.  When you do time, time dimension, then you have to consider I have to understand time  series analysis.  Time series analysis is a lot of things.  I don't have time to talk about all these things.  So what I just give you a really, really super short, like a one minute run through time  series.  So number one about time series is that lots of analysis is focused on so-called decomposition.  If you look, this is the original signal, it's obvious when you look at it.  So you see there's some trend component and there's some seasonality component.  They can be split.  You split them.  Then you say, this is the trend, this is the reality.  And then you have a random component.  And this many time series does this decomposition.  And then also how you feed this trend, which smoothing you use.  How do you separate from what is the noise, what is the malation, what is trend?  This is the whole science of time series analysis.  One example of the time series data is the coronavirus in the Netherlands.  These are the infections.  There is a corona dashboard for Netherlands.  And so you can go here in this dashboard.  It's in Dutch, of course, but it's very well done.  I don't know if your country has it, but at any stage it's kind of like in sports.  You can follow the scores and tables, but it's a dark humor, of course.  It's a serious thing.  So you can follow the people getting into hospitals, a number of vaccinations.  And these are the positive tests.  So we can go.  It is also GS.  GS is very important, so I can go and find this is Ada.  We are here.  Ada Rachening.  So we have 10 positives on 100,000, so that would be about four.  It's about four.  So four, yesterday, I don't know, four people had the coronavirus positive.  And then you can follow.  Unfortunately, they had also a time slider, so you can go through the time.  You can slide through the time and see where in space there was more.  Now it's very chaotic.  It's really like leopard skin, so it's very chaotic.  You used to be big cities.  They used to be the hotspots, which you will expect.  But now even Amsterdam has less infections than some little area in Filsland, I don't  know.  But this one is a time series.  And this plot is, of course, wrong because it looks like the last year in March, there  was less infections.  So this plot is wrong, by the way.  It's bias plot.  And why do they give a bias plot?  That's another question.  I wouldn't have done it.  I would have normalized it, so it gives the correct picture.  But imagine the correct picture would be here is a peak.  Here's a peak that goes down because then there was no testing.  The testing just started, I don't know, in April or something.  Then when they started testing, then it went down because there was a lockdown.  And then there was the, we had the summer school here.  Summer school, when we had the summer school, they started going up, but still less than  now.  And now it's in the, and now this was the vaccination starting somewhere here.  From April, vaccination starting, then the numbers dropping, dropping, dropping.  And this was the delta.  Delta came from, I don't want to put geographical location, but in Netherlands, most likely  via England, the delta came and delta was a big problem.  But not so scary when you go back to the hospital, people having really problems, they had to  go to hospital.  Then you see that the delta was not as a big problem as in October last year.  So it's about even like seven, eight times less.  So it means the virus is less deadly for us, basically.  But you see, this is the correct picture because this is in April last year.  So there was probably much more infections, but there was no testing.  So they never normalized the data.  So that plot is actually, it's a bias plot.  It doesn't show you the real picture of what you're interested in.  And so you see this was the peak.  So Netherlands never went back to that peak from the last year.  So we went to some little peaks here and here.  So you can say there were three, there were like say three distinct peaks.  And then this was like a fourth, fourth milder.  And this one, there's a lead, this is delta here, but less deadly.  So that's, let's say some good news in a way.  The reason why we're doing this workshop is that we knew that it's a less, less deadly,  like way less, five times less deadly.  So otherwise we would have done everything we're trying.  But we said, look, it's getting people get vaccinated.  Congratulations to Netherlands.  Netherlands is, I think, in the five most vaccinated countries in percent, fully vaccinated.  They're top five in the world.  From the big, bigger countries than one million, I think there's Canada, Netherlands, Israel,  so a couple of countries, they have really high vaccination rates.  And I think as far as I know, 90% of people do want to get vaccinated in Netherlands.  There's only 10% don't want to get vaccinated.  Okay, so you see, this is the time series and you have these components and you have  the trend component.  So what is this trend component?  So we will take a look at that and what is the similarity.  So let's look at the temperature.  Let's say, doesn't matter if it's surface above two meter, but the world temperature.  If you look, this world temperature have these components from time series data.  And one interesting component is the long term oscillations of the temperature.  And they are connected also with ice ages.  So this here was the ice age.  Yes, so this is the ice age.  Then the ice age finished about 9,000 years ago.  And then you have the global mean temperature going up.  But it's a gentle change.  It's going from minus 0.3 to plus 0.3.  So it's a change of 0.6 degrees.  And this is how normally the temperature of the planet goes through this interglacial  pyrus goes up and down.  And there are some oscillations also here.  If you want to read about this glaciation and why does the global temperature changes,  it's very complex, actually, it's the whole field of physics.  But what you have to know is that there is a distinct long term trend and the temperature  change.  And this is industrial evolution going 150 years ago.  And now in this plot, that's why the industrial evolution is scary and global warming is scary.  Because in this plot, you see this red line, this is what happened now with temperature.  We are going to rise the temperature one and a half degree.  It goes beyond this plot.  It goes beyond this is a bit older plot.  It's only up to year 2000.  But we completely disrupted this long term trend in the global temperature.  And then when you zoom into years, years and days, then you can see the temperature and  also here water content.  Temperature is much more regular.  This is actual data.  And then we just fit a spline.  This is the Cook-Far data set.  And we fit the spline for different depths.  And super interesting.  When you look at the soil, soil is like a buffer for temperature.  So you see on the surface, you have higher and lower oscillations.  And as you go deeper in the soil, the temperature stabilizes, oscillates more.  And the soil moisture, all the way around, you have actually more smoother oscillations  on surface and then more oscillation in the deeper soil.  Because the water goes through the soil, it doesn't stay usually on the surface, but  it goes through the soil and then accumulates somewhere.  So when it accumulates, it becomes more stable.  And you see there's this seasonality effect.  And this is something that seasonality can happen.  There's a daytime seasonality.  So you have a day and night oscillations in temperature.  And you have the seasonal oscillations.  So that's like winter, summer, et cetera.  So the temperature still has two cycles.  It has the oscillations inside the day and oscillations inside the year.  And they're both very systematic.  There's always nights are cooler than the day, summers are warmer than the winter, et  cetera.  So it's always very systematic.  OK, so that's the spatial temporal data.  How do you visualize spatial temporal data?  So you can do static plots.  So some of the plots I showed you, this will be a static plot.  And you can visualize four-dimensional data.  It's possible.  And is this objects or is this regions?  Am I plotting here objects or regions?  Somebody?  So obviously, there's no, like, I don't use any vector structure.  And we're talking about water content.  Right?  So water content, what did you say?  It's kind of a density.  So it's definitely a field.  You represent it as a field.  So I presented with a grid of data.  So I just show what is the percent of the water in soil going from 0.15, so 15% to 60%.  So there are some pixels that potentially get to 60% water, depending on the period.  So that's a static visualization.  And then I can do time slices.  Time slices is doing something like here in the QGS.  These are the time slices.  When I do this, you see these are two days.  This is 2006, August 15.  And this is 2006, August 18.  So when I produce time slices, if I do this, I visualize space time.  Yes?  So this is visualization using slices.  So that's another way to visualize.  And then the other thing we can do, we can do animation or interactive plots.  And animation interactive plots, this is this thing here that you go and you create animation  and you can choose your speed.  You can slow down or do it faster.  Yes?  But you can visualize space time data.  So these are the main ways, as far as I know, that you can visualize space time data.  The most simple way actually is to have just one static image and then put a point of that  time series data and then just show something like this.  Then you just show the cross through that moment for that spatial entity.  That's the most simple way to visualize.  Then you simplify the data from 2D plus time, you simplify it into the time only.  And you just have then the time series data.  This is kind of the most simple way to visualize.  And this is when you go in the data portal here.  And if I, for example, click somewhere here, I don't know, then as you see, then I get  this thing and this is the most easy way to visualize space time data, just having a one  static image and then having a time series of the values for that specific query point.  And then you will also visualize space time data, but we only know about the point.  Now here's a nice example.  This is the package I made years ago, but I'm very sorry.  I don't maintain it so well.  So I'm not sure if it runs still smooth.  What I can do, I can put this data here.  I can load the package.  This is called a foot and mouth disease data.  And as you see, I can load the data.  It's in the package already.  And I can pick up the points, pick up the dates, and I add to the dates.  I add a new column, which is the report the day of disease.  So foot and mouth is that someone UK where they observed location and time when some  cow got the disease.  And so that's a space time dataset.  And you see I can put the data into the special temporal irregular data frame.  SDIDF, this is from the space time package.  So I start with having just the dataset looks like this.  Let me see.  So I have something like this, or it's already converted.  Let me see.  I have to do like this.  So I have it as a simple spatial object first.  So this is just a spatial point data frame.  So I have the 648 observations.  And I have the report the date, but it's just a spatial object.  So you see that some of the coordinates, if it was not irregular, if it was a regular,  then it would have been repetition in coordinates.  But because an irregular, every space time point has a new coordinate.  And then I could work that into the space time data frame.  And then this one looks like this.  So now it's a space time object.  And it's a bit more complex structure because it has the data, the values.  Then it has this locations and it has the time.  You see, and even has some time index, etc.  Okay, so it's a different, it's a higher complexity object.  In this case, it's a higher complexity object, but it's the most simple extension.  And it's called space time irregular data frame.  It's a more simple extension because basically it's just a 2d plus time point dataset where  time is not kept as a location in the SP in the SP part, but the time is kept in a separate  slot, which is the time slot.  And if you do it, if you do it like that, when you come to this, when you come to this  example, if you use the plot KML package, you can go in and make the plot.  You do plot KML.  And then we create it.  We create a KML file that I can open in Google Earth.  And we can now look at it.  If the Google Earth starts.  No, maybe I'll have to restart it, but we can look at that data, how the values change  through space time.  Let's see.  How do I kill the Google Earth?  No, I think I have to check with the land or how was the installation made for Google  Earth.  I could try to pass this data I made.  Let me just see if I can do it.  What's here, I made it the dataset.  And I think I can pass it to this Windows 10.  And it should be visible from my windows.  Yes, let's see if I can open in Windows.  And I will check, I will check in the break.  What's up with the Google Earth under Ubuntu.  So here now we're looking at this dataset, foot and mouth disease.  And here's the data.  I ported it with port KML and purpose I put going from blue color to red color.  Blue color is the early cases.  Red color is the most recent cases.  Have to remove all these other things.  And so here's a space time dataset.  And imagine now we can visualize it.  The guys who make Google Earth, they understand statistics.  So you see they have this temporal support.  So I can play with the temporal support.  And I can scroll to going up or forward and it will go very fast.  So why do I use this visualization?  Well, it's a complex thing, this foot and mouth disease.  And what do you see from that foot and mouth disease?  This is so at the beginning there were a couple of let's say outbreaks.  So there will be only like three outbreaks and they started spreading.  They're spreading all around.  And then they spread also further down here.  And then again, there will be just the one because here they stopped.  Here more or less they stopped.  And at the beginning it was very fast.  Then it stopped.  And then kind of a second outbreak here.  And but you see interesting like this outbreak here.  It happened, but then it nothing happens serious.  But when I look at here, then it got again bad.  And that's the way you can visualize space time data.  Is this a region or other objects?  Come on guys, wake up.  This is obvious from the image.  Well, how do I use to represent it?  What do I use to represent?  I use like a vector structure.  So obviously these are the actual cows that observed as getting sick.  And so these are kind of objects.  But I could now, what could I do to convert that into grids?  What could I do?  Well I could calculate the density.  I could for every let's say a week because it goes a couple of weeks.  I mean it's over from March to August, September.  I could take every week and I will calculate the density of cases like a kernel density.  And then I have a time series.  Yes?  So anyway, but you see it's a nice thing to be able to go from R directly to Google Earth.  Yeah, and you can play with that and that's something I will talk tomorrow.  I will show the plot came out.  And you can easily change the way you use the color.  You put another color scale and you can add also elevation.  I don't know.  You can play with this, what we call space time aesthetics and then you can create your  own resolutions.  So that's the other very nice thing is the Google time lapse.  So if you look at the Google time lapse, have you looked at the Google time lapse, you can  pick up any location in the world.  And this one is the Wageningen.  And you can see last 40 years, you can see this Landsat images last 40 years, it plays  animation.  So I cannot zoom in more because the resolution is limited, but you can see how the Wageningen  change going back all the way back from the 1980s.  So it starts from 1985.  And you can see that you can see also Landsat getting better.  You can see campus growing, you know, so you can see campus growing.  It used to be very small, of course, 1980s was like two buildings, I don't know, nothing,  but with just the cows there, I think, just the farm.  And now it's a big campus.  So you can play the three-deframe location in the world.  And there's also, of course, the Google pick up the ones that are most interesting.  So that would be some really construction sites or somewhere in, I don't know, tropical  forest disappearance and things.  But please play with it.  I don't have time for that now, so I will turn it off.  But please play with it.  Google time lapse, it's a history, history of the planet, except it's just history through  images.  There is excellent book on space time data by Oscar Perpignan.  He was also in Osama still one year, but he has all these workout examples and there's  tutorials.  So please take a look at that if you're interested.  The book is just behind the link.  And lots of things, it's available just in the code so you can reproduce it with your  own data.  You can also make animations with it.  So if you never heard of it, it's a fantastic book, slightly outdated now.  There's a lot of new developments.  There's the team app package, which you can watch the tutorial from our summer school  last week, a tutorial by Martin Tenekes and also excellent package.  And there is also animation in the tutorial.  So if I look at the, if I will go back, then you can see, then you can see these animations.  And there is also a book called Geocomputation with R.  Also fantastic book by Robin Loveless and Jacob Ganes.  So also fantastic book.  And you can also read about how do you visualize space time using, for example, in your book.  So you can have a book, you can make a, with R, you can make a book, online book or tutorial,  which will have animations.  So you visualize things with animation.  So you don't have like a classical book with a static image, but you scroll through images  and you will see the, you will see actually animations of things.  So that's somewhere, a chat animated maps.  You see some looking at the book.  It's really magical that one picture in a book, it's actually animation, right?  So it's not interactive animation.  There will be books soon that you have interactive space time animation.  So you can play with the things like the things I showed you here.  Imagine if I had inside a book that you can go and play directly with Google Earth or something.  So that would be also awesome.  But you will soon have a book that will have that to leaflet or to some other way that  you will be able to play in a book with the space time data.  And with this thing, I think I'm done with everything just the conclusions.  So what's important, what I said today, well, you may be no more than me, what's important,  but if I can emphasize myself, what's very important to understand that the extending  from space to time is not trivial.  There's a lot of things you have to teach yourself, especially the time series analysis.  And the second thing, prepare for the large data, jumping from space to space time can  be from 10 times to 10,000 times more data.  And then if you want to do space time, don't forget you cannot force any data to space  time analysis.  If you miss, if you miss, for example, time for some locations, you, with many data sets,  we have to drop the data because so unfortunate, the surveyors didn't record the date when  they went to the field.  And many points we have to drop from the space time data.  Sometimes when you drop so many data from space time analysis, let's say if you drop  80%, then your slippery slope, because you really are trying on force to do some analysis  with the data, which is not fit for that analysis.  So that's something you should also think about.  And then to analyze the data, you can use geostatistics.  And I showed you, I did that with the space time cringing.  You can do process-based modeling, or you can do hybrid methods, and you can do machine  learning.  And we're going to focus this course, we're going to focus on number two, the machine  learning.  So we're not going to talk about process-based modeling, and we're not going to talk about  geostatistics.  But my interest next thing is to do hybrid methods, so to combine machine learning with  process-based modeling.  But that's another extra layer of complex.  There are some groups that are doing it, by the way, experimentally, but that will be  another, let's say, paradigm in spatial-temporal data science.  And with this thing, I close the first session, I will stop the live broadcast, and then we  have some time, so I stop the live broadcast, and we have some time now for questions and  discussion, and also people that are online.  Yeah, they were guessing good, you see, they're more awake than you.  So they were guessing good, very good.  I see two people said objects, and grass GS, some of them mentioned grass GS, yes.  There's a space-time grass GS.  Very good, Nita, thank you so much.  Yes, there is a grass, space-time grass GS, and there is a leader from our summer school  from last week, and also Vera is going to talk about space-time grass GS, think tomorrow,  and also on Wednesday.  So they will be mentioned, it's also a fantastic development that you can do space-time in  grass GS.  But please, if there are questions, so you people that are online, you can use the chat.  If there are any questions, we have about five minutes, and then we're going to make  a break half an hour, and then we continue with the modeling, so we'll start doing some  modeling, and then we'll do more and more art, and it will be good that you try to follow  that in the art markdown.  Are there any problems with the virtual box?  Do you all have it running?  Virtual box, yes?  Okay, screenshot, where's the error?  You need to screenshot.  You can customize, as I said, it's really amazing virtual box, and you see it runs very smooth,  I can switch from Ubuntu to Windows, and they're not intermixed.  I can exchange data, you see I can exchange data from Ubuntu, I make it in Ubuntu, and  I open it in Windows, if I have a problem with Google Earth or something.  So also fantastic, you see I look at the same folder, this is the same folder in the virtual  box, and this one is in Ubuntu.  So that's very nice with this virtual box, so when I turn it off here, I go turn it off,  it will say, just save the machine's state, so always do that, don't shut down.  Yes, so if I do that, it takes about 10 seconds, it will save everything that I was doing,  so when I restart Ubuntu, I get exactly the same, so you lose very little time, so it's  actually very robust, it's way more robust than I thought, but there was issues with  the first image, first image was working, then we added some software, they didn't have  Google Earth and stuff, so we added some software, we met a second image, then we had some problems,  and then we resolved it eventually.  So the last instruction, let's see, the Leandro, the last instruction said there was all working  or functioning, now there's still some issues we will see, but these instructions that I  think maybe the Leandro sent it in here, here he sent the last instructions, great news,  new version, that's the last one, maybe I copied that to the, no I don't know.  So this one was working, and as you see on my machine, it's not no problem to set up,  there was only issue with the RAM, I think, so you can customize it a bit, so I went and  customize the RAM use, so I increased, I have a 16 gig laptop, so I increased the RAM to  10 gig, and I think with 8 gig you can run everything, no problem, but in my case I increased  it to 10 gig, and also I increased, do I have 12 CPUs, and I increased to using 6 CPUs on  Ubuntu and 6 on my Windows, so I split the CPUs, that's kind of the good way to do it.  And as you see when I start the machine, it will get me back exactly to what I need.  Let me see, there's some questions, Mark Dev, yes, is the code for your demos in the,  yes, so the answer is yes, a question by Nick Ham, so yes, it's all, everything I do,  it's in the demo, and the demo, it's loading, the demo is here, under the R training,  so everything I will do, it's here, there's no extra code, only this little code I made  for the, this is the code for the foot-mouth disease data, so you can play with it, this  is by the way, Mark, the MetaMode supports Markdown, so you can, if you make some code,  and if you want debugging with the code, then please write it as a code, so this was the  code I did to plot, and so I can send a code like this, and if I preview it, it renders  the code as a code, okay, so, so you can copy paste that code now with you, and it's going  to create that space time point data.  Let's see, how is the Python group doing, I think it's going okay, we can watch them  on YouTube, if you get bored in my session, you can watch them on the YouTube while they  are going upstairs, but yes, questions.  No, no, you can ask, they hear you online, they hear, it's no problem, so you can just  ask here, please.  Sure.  Yes, yes, yes, yes, I don't know if you do this integration, so there are two parts,  this one is the disaggregation, the second part is that you take all the code and that  you take statistical aggregates for that polygons, so you can take a mean value, minimum value,  highest value, so you take the statistical aggregates, and then you model it as a space  time matrix, and then you just put the results to polygons, that's something very simple  that comes to my mind, that's very simple, but they are caveats, so if the polygons are  like the large polygons, small polygons, that can have different effects on the predictions,  so that increases complexity.  The disaggregation is another part, so you try to bring these polygon values, you desegregate  them to match the grid values, and then you can use all the pixels, something I will show  you today, I use all the pixels then, and I build a space time regression matrix with  all pixels, but then you have to be careful about the resolution because if you get, I  don't know, one billion pixels, then you cannot model it, so what I do at your P I will show  you have a 30 meter resolution daytime, and then I aggregate to one kilometer, and then  I bring everything to one kilometer, and then I match on the pixels and I fit machine learning,  and that works.  So there are two parts, the desegregation and aggregation, but when you do aggregation,  then you don't take only the mean value, you should take more, more measures, and in machine  learning it's very nice, you can extend, it doesn't have a problem, like in mean statistics  you have problem if you have too many covariates, you have a problem if they overlap, multicollinearithmic,  in machine learning, no, so you can extend not to infinity, but if it's worth it, you  say, well, it helps model, extend, then you take mean, mean, minimum, you know, variation,  interquantity range, whatever, you have lots of way you can aggregate.  Any more questions?  Very interesting question, good.  Any more questions?  One more?  Sure.  Yes, the process is very modest, then you have one state, and then basically your predictions  go to a next state iteration by iteration, this is a process based model, but you implement  kind of physical formulas, so you understand the process, you kind of simulate physical  behavior, when in data science you don't simulate basic, data science is actually primitive,  I mean primitive in a sense, ignores physics more or less, it's just you look for patterns,  you have the patterns, you have correlations, you look for repeating things, you look for  significance, you want to distinguish between noise and signal, so that's data science,  that you don't understand.  This thing we did here on the mapping the land cover, this is purely data science, we  don't understand what drives the urban growth, we don't understand the processes, it would  be very complex to have it for Europe, so we only have these points, and these points  allows us to find, because we can find a relationship with the satellite images, and then if we  find that relationship then we just apply that relationship to all the pixels, and that's  how we can map, but it's data science is quite basically, it's primitive, it's kind of like  data mining, looking for data patterns and relationships, but without understanding these  patterns, why do I have these patterns?  We just detect them, and the hybrid is that you focus the primary is the processes, you  model the processes, and then you have the data, so let's say you do have a lot of data,  then you re-calibrate anything about the process you do, any parameter you can re-calibrate,  so you still data science, use the data science, but for calibration of the process based models,  and that's super interesting.
A1_0_299.png A1_300_1247.png A1_1248_1583.png A1_1584_5507.png A1_5508_5591.png A1_5592_8555.png A1_8556_8819.png A1_8820_8915.png A1_8916_11147.png A1_11148_11807.png A1_11808_13295.png A1_13296_15491.png A1_15492_17615.png A1_17616_18227.png A1_18228_23267.png A1_23268_23411.png A1_23412_23459.png A1_23460_23735.png A1_23736_24071.png A1_24072_24491.png A1_24492_25043.png A1_25044_25091.png A1_25092_25187.png A1_25188_26543.png A1_26544_26807.png A1_26808_28331.png A1_28332_35363.png A1_35364_38555.png A1_38556_38771.png A1_38772_38855.png A1_38856_39071.png A1_39072_39143.png A1_39144_39371.png A1_39372_42167.png A1_42168_45695.png A1_45696_50711.png A1_50712_50759.png A1_50760_52559.png A1_52560_53303.png A1_53304_63299.png A1_63300_63839.png A1_63840_63947.png A1_63948_64079.png A1_64080_64499.png A1_64500_64655.png A1_64656_64763.png A1_64764_70283.png A1_70284_71699.png A1_71700_79451.png A1_79452_81011.png A1_81012_81155.png A1_81156_81395.png A1_81396_81779.png A1_81780_82847.png A1_82848_82919.png A1_82920_83099.png A1_83100_83723.png A1_83724_83771.png A1_83772_87083.png A1_87084_87179.png A1_87180_87743.png A1_87744_92339.png A1_92340_101183.png A1_101184_101447.png A1_101448_101819.png A1_101820_102287.png A1_102288_102851.png A1_102852_108131.png A1_108132_109643.png A1_109644_109703.png A1_109704_109943.png A1_109944_109991.png A1_109992_110711.png A1_110712_111071.png A1_111072_111251.png A1_111252_111815.png A1_111816_115151.png A1_115152_115979.png A1_115980_116027.png A1_116028_117875.png A1_117876_118451.png A1_118452_118535.png A1_118536_118643.png A1_118644_118739.png A1_118740_120491.png A1_120492_121415.png A1_121416_121751.png A1_121752_125171.png A1_125172_125783.png A1_125784_126623.png A1_126624_129371.png A1_129372_129467.png A1_129468_135095.png A1_135096_135539.png A1_135540_141287.png A1_141288_143150.png
From the program, we are using this virtual box, so I'll be using this virtual box. Don't get confused. I can switch, in my Windows 10 system, I can switch to Ubuntu, so I just press the button and now I'm on Ubuntu. If I do Ctrl-F, then it looks like I'm on Ubuntu computer, but it's running on my local machine. It's really magical. We will be doing this virtual box. Why we do virtual box? Because we want that you can all access exactly the same and we don't lose any time on installing downloading, setting up. Also have in mind that these slides you can make available offline. If I shared all the slides, you can find them in the Metamoss channel. I shared all the slides and you can access the slides. If you want to save bandwidth, then just go and make them available offline. That will be something like here. These ones we are starting. I will just go File, make available offline. This way you save bandwidth. If you don't make it, then switching between the slides can cause bandwidth conjuction. That's why you should try to do it, save things offline. I can start with this first block. The block is one and a half hour. We will leave every block. We will leave about 15 minutes, which we will stop doing YouTube broadcast and then we focus more on your questions. In the meantime, we will answer questions from people that are online. We will have every day, I think we will have maybe 50 to 100 people following online depending on the block. Some people in different times also probably the way to connect later on. Let me start the presentation here. I can just use like this, I think. We have today and tomorrow, I will be the teacher. I will have some help from Carmela. He is not with us now, but Carmela will help with the special temporal ensemble machine learning, especially because he is working with the real data. That's the one in the afternoon. Then also we will do one more technical session working with cloud alternatives. Something maybe new to many of you. We will do quite the gentle steps. We will guide you step by step how you use the cloud alternative and again, especially with the intent to show you how to do it in R. The guys upstairs, they will do practically similar sessions, but more focus on Python. Python and R, of course, are not one-to-one. There's many functionality that is really different in Python and from R. There's many packages that exist only in R. There's many packages that in functionality exist only in Python. Some things computationally, it's more suited for Python. Some things for plotting and statistics is more suited for R. When people ask, okay, which one should I learn? Usual question, my answer is both. It's very simple. You can, we can maybe show that, but in R studio, today you have also functionality to connect to, so if I go to R studio, there is a functionality also to connect to reticulate to connect to the using, so here if I go under, let me see, send the tools, I think, so you can connect to the, we reticulate to Python and then you can do Python programming also. So that's about Python and R going back. So this morning, first block, it's a, let's say, gentle introduction to spatial temporal data, specific to the data. Some things maybe aware of, some things maybe here for the first time. I'm hoping most of things you will hear in this block for the first time. And then after that, after the break, we'll do some modeling exercises and then slowly I will start jumping from R to Python, sorry, from R to slides. So you can see me actually doing programming and working with real data. And then this morning, basically it's a kind of warm up for the real session, which is the spatial temporal ensemble machine learning. So and that's something I think possibly new for you. And this is going to be really hands on. But then we just explain you how it's done. And some people tell me, you know, you think like it's simple, but actually this ensemble machine, if you do it for the first time, it's, there's a lot of components and it's really highly complex. So it requires like really, I think gentle introduction and that you feel the data and the code. Everything I will do, it's basically in this notebook. So there's this notebook. So it's here. And you see this notebook is under our training. And I did share it with you over the last week. I don't know if you managed to look at it, but this one, it has all the, it has all the examples and even has text. So you can really follow it. It's really like a computational notebook. So you can really follow it. And at the beginning, there's a bit of introduction, but then very quickly you have, you have functions and you run the functions. And then you can, let's say you can test your own thing. So we will be moving through this tutorial just here in our studio. And we will be looking at different things. And so you see, I can move to some section. I can run a function, I source the function and then I can, I got some warning message. I don't know, but I can compute something and they get the number. So that's this computational notebook. And that's what the guys use in Python upstairs, this Jupyter, whatever. So it's basically looks the same. And we can scroll through the different sections. And then we will test things. And then you can, you can modify that code, by the way. The art studio, you can modify it. You can play with it. It's no problem. If you do something wrong, there is a shortcut. Let me see. So you can do git stash and this will remove all the changes. So it's very, very nice to know the git command. So I can just do git stash. If I go here, sorry. Let's see. So if I do this, I have to get to the folder though first. So that's somewhere under, let me see where am I? I need to remind myself. So that's under the home odsc work directory. Then odsc work directory and then code and then odsc workshop. So I first change here and then I can do this git stash. And this git stash will basically remove all the changes. It will leave all the new files you make. But if you mess up something, I don't know what they did. And then you just do git stash and that will reward it into the original. Okay. So you see I have this cheat sheet. I can share this with you, but more or less it's just a basic survival. If something happens, we have to restart the docker. So that's also survival. But I can share that with you. So that's the plan for the, plan for these days is we use this tutorial and then we will go step by step through different steps. And then you can ask questions and we can slow down and we can zoom in into things. Also, I shared, as I said, I shared the slides with you. So you don't have to write anything down. You don't have to make screenshots. Remember, this is also video recorded. Everything I say I do the code. You can follow after the course. So you can really be relaxed and just really focus on the course and ask questions to see if you can reproduce something on your laptop. Why we like that people use laptops? Well, it's less containers for us and obviously you can use different operating systems. But also we wanted to learn how to use software. So as soon as you go back to your office and to your work that you can continue using the software. Also, why we wanted to use laptops is you can interact with us. You can ask questions and the metermost is very important because you can do a screenshot if you have a problem. I say I have a bug or something happening. You can send a screenshot and then we can try to help you. And as you can see, there were many people asking questions about the virtual box and there was screenshots people send. I have this problem. I have this problem. So people were sending. So we were debugging already and helping people. And I hope now you all have that virtual box running. By the way, I'm also new to virtual box. I didn't use it before. You would just connect to my workstation at the office using a no machine or team viewer. But now Landro convince me it is the best way. It's very elegant and you just it's kind of that's why it's called box. So you have everything out of box. You have all the software. Everything is customized. We all see the same and you can easily just turn it off and you can put it in standby. I don't know if you tested it. You put it in standby and and then when you start the machine, you get exactly the same thing where you left. So it's really magical. Okay, so that's the matter most anybody not connected or the art development group, please connect. If you don't see the art development group, you have to go to this plus sign and you say you have to say bros channels and then then pick up the channels you want to see. If you are if you're a physical participant, if you have questions about logistics here in the week, then you should ask it in this group. Don't mix it if it's a general question about methods problems with code. Then you ask in the town square or you ask in our dev. But if you have a question specifically, I have to with Wi-Fi. I have the then you ask it here. So that's and it's a very important to use matter most because it's a it gives a track of everything and you can open lots of discussion groups and each everything you post basically becomes a little discussion group. And if you reply on something as you see here, when you reply, you can see all the the thread. So that's also nice about the matter most now that you can go back to the same issue raised and then you can respond there. And usually if we responded to something that you ask, we will not respond back, but we are going to just send you the link and you can link to any thread or any post in a matter most. It's a it's kind of like in Github and so so you can link any to any post and this way this way we can debug but we cannot if we debug a problem once we don't want to debug it two times. I hope you understand that because that's a waste of time. Okay, everybody looks very serious. There's no exam by the way this course so you can relax. This is a and it's also special times. This is Corona pandemic times and we are really doing our best and improvising. We had to teach ourselves how to do parallel broadcast and you know how to use all the zoom functionality we haven't used it before. And also there were many cancellations by the way for physical attendance. 25 people cancelled so really high cancellation rate. But we had the last year exactly here at week we had a summer school and there were more people almost two times more people last year when there was no vaccinations and more chaos. And now that you would think okay there's vaccinations but the delta unfortunately arrived and that made it a bit complicated. But nevertheless we'll keep it in we'll keep everybody safe of course and so we will do our best to follow the Corona rules of course and and we think it's going to be successful event. Nevertheless, when you if you're new to R it's not I don't I cannot promise you you're going to leave this place and you say I went to this training course two days and I learned I'm some ensemble machine learning and R never used R before that will be very difficult. This is quite advanced topic. So you know there are ways to teach somebody in one day things with the right motivation. But I mean imagine this person here you know trying to satisfy Kim you and if he fails something of course it's not a good probably for him. But there's very difficult to teach something very advanced in one day. So what I recommend is that you kind of if you are new to many things open your mind and just make sure you you know take the copies of the slides and remember there's going to be a video published also so you can go back to some of the discussion points and you can see me coding and you can you can teach yourself after the course you can go back and try to learn things. The reason why we are here of course is because we have we have a European funded project which is called actual products called geoharmonizer. But that's a two technical names so we renamed it to open data science EU. And so that's the reason why we have this because we had some budget to organize this type of workshops and to do core development sessions. So this falls under the one of the core development sessions because we also expect to get feedback from you. But so this is our project and you can read on the bottom you see that it's been funded. It used to be called in there innovation networking agency. Now it's called there but you can read about this project here under the link and it's mentioned on the bottom of the page. I can see that some people now connected from US which is really crazy because I think it was probably like 4am or something. But they see lots of people connected now following around Europe and there's some people following looks like from India. So you can read more about the project and we pull posts here if you have the news then we post some articles how we did processing and but they're very short. So we are hoping we're writing our articles to explain how we did the process. So that's thanks to this. And as you see in that project we made this data portal which is under maps open data science. So if I actually here I can go. So under the maps open open data science.eu we made this what we call a European environmental data cube. And this is the data cube here. So we made this data portal and and as you see we are here in the lens and we can zoom in. So let's say we are now here. And so what we did that we created this land cover predictions using ensemble machine learning. So the things we're teaching you this is what we did but we did it with the 7 million points and with about 400 covariates or the regression classification matrix is only on the classification matrix about 3 gigabytes and so we computed all these things and we we also put we can show you we put the points here. And so we trained with 7 million points and we made the predictions and you can go and scroll through time and you can see how the land cover changes. And what you can see here is that this for example, Fenendal like this area you can see that there's a growth. So this all these places are new. And we did the proper I think the land cover mapping because we mapped every class. So if you if you look at urban we we mapped every class is a probability. So you can see also probability of each class mapped. And so if I click somewhere here, I will get it will do a query on the geotifs and it will get the values of that probability changing through time. So we can see in which time they started building our estimate. Yes. And also when I say we do things properly, we also put the uncertainty. So if I if I turn this off, we put also the uncertainty and you can see uncertainty per pixel. We estimate which of the pixels if it's a brighter yellow, it means there's a high uncertainty and it will pop up some places you will see a high uncertainty. And it means that you should be careful using that data. So I think it's a let's say a proper framework to do land cover mapping and we are proud that we did it using ensemble machine learning. In this case, this this predictions and the modeling was done in Python actually. But we also have the vegetation map that Carmelo and me went to show this was all done in R. So once you choose our Python, it's not easy to mix, but some projects we chose to use our or some projects we chose to use Python. So yeah, that's this project. And that's what we're going to talk about. And we're very excited that Carmelo, who is PhD student at Open Geohub and working in university, he's going to show you in the afternoon, really, with a really large data set, we're going to show you how we compute space time distribution of forestry species. And we will show you that it really matches the ground data. We also have about one million points, I think training points. So we are very excited to show you that results. This is also first time we're showing to public this results. Okay, space time data. So I personally work a lot with the spatial data, and I did a lot of predictive mapping projects. And I even produce some global data sets, European data sets, Africa, United States, we didn't want some awards for some publications on doing predictive mapping. But I also got interested over the year 2012, I knew that it will be very interesting to do space time, and then I published my first paper, I think on space time in 2012, space time prediction. And so we will use that paper. It's one of the case studies is the mapping the daily temperatures. And then later on somewhere in 2018, 2019, I wanted to switch from doing spatial to space time. And this project is a proof of concept that you could do all the mapping projects you can switch to space time as long as you have enough data. So when you look at the land cover mapping, we don't map a land cover of year 2020, we map a land cover of last 20 years, or maybe we can map 30 years. But so we switch from doing a spatial modeling to space time. But when you look at the space time data, it's not just like if you have a space, you have a 2D, when you look at the space time data, it's not that you just got the third dimension, so you got 2D, 3D, but you have a 2D plus time. And it's a special dimension. And so what's special about it? Well, number one is, for example, in a spatial dimension, XY dimension, if you look at left and right, then the left can impact the right and right can impact left. Yeah, it can be connected. There can be a, let's say, the diffusion movement in the space. But when you look at the time, the future cannot impact past, right? So you have the causality, it's only one direction. Then also with the time data, I will show you there's a whole field, there's a whole field of statistics, which is called time series analysis, which looks at the behavior of variables through time. And it's a way more complex, there's just changes of variables through space. So we are going to talk about that. Time dimension, it's easy to plot, remember that, but it's difficult to model, basically. And then what is especially very difficult is to predict the future. And that's what some people in time series analysis, when they blindly use the models, they say, okay, now I predict the future. But they predict the future can be very poor. And so it's very difficult, especially to predict the future. You can predict inside the observed space and time. So if we predict land cover for the last 20 years, then we can do lots of testing. But if I have to predict a land cover for 2022, you understand, it's going to be very difficult because you need something on the level of magic really to do it. But you could, for some variables, you get very close. So you can actually predict future also. If the variables are kind of like the train component, the systematic component, it's let's say you would screw them to be like dominant, then you can also predict some models you can extrapolate in the future. So we're going to talk a bit about time series analysis, visualization of data. And I will point you to many books and references. So you can maybe some things are new, maybe some things you know, but I will point you. Any data that has a so-called special temporal reference is a special temporal data. So obviously you need the coordinates. If you talk about geographical data, the coordinates are a lot to do. Then what is also very useful to know is the location accuracy. So that tells you about this x, y coordinates, whether they should, they relate to something, you know, which is plus minus 100 meter, 500 meter, I don't know. But also there is the size of the block you sample. You know, you could also do block sampling. And you have a, for example, for soils that do block sampling. So they say this is the value that relates to a volume of a soil. It doesn't relate to a point. And then you have the height above surface, the elevation, because this is elevation as of terrain. But you can also have, for example, temperature, the early temperature. Is it the surface temperature? Is it the two meter or is it the 100 meter? You know, so you can have a different vertical dimension. And that's this third dimension. And then we have the time. And time you represent actually with two columns. That's the beginning of the measurement and end of the measurement. I will show you that that's very important because time has also so-called temporal support. So some things we measure like the daily values, monthly values, value at the second. So it also, it's very important. And then you get the spatial temporal data. And once you know, once you know this coordinates of the data, once it's a spatial temporal reference, then you can import it and do spatial temporal modeling. So this is actually, whether it said time is just not a spatial dimension. And there are specific methods that develop for space-time data. And when I started in R, when I was using R, I think in 2013, I think then or 2012 already, Edzer and the colleagues, they made this space-time package and it was really a great solution because at that time there was only spatial data, SP. And then he says, okay, he looked at some problems in the data and then he made this space-time package. I don't know if you ever used it, but when you read some of the tutorial, then you actually becomes a bit complex because there's this full spatial stack and irregular data stack. So he made these classes of data. So it's a quite complex to understand. It's a bit abstract. But in principle, the most important is that you have correctly for data, you know, the space-time reference. And then if you have that, then you can import it in R, organize as a space-time class. And then we will show you with some data examples, you can plot the data, you can do a space-time overlay, you can do a space-time modeling. And this is this paper also from Edzer called Space-time. It's published in the Journal of Statistical Software. Have you used Space-time? Do you anybody use Space-time completely new? It's also magical when you think about this. So the space-time data imagine you can have a space-time time series of satellite images and you load them into R. And if you organize them as you say, this is the class space-time regular data frame of space-time full data stack. And then you prepare the point data and this can be irregular. And then you say over the points versus the space-time time series, and it will do a space-time overlay. And then you match the points with the cells in the space-time. And so that's really magical because you then do it in one line. The problem is when you work with the large data, you cannot load it in R. Your RAM is not going to handle it. The R is not so, let's say we are not so efficient with putting things in RAM. So then you have to maybe this space-time package wouldn't work. And I don't use it by the way because we work now exclusively with large data sets. So I will show you we're going to use the Terra extract, which will do then the space-time overlay. But my code, unfortunately, maybe not so easy because this space-time overlay, I will show you just very quickly how the code looks like. So it's a bit longer code. Don't get scared and it runs in parallel. So this is the space-time overlay for meteorological data. We have a time series of modus length surface temperatures, and we'll do a space-time overlay. And so I made this code. So it's not in a package yet, but I should put it in a package. And you see this code will run in parallel. So it runs in parallel. And I made a little function called extractsd, extract space-time. And this thing is a universal function. So this function, if you use this code with your data, it will, I promise, it's the fastest way you can overlay a large amount of points over large stacks of geotifs. And they don't even have to be stacked to exactly the same thing. They can be loose structures. So that's the space-time overlay. And then when you do after the overlay, you will get this so-called space-time regression matrix, and then you can do modeling. So I'm going to do this code today. I'm going to show you how it works. And we're going to go step by step. And then I will show you the data structure, what comes out. I will also show you when I do computing, how it goes into parallel. So we will look at it, observe it here when it goes to parallel, and so that you get the feeling that you understand what's behind. But again, I built up the thing that I showed you. I built it up on top of the package made by Robert Thomas, which is called Terra package. And this one allows, so that's this extract STUC. This is the function that allows to do very quick overlay. And it's actually magically fast. We overlay millions of points over like, I don't know, one terabyte of data, and it will take two minutes. So it's a magically fast. And this is mainly because the Terra is a program mainly in C++. It's another language that is something you should consider, but C++ is a different story. Okay, going back to the slides. So there is also a new book called Spatial Data Science. Have you heard of this book? And this is the URL. The URL is very critical, Keem Schwartz 3146c4. It's a very critical URL. Don't ask me, but Edzel is the main author. And they are writing it. You can subscribe to it and you will get the notifications every time they write a new thing and the things they discuss, you can follow it. So it's a live book. Basically they write the book and you can follow them. You can see all the mistakes they do and the fixes. So they write book in front of everyone. So it's a new age writing of science. I think it's the right way, by the way. It is a book down base. So you can see all the code, everything which you see in a code. And you see there's a chapter 13, a multivariate and spatial temporal data. I don't know how much they have, but they have, I think, only spatial temporal geostatistics. So if you go to this book, which will be cutting edge, you will not find anything basically that we are going to teach you. I don't know, very little. So everything we teach you, it's not in the book because we do the machine learning for space time. So I think we have a lot of original things for you. But maybe they will add it, I don't know, because as I said, it's open book. Maybe at one point they will say, okay, we add one chapter on space time machine learning for mapping. Okay, this is just to share the space time reference. If you use Google or any type of data in KML, keyhole markup language, then you can see how it looks like a space time reference. So you see here I have a name. This is a station, a station that we use in the first exercise. And we see that there's a measurement at some point and point has the coordinates and it has a begin and end time. And you see that's all this theoretical concept that tell you there are implemented in any software. So for me, actually, as I said, for me, now mainstream is to do space time modeling, space time analysis. And for me, any GIS where I cannot set up a space time, for me, it's a cumbersome. We cannot do our work. So we have to use only the GIS where we can do space time. And so one of the most popular GIS is the QGS. Does it support space time? Does it support space time? Do you know? Pablo, you don't think so? I don't know. There is a plugin. There is a plugin to go around it, but it's not. If you just start the QGS and you say here I have a time series, you know, you're not going to get a slider, right? That's one of the reasons why we develop original interface because you see all of our data, it has a slider. There's only a few data sets. There's no slider, but 95% of data is sliders. So as soon as you start the data, there is a slider, right? And so when you go to QGS, if I open some project, you know, you say, well, I have a, this is this temperature data. I want to slide through time. You won't get it, but there is a plugin. There's a plugin for time series data. And this is not going to animate changes. You have to play with the animation. But if you move around with the mouse, you will get the curves. You will see the curves of the values. And that's also amazing. Somebody made this plugin. What's the name of the plugin? Do you remember Camilo? No, another value for the time series. I have to also remind myself, but there is a plugin which allows to time series, time series explorer. There's a couple of plugins, but I have to actually remember which one is the one that Landro uses upstairs. Maybe please check with the Landro. So, but there is a plugin and you, there's more plugins, of course, as I said, but there is a planning plugin to put it and then you can see how the values change if you have a time series of values, how does it change through time? At the moment, if I want to see changes to try and I have to do this, I have to click on and off. That's the only way that's QGS. People that are experts in QGS, if they watch this video, they will say, no, no, no, you are doing it the wrong way, you should do like this, but officially, it's not easy to just go, hey, here's the space time data, I want to see changes. It's not easy QGS, but it's possible to set up. So, when you have a moving object, and if you may be following me now, I might sketch it on the screen there. So, when you have like something like a bird, right, bird is very complex, maybe car is better. When you say car, then the car moves to some streets, right, and goes somewhere here, goes from location A to B. But when you put it in, let's say somewhere mapped up, it's just a point moving. But you could also put it as a trajectory. So you put that line of movement, and you can put the trajectory in space time, so you can make a space time Q, something like this. So that's will be X, Y, and then this was the time, and time goes this way. So you should plot it, then you have something like trajectory moving up in time. Have you ever seen this? So I was doing that for two years when I was in Amsterdam, I was plotting this trajectory, it's a bird movement. And it's very funny because you can then in this space time Q, you can see that how this overlaps between species through time, which you wouldn't be able to see if you just have a 2D view. So you can see the density, you can rotate the cube and you can see the density where they overlap in the movement, right. And so this is also another way to look at it. And so now you have this, so you have objects, and objects have trajectories. And then you have also fields. And so what are the fields, regions? So I wrote here what could be the fields, regions, the next slide. Basically, it can be one of the three things. It can be a quantity or density of material. So it's not a physical entity. So that's like molecules, you know, quantitative molecules, let's say, you know, some element in soil. Or if you think about pH of soil, this is quantity of elements. And so these are all density. Then it can be energy flux, energy flux, because energy also moves like if you look at the heat, it moves through space, right. It's not a physical entity. It's a movement of energy. So you can also model that. And then this is where it gets a bit confusing. You can also do modeling probability for currents. And so this bird movement, I could also represent it with probability of occurrence, and then represent it as a region. Okay. But actually in the original sense, it's entities, physical entities, but I could also model them as regions. And when you look at this map, I showed you basically on the open data science viewer, this one, it's basically urban fabric. It's a physical entity, so most of land cover is physical entities, but we model that as a probability of occurrence. So if you say theoretically speaking, how could we model this? Well, we could model every house as a unique entity. You understand? If you want the total land cover, GIS, then I will model every tree, every house, everything which is a physical entity, I will model it as a physical entity. And this is maybe in about 10 years, this is how the land cover maps will look like. Because maybe 10 years in the Netherlands already they inventory all the trees, I think. Did you know that if you're not from Netherlands, they have a data set you can access. They map the whole country one to 1000 now, I think, and they mapped basically every tree. And the next thing they would chip every tree. Yes, so they know how the tree is doing, and there's already a concept called tree talker. Have you heard of it? So they put a chip on a tree and they follow the health of the tree every 10 minutes, you get the automated sensor network. And so that will be a land cover in the future, that you wouldn't map the probabilities, but you will take any object that you consider as a land cover, land use, and then you will take it through time. And so when you come to GS like this, maybe if I'm still working in maybe 15 years, we go here's the Netherlands and here are the homes that disappeared and the new homes built and that are the right, that's how the land cover maps will look like. So but this is just talking about concepts. First distinguish that there are models, space time models of objects, physical entities, and there's models of quantities and quantities can be densities or masses of volumes, or it can be energy fluxes or it can be a probability of occurrence. This is the space time cube. This data set you see here, this is this data set we're going to use here, which is this meteorological stations for creation, and you will see that when we make on the end, we will make predictions and predictions will look something like this. Now I have to actually show you that in the, because I don't have it computed, but I have to show you here. So we will make these predictions and they will look something like this. So you will see we will do space time interpolation of daily temperatures, and we will predict for every day, we will predict how the daily temperature changes. And you see these are the stations, and these are the predictions. So this is the same data set. This is this data set is shown in a space time cube. And here is shown on a 2D map. Yeah, it's not easy to match, right? You'd like, well, no, it's not the same, but they are meteorological stations and you have the measurements every day, their measurements. You see some stations, they are not, they are no measurements. So what happened here? How come there are no measurements? They had a day off on the meteorological service. No, so what we did when we first started working with this data, so I said, let's do space time. So we say meteorological data space time is high quality, is lots of data. So let's do meteorological data. And when we started working, if you look at it, they have something like 160 stations, and they may have measurements daily. Yes? So you have 365 days by 160 stations. That's a lot. When you load it in R, when I started doing, whoa, this is not going to work. It looks like it's only 160 points. But when you load all the space time data, and if you take, let's say, three years, you are suddenly loading millions of values. And that's the difference between space time and space. In space time, you get overloaded with the data very quickly. So what I had to do, just to do this plot, just to make this plot, I had to subset to think maybe 2%. This is what you see here is a 2% of something like this, because I couldn't plot it in R, and I needed it for the book and for the paper. So I said, oh, this is not going to work. Let me subset. So I just randomly took out some points. So you get an idea, but for the sake of plotting, I may be plotting here maybe 50,000 points. Sometimes when I say point, by the way, now imagine this, when I say a point, if you're in a space time modeling, then you say, well, you're talking space time points. You understand? Because the point, still in many GIS, when you say point, the point is, it's just this thing with the location, the station location. They said, that's the point. But in a space time modeling, the point is every measurement in time. So one station can have millions of points. So also be careful with that when you say, I have a problem with that point. When you do space time projects, then when you say, I have a problem with that point, they said, I have a problem with this coordinate and this time, this day. That's where I have the problem. But there's no problem just with the station coordinates. So this is this thing. Back in 2012, when I started going, let's work with space time. In this thing, we call 2D plus time. So you have two dimension and you have the time. We don't model changes above surface below whatever. We didn't model it. So we did this 2D plus time. And at that time, I work a lot with technique and geostatistics. I work with geostatistics. And one of the techniques I work a lot with, what's called regression creating or universal creating. And then I said, let's do this. Let's apply universal creating to space time data. And we managed to publish this paper. And you see there's quite smooth predictions. So we published that data set and predictions. But we did it using universal creating. It means we only use basically linear statistics. And what we're going to do here is the same, basically same thing. We do special temperature calculation, but using ensemble machine learning. So we don't use creating, et cetera. We use ensemble machine learning to do space time interpolation. And you will see it's a bit more computational. When I say a bit more computational, it's about 10,000 times more computational. But the effect that you can gain is that you can possibly increase the mapping accuracy. And that's why we, of course, use it. That's the magic. If you get the machine learning to better represent some nonlinear phenomena and to better subset and optimize fine tune parameters, then you are motivated to switch to machine learning. That's usually why people switch to machine learning. And we're going to talk about that also in the second block today and in the third block. This is the, so this is what I said what we did 2012. Fast forward, 2020. So last year, we started doing this. We prepared a 10 terabyte cloud option as GeoTiff, a Landsat time series. We get, fill it, we removed all the artifacts. We prepared it. It's a 10 terabyte dataset. Then we do space time overlay. Space time overlay takes about four hours. So Camelo, do you remember for the land cover or longer? How long will it take? No, not to overlay, just the overlay. One day. So like a 20 hours or something. So it takes 20 hours to over like 7 million points over 10 terabytes of data. Okay. You would think, wow, it's a one day. But if you try to do it with any other method, if you get it faster, we will be very much like to hear from you. This is the fastest we could get it. Imagine the fastest we could get is a one day to overlay. And then so basically one day you will leave it also overnight and we run it in parallel, right? We run it in parallel and you can parallelize maybe further, but eventually it takes a long time. So we did a space time overlay. We add also some other covariates and then we fit the model. We do space time overlay, fit the space time machine learning. And we made these predictions and this is what you see here. This is the predictions. And you know, there's people criticized as some homes, you know, they appear and disappear. So we have some places where you have a home one year and then next year there's no home. They say it's impossible, right? So there is absolutely there's noise. But we did some time series analysis to that. And when you smooth out the noise, we get accuracy on the second level and third level. It comes to 80%. So it is comparable. If you look at the Corine, let's say LandCover, this is now the state of the art European data set. So this is Corine and this is what we did. And they have also space time. So you can scroll, but it's every, I think every five years. And so, and also the polygons are quite large. And when you look at our data, we have it every year and we have 30 meter resolution. So much, much, much higher resolution. And we can update. We don't need, you know, every time they do new Corine, they start from scratch, not from scratch, but they have to, you know, get all the data and, and, and we only fit a single model. Imagine a single model to model LandCover. It's mind blowing. We had a single model. And now for the 2022, we don't need any point data. We don't need it. We only need the satellite images and the nightlight images. That's it. And we make the provision of LandCover. And so that's, that's, that's also one of the reasons to use the, the space time. And so you can play with all these things. It's super cool, super important to have this functionality to do this swiping. And so you can see the differences in different datasets. And we will keep on adding datasets. And also if you do a European project, if you produce a pan European data set that matches the specifications we use, we are most happy to host it. So we hosting it's on us. So we're most happy to host it. Let me go further. This is, this is also predictions. This is just a one tile. When we do predictions, we, we split the whole European tiles. I think it's 8,000 tiles. We use the 30 by 30 kilometer tiles. And then we do predictions and you can see this is the one, one tile in Sweden and you can see the changes at the start of the project. I was thinking, oh my God, LandCover changes 20 years Europe. Maybe you won't see so many changes. Maybe we'll think, oh, maybe this is, it will be difficult to see changes. Then when we got the results, we were surprised actually, lots of Europe is very dynamic. First you have urbanization happening in Sweden. There's a lot of, I think forest management is more dynamic than in Southern Europe. So we saw a lot of, a lot of changes. And now we're actually very excited because we would like to go back. We will go not back to the future. We would like to go back to the past and we would like to map it up to 1990s so that you can even see what was the history of Europe, LandCover wise and environmental data wise going from 1990, even 1985 if possible up to today. All these things I'm telling you, by the way, there is a paper and you can read it. It's not, it's still in review. So it's not accepted yet, so use it with a grain of salt, but more or less it's all described here and you can read. And if you want to cite this, you can, you can over the site. So one thing worth learning is that, and noting is that when you have a 2D data, you know, if you do geostatistics, you have a volume of three parameters and you have NS locations and SS was like station or space. When you have the 3D data, you have a depth, then you have four, when you do 2D plus time, then you have many more measurements. They go exponentially up. And if you do 3D plus time, then it's mind blowing. Then you have not only changes to time, but also true to vertical dimension. And then you have literally can have like a billion, so observations. And there is in our tutorial, there is a one data set also super happy. We published that paper, it's called Cook Farm data set. And this is a four dimensional GIS. So you have measurements with the automated sensor network where the sensors on different depth in soil. And you can do predictions also in 4D. And so I will show you also the here we use this altitude. So we use a depth also as a covariate. And then we model machine learning, machine learning changes using the depth. And here I show you only one prediction, I think I make the one prediction because it's of a depth of 30 centimeter. But I could make predictions through space time for the different times and for different depths. Now, how do you visualize that statically? How do you visualize the 4D when you can only do it in a paper? How do you do it? Well, it's not too bad. Let me show you how we did it. So we did this. So I downloaded all these papers locally, so I don't have to look online. So here's the papers. And this is the 2015 paper. And so how do you visualize the predictions in 4D? You have to make something like this one. So you have the, this is the time. The time. And then you have this direction and then this is the depth. And believe it or not, you can visualize that as GS, the 4D data. You can visualize in GS. In which GS you can visualize 4D data. Which is the GS that supports 4D data? Do you know? It's Google Earth. In Google Earth, you can visualize 4D data. And I will talk about this in the second block. And also tomorrow I have a session on Google Earth. So please come to Google Earth. I will show you that you can actually put these slices and you can visualize them through time. So you can see how variable changes through depth and through time. It's possible. But then you have to move to Google Earth to KML basically. But it's possible to visualize 4D data. I don't know about QGS. Time series. This is a time series example from Wikipedia. I think this is just some noise with the trend. Yes? But so they use it to visualize, this is like time series. Time series data can look something like this. It can be very noisy. When you do time, time dimension, then you have to consider I have to understand time series analysis. Time series analysis is a lot of things. I don't have time to talk about all these things. So what I just give you a really, really super short, like a one minute run through time series. So number one about time series is that lots of analysis is focused on so-called decomposition. If you look, this is the original signal, it's obvious when you look at it. So you see there's some trend component and there's some seasonality component. They can be split. You split them. Then you say, this is the trend, this is the reality. And then you have a random component. And this many time series does this decomposition. And then also how you feed this trend, which smoothing you use. How do you separate from what is the noise, what is the malation, what is trend? This is the whole science of time series analysis. One example of the time series data is the coronavirus in the Netherlands. These are the infections. There is a corona dashboard for Netherlands. And so you can go here in this dashboard. It's in Dutch, of course, but it's very well done. I don't know if your country has it, but at any stage it's kind of like in sports. You can follow the scores and tables, but it's a dark humor, of course. It's a serious thing. So you can follow the people getting into hospitals, a number of vaccinations. And these are the positive tests. So we can go. It is also GS. GS is very important, so I can go and find this is Ada. We are here. Ada Rachening. So we have 10 positives on 100,000, so that would be about four. It's about four. So four, yesterday, I don't know, four people had the coronavirus positive. And then you can follow. Unfortunately, they had also a time slider, so you can go through the time. You can slide through the time and see where in space there was more. Now it's very chaotic. It's really like leopard skin, so it's very chaotic. You used to be big cities. They used to be the hotspots, which you will expect. But now even Amsterdam has less infections than some little area in Filsland, I don't know. But this one is a time series. And this plot is, of course, wrong because it looks like the last year in March, there was less infections. So this plot is wrong, by the way. It's bias plot. And why do they give a bias plot? That's another question. I wouldn't have done it. I would have normalized it, so it gives the correct picture. But imagine the correct picture would be here is a peak. Here's a peak that goes down because then there was no testing. The testing just started, I don't know, in April or something. Then when they started testing, then it went down because there was a lockdown. And then there was the, we had the summer school here. Summer school, when we had the summer school, they started going up, but still less than now. And now it's in the, and now this was the vaccination starting somewhere here. From April, vaccination starting, then the numbers dropping, dropping, dropping. And this was the delta. Delta came from, I don't want to put geographical location, but in Netherlands, most likely via England, the delta came and delta was a big problem. But not so scary when you go back to the hospital, people having really problems, they had to go to hospital. Then you see that the delta was not as a big problem as in October last year. So it's about even like seven, eight times less. So it means the virus is less deadly for us, basically. But you see, this is the correct picture because this is in April last year. So there was probably much more infections, but there was no testing. So they never normalized the data. So that plot is actually, it's a bias plot. It doesn't show you the real picture of what you're interested in. And so you see this was the peak. So Netherlands never went back to that peak from the last year. So we went to some little peaks here and here. So you can say there were three, there were like say three distinct peaks. And then this was like a fourth, fourth milder. And this one, there's a lead, this is delta here, but less deadly. So that's, let's say some good news in a way. The reason why we're doing this workshop is that we knew that it's a less, less deadly, like way less, five times less deadly. So otherwise we would have done everything we're trying. But we said, look, it's getting people get vaccinated. Congratulations to Netherlands. Netherlands is, I think, in the five most vaccinated countries in percent, fully vaccinated. They're top five in the world. From the big, bigger countries than one million, I think there's Canada, Netherlands, Israel, so a couple of countries, they have really high vaccination rates. And I think as far as I know, 90% of people do want to get vaccinated in Netherlands. There's only 10% don't want to get vaccinated. Okay, so you see, this is the time series and you have these components and you have the trend component. So what is this trend component? So we will take a look at that and what is the similarity. So let's look at the temperature. Let's say, doesn't matter if it's surface above two meter, but the world temperature. If you look, this world temperature have these components from time series data. And one interesting component is the long term oscillations of the temperature. And they are connected also with ice ages. So this here was the ice age. Yes, so this is the ice age. Then the ice age finished about 9,000 years ago. And then you have the global mean temperature going up. But it's a gentle change. It's going from minus 0.3 to plus 0.3. So it's a change of 0.6 degrees. And this is how normally the temperature of the planet goes through this interglacial pyrus goes up and down. And there are some oscillations also here. If you want to read about this glaciation and why does the global temperature changes, it's very complex, actually, it's the whole field of physics. But what you have to know is that there is a distinct long term trend and the temperature change. And this is industrial evolution going 150 years ago. And now in this plot, that's why the industrial evolution is scary and global warming is scary. Because in this plot, you see this red line, this is what happened now with temperature. We are going to rise the temperature one and a half degree. It goes beyond this plot. It goes beyond this is a bit older plot. It's only up to year 2000. But we completely disrupted this long term trend in the global temperature. And then when you zoom into years, years and days, then you can see the temperature and also here water content. Temperature is much more regular. This is actual data. And then we just fit a spline. This is the Cook-Far data set. And we fit the spline for different depths. And super interesting. When you look at the soil, soil is like a buffer for temperature. So you see on the surface, you have higher and lower oscillations. And as you go deeper in the soil, the temperature stabilizes, oscillates more. And the soil moisture, all the way around, you have actually more smoother oscillations on surface and then more oscillation in the deeper soil. Because the water goes through the soil, it doesn't stay usually on the surface, but it goes through the soil and then accumulates somewhere. So when it accumulates, it becomes more stable. And you see there's this seasonality effect. And this is something that seasonality can happen. There's a daytime seasonality. So you have a day and night oscillations in temperature. And you have the seasonal oscillations. So that's like winter, summer, et cetera. So the temperature still has two cycles. It has the oscillations inside the day and oscillations inside the year. And they're both very systematic. There's always nights are cooler than the day, summers are warmer than the winter, et cetera. So it's always very systematic. OK, so that's the spatial temporal data. How do you visualize spatial temporal data? So you can do static plots. So some of the plots I showed you, this will be a static plot. And you can visualize four-dimensional data. It's possible. And is this objects or is this regions? Am I plotting here objects or regions? Somebody? So obviously, there's no, like, I don't use any vector structure. And we're talking about water content. Right? So water content, what did you say? It's kind of a density. So it's definitely a field. You represent it as a field. So I presented with a grid of data. So I just show what is the percent of the water in soil going from 0.15, so 15% to 60%. So there are some pixels that potentially get to 60% water, depending on the period. So that's a static visualization. And then I can do time slices. Time slices is doing something like here in the QGS. These are the time slices. When I do this, you see these are two days. This is 2006, August 15. And this is 2006, August 18. So when I produce time slices, if I do this, I visualize space time. Yes? So this is visualization using slices. So that's another way to visualize. And then the other thing we can do, we can do animation or interactive plots. And animation interactive plots, this is this thing here that you go and you create animation and you can choose your speed. You can slow down or do it faster. Yes? But you can visualize space time data. So these are the main ways, as far as I know, that you can visualize space time data. The most simple way actually is to have just one static image and then put a point of that time series data and then just show something like this. Then you just show the cross through that moment for that spatial entity. That's the most simple way to visualize. Then you simplify the data from 2D plus time, you simplify it into the time only. And you just have then the time series data. This is kind of the most simple way to visualize. And this is when you go in the data portal here. And if I, for example, click somewhere here, I don't know, then as you see, then I get this thing and this is the most easy way to visualize space time data, just having a one static image and then having a time series of the values for that specific query point. And then you will also visualize space time data, but we only know about the point. Now here's a nice example. This is the package I made years ago, but I'm very sorry. I don't maintain it so well. So I'm not sure if it runs still smooth. What I can do, I can put this data here. I can load the package. This is called a foot and mouth disease data. And as you see, I can load the data. It's in the package already. And I can pick up the points, pick up the dates, and I add to the dates. I add a new column, which is the report the day of disease. So foot and mouth is that someone UK where they observed location and time when some cow got the disease. And so that's a space time dataset. And you see I can put the data into the special temporal irregular data frame. SDIDF, this is from the space time package. So I start with having just the dataset looks like this. Let me see. So I have something like this, or it's already converted. Let me see. I have to do like this. So I have it as a simple spatial object first. So this is just a spatial point data frame. So I have the 648 observations. And I have the report the date, but it's just a spatial object. So you see that some of the coordinates, if it was not irregular, if it was a regular, then it would have been repetition in coordinates. But because an irregular, every space time point has a new coordinate. And then I could work that into the space time data frame. And then this one looks like this. So now it's a space time object. And it's a bit more complex structure because it has the data, the values. Then it has this locations and it has the time. You see, and even has some time index, etc. Okay, so it's a different, it's a higher complexity object. In this case, it's a higher complexity object, but it's the most simple extension. And it's called space time irregular data frame. It's a more simple extension because basically it's just a 2d plus time point dataset where time is not kept as a location in the SP in the SP part, but the time is kept in a separate slot, which is the time slot. And if you do it, if you do it like that, when you come to this, when you come to this example, if you use the plot KML package, you can go in and make the plot. You do plot KML. And then we create it. We create a KML file that I can open in Google Earth. And we can now look at it. If the Google Earth starts. No, maybe I'll have to restart it, but we can look at that data, how the values change through space time. Let's see. How do I kill the Google Earth? No, I think I have to check with the land or how was the installation made for Google Earth. I could try to pass this data I made. Let me just see if I can do it. What's here, I made it the dataset. And I think I can pass it to this Windows 10. And it should be visible from my windows. Yes, let's see if I can open in Windows. And I will check, I will check in the break. What's up with the Google Earth under Ubuntu. So here now we're looking at this dataset, foot and mouth disease. And here's the data. I ported it with port KML and purpose I put going from blue color to red color. Blue color is the early cases. Red color is the most recent cases. Have to remove all these other things. And so here's a space time dataset. And imagine now we can visualize it. The guys who make Google Earth, they understand statistics. So you see they have this temporal support. So I can play with the temporal support. And I can scroll to going up or forward and it will go very fast. So why do I use this visualization? Well, it's a complex thing, this foot and mouth disease. And what do you see from that foot and mouth disease? This is so at the beginning there were a couple of let's say outbreaks. So there will be only like three outbreaks and they started spreading. They're spreading all around. And then they spread also further down here. And then again, there will be just the one because here they stopped. Here more or less they stopped. And at the beginning it was very fast. Then it stopped. And then kind of a second outbreak here. And but you see interesting like this outbreak here. It happened, but then it nothing happens serious. But when I look at here, then it got again bad. And that's the way you can visualize space time data. Is this a region or other objects? Come on guys, wake up. This is obvious from the image. Well, how do I use to represent it? What do I use to represent? I use like a vector structure. So obviously these are the actual cows that observed as getting sick. And so these are kind of objects. But I could now, what could I do to convert that into grids? What could I do? Well I could calculate the density. I could for every let's say a week because it goes a couple of weeks. I mean it's over from March to August, September. I could take every week and I will calculate the density of cases like a kernel density. And then I have a time series. Yes? So anyway, but you see it's a nice thing to be able to go from R directly to Google Earth. Yeah, and you can play with that and that's something I will talk tomorrow. I will show the plot came out. And you can easily change the way you use the color. You put another color scale and you can add also elevation. I don't know. You can play with this, what we call space time aesthetics and then you can create your own resolutions. So that's the other very nice thing is the Google time lapse. So if you look at the Google time lapse, have you looked at the Google time lapse, you can pick up any location in the world. And this one is the Wageningen. And you can see last 40 years, you can see this Landsat images last 40 years, it plays animation. So I cannot zoom in more because the resolution is limited, but you can see how the Wageningen change going back all the way back from the 1980s. So it starts from 1985. And you can see that you can see also Landsat getting better. You can see campus growing, you know, so you can see campus growing. It used to be very small, of course, 1980s was like two buildings, I don't know, nothing, but with just the cows there, I think, just the farm. And now it's a big campus. So you can play the three-deframe location in the world. And there's also, of course, the Google pick up the ones that are most interesting. So that would be some really construction sites or somewhere in, I don't know, tropical forest disappearance and things. But please play with it. I don't have time for that now, so I will turn it off. But please play with it. Google time lapse, it's a history, history of the planet, except it's just history through images. There is excellent book on space time data by Oscar Perpignan. He was also in Osama still one year, but he has all these workout examples and there's tutorials. So please take a look at that if you're interested. The book is just behind the link. And lots of things, it's available just in the code so you can reproduce it with your own data. You can also make animations with it. So if you never heard of it, it's a fantastic book, slightly outdated now. There's a lot of new developments. There's the team app package, which you can watch the tutorial from our summer school last week, a tutorial by Martin Tenekes and also excellent package. And there is also animation in the tutorial. So if I look at the, if I will go back, then you can see, then you can see these animations. And there is also a book called Geocomputation with R. Also fantastic book by Robin Loveless and Jacob Ganes. So also fantastic book. And you can also read about how do you visualize space time using, for example, in your book. So you can have a book, you can make a, with R, you can make a book, online book or tutorial, which will have animations. So you visualize things with animation. So you don't have like a classical book with a static image, but you scroll through images and you will see the, you will see actually animations of things. So that's somewhere, a chat animated maps. You see some looking at the book. It's really magical that one picture in a book, it's actually animation, right? So it's not interactive animation. There will be books soon that you have interactive space time animation. So you can play with the things like the things I showed you here. Imagine if I had inside a book that you can go and play directly with Google Earth or something. So that would be also awesome. But you will soon have a book that will have that to leaflet or to some other way that you will be able to play in a book with the space time data. And with this thing, I think I'm done with everything just the conclusions. So what's important, what I said today, well, you may be no more than me, what's important, but if I can emphasize myself, what's very important to understand that the extending from space to time is not trivial. There's a lot of things you have to teach yourself, especially the time series analysis. And the second thing, prepare for the large data, jumping from space to space time can be from 10 times to 10,000 times more data. And then if you want to do space time, don't forget you cannot force any data to space time analysis. If you miss, if you miss, for example, time for some locations, you, with many data sets, we have to drop the data because so unfortunate, the surveyors didn't record the date when they went to the field. And many points we have to drop from the space time data. Sometimes when you drop so many data from space time analysis, let's say if you drop 80%, then your slippery slope, because you really are trying on force to do some analysis with the data, which is not fit for that analysis. So that's something you should also think about. And then to analyze the data, you can use geostatistics. And I showed you, I did that with the space time cringing. You can do process-based modeling, or you can do hybrid methods, and you can do machine learning. And we're going to focus this course, we're going to focus on number two, the machine learning. So we're not going to talk about process-based modeling, and we're not going to talk about geostatistics. But my interest next thing is to do hybrid methods, so to combine machine learning with process-based modeling. But that's another extra layer of complex. There are some groups that are doing it, by the way, experimentally, but that will be another, let's say, paradigm in spatial-temporal data science. And with this thing, I close the first session, I will stop the live broadcast, and then we have some time, so I stop the live broadcast, and we have some time now for questions and discussion, and also people that are online. Yeah, they were guessing good, you see, they're more awake than you. So they were guessing good, very good. I see two people said objects, and grass GS, some of them mentioned grass GS, yes. There's a space-time grass GS. Very good, Nita, thank you so much. Yes, there is a grass, space-time grass GS, and there is a leader from our summer school from last week, and also Vera is going to talk about space-time grass GS, think tomorrow, and also on Wednesday. So they will be mentioned, it's also a fantastic development that you can do space-time in grass GS. But please, if there are questions, so you people that are online, you can use the chat. If there are any questions, we have about five minutes, and then we're going to make a break half an hour, and then we continue with the modeling, so we'll start doing some modeling, and then we'll do more and more art, and it will be good that you try to follow that in the art markdown. Are there any problems with the virtual box? Do you all have it running? Virtual box, yes? Okay, screenshot, where's the error? You need to screenshot. You can customize, as I said, it's really amazing virtual box, and you see it runs very smooth, I can switch from Ubuntu to Windows, and they're not intermixed. I can exchange data, you see I can exchange data from Ubuntu, I make it in Ubuntu, and I open it in Windows, if I have a problem with Google Earth or something. So also fantastic, you see I look at the same folder, this is the same folder in the virtual box, and this one is in Ubuntu. So that's very nice with this virtual box, so when I turn it off here, I go turn it off, it will say, just save the machine's state, so always do that, don't shut down. Yes, so if I do that, it takes about 10 seconds, it will save everything that I was doing, so when I restart Ubuntu, I get exactly the same, so you lose very little time, so it's actually very robust, it's way more robust than I thought, but there was issues with the first image, first image was working, then we added some software, they didn't have Google Earth and stuff, so we added some software, we met a second image, then we had some problems, and then we resolved it eventually. So the last instruction, let's see, the Leandro, the last instruction said there was all working or functioning, now there's still some issues we will see, but these instructions that I think maybe the Leandro sent it in here, here he sent the last instructions, great news, new version, that's the last one, maybe I copied that to the, no I don't know. So this one was working, and as you see on my machine, it's not no problem to set up, there was only issue with the RAM, I think, so you can customize it a bit, so I went and customize the RAM use, so I increased, I have a 16 gig laptop, so I increased the RAM to 10 gig, and I think with 8 gig you can run everything, no problem, but in my case I increased it to 10 gig, and also I increased, do I have 12 CPUs, and I increased to using 6 CPUs on Ubuntu and 6 on my Windows, so I split the CPUs, that's kind of the good way to do it. And as you see when I start the machine, it will get me back exactly to what I need. Let me see, there's some questions, Mark Dev, yes, is the code for your demos in the, yes, so the answer is yes, a question by Nick Ham, so yes, it's all, everything I do, it's in the demo, and the demo, it's loading, the demo is here, under the R training, so everything I will do, it's here, there's no extra code, only this little code I made for the, this is the code for the foot-mouth disease data, so you can play with it, this is by the way, Mark, the MetaMode supports Markdown, so you can, if you make some code, and if you want debugging with the code, then please write it as a code, so this was the code I did to plot, and so I can send a code like this, and if I preview it, it renders the code as a code, okay, so, so you can copy paste that code now with you, and it's going to create that space time point data. Let's see, how is the Python group doing, I think it's going okay, we can watch them on YouTube, if you get bored in my session, you can watch them on the YouTube while they are going upstairs, but yes, questions. No, no, you can ask, they hear you online, they hear, it's no problem, so you can just ask here, please. Sure. Yes, yes, yes, yes, I don't know if you do this integration, so there are two parts, this one is the disaggregation, the second part is that you take all the code and that you take statistical aggregates for that polygons, so you can take a mean value, minimum value, highest value, so you take the statistical aggregates, and then you model it as a space time matrix, and then you just put the results to polygons, that's something very simple that comes to my mind, that's very simple, but they are caveats, so if the polygons are like the large polygons, small polygons, that can have different effects on the predictions, so that increases complexity. The disaggregation is another part, so you try to bring these polygon values, you desegregate them to match the grid values, and then you can use all the pixels, something I will show you today, I use all the pixels then, and I build a space time regression matrix with all pixels, but then you have to be careful about the resolution because if you get, I don't know, one billion pixels, then you cannot model it, so what I do at your P I will show you have a 30 meter resolution daytime, and then I aggregate to one kilometer, and then I bring everything to one kilometer, and then I match on the pixels and I fit machine learning, and that works. So there are two parts, the desegregation and aggregation, but when you do aggregation, then you don't take only the mean value, you should take more, more measures, and in machine learning it's very nice, you can extend, it doesn't have a problem, like in mean statistics you have problem if you have too many covariates, you have a problem if they overlap, multicollinearithmic, in machine learning, no, so you can extend not to infinity, but if it's worth it, you say, well, it helps model, extend, then you take mean, mean, minimum, you know, variation, interquantity range, whatever, you have lots of way you can aggregate. Any more questions? Very interesting question, good. Any more questions? One more? Sure. Yes, the process is very modest, then you have one state, and then basically your predictions go to a next state iteration by iteration, this is a process based model, but you implement kind of physical formulas, so you understand the process, you kind of simulate physical behavior, when in data science you don't simulate basic, data science is actually primitive, I mean primitive in a sense, ignores physics more or less, it's just you look for patterns, you have the patterns, you have correlations, you look for repeating things, you look for significance, you want to distinguish between noise and signal, so that's data science, that you don't understand. This thing we did here on the mapping the land cover, this is purely data science, we don't understand what drives the urban growth, we don't understand the processes, it would be very complex to have it for Europe, so we only have these points, and these points allows us to find, because we can find a relationship with the satellite images, and then if we find that relationship then we just apply that relationship to all the pixels, and that's how we can map, but it's data science is quite basically, it's primitive, it's kind of like data mining, looking for data patterns and relationships, but without understanding these patterns, why do I have these patterns? We just detect them, and the hybrid is that you focus the primary is the processes, you model the processes, and then you have the data, so let's say you do have a lot of data, then you re-calibrate anything about the process you do, any parameter you can re-calibrate, so you still data science, use the data science, but for calibration of the process based models, and that's super interesting.
then switching between the slides can cause the intent to show you how to do it in R. The use in Python upstairs, this Jupyter, whatever. happens, we have to restart the docker. So that's ask questions and we can slow down and we can logistics here in the week, then you should ask you that results. This is also first time we're predict the future. You can predict inside the elevation, because this is elevation as of when you read some of the tutorial, then you because we do the machine learning for space this is just to share the space time reference. use only the GIS where we can do space time. And disappeared and the new homes built and that are of the reasons to use the, the space time. And so static image and then put a point of that time support. So I can play with the temporal support. represent it? What do I use to represent? I use live broadcast, and then we have some time, so I allows us to find, because we can find a