Global raster operators take into consideration every single cell in a raster dataset in order to do a calculation for any one cell in that dataset. I think this is actually retarded, but I've put this in here anyway. So, this is just to match the other sections I've done on local, focal, and zonal operations, where the red cells are the ones that are being considered as part of the calculation. So, this is just to emphasize that point that for any one cell here, all of the cells have to be taken into consideration. So, I'll give you a couple of examples of functions tools that are examples of global operations, and how you might use them in an analytical scenario. Euclidean distance is probably one of the most useful and most commonly used global raster operators because it's great to be able to determine distances away from things. Okay? So, how this works is, is that you start with a data set like this, where you have cells that have a value. Because these are one cell each, you can imagine they would represent some point thing like say, let's call them shopping malls. The important thing here as an input to the Euclidean distance is that you want, cells that you want to measure distances away from to have a value, and everything else to be no data. So, that's what we have here. Now, it doesn't matter what those cell values are necessary. They could have different values, they can have any value at all, the fact is that they just have a value and everything else is no data, or blank let's say. So, this is the result that you get when you've done the Euclidean distance operation. What's happening is that the software is calculating the distance from every cell in this data set to the closest shopping mall. So, part of the reason I show this is that, it is a good example of a global operator. So, what we're seeing here is that let's say, for this cell here, this is the starting point. So, the distance to itself is going to be zero, and we're just using distances in cells, but it could be based on spatial resolution like 10 meters, 20 meters, whatever. So, this is one cell away, two cells away, and so, it's measuring that by the way from cell center, to cell center. So, for any location, you're getting the distance to the closest cell that has a value. So, here, for example, we have a two because it's closer to this one, than it is to that one, so that's why you get that. So, it's packing in at least the way I think of it, it's a lot of information, because it's showing us the distance from any location in our data set to the closest feature of interest. So, why is this a global operator? Is that when it's doing the calculations, it has to for every single cell that it needs to get a distance value for, it has to say, "Well, how close is the closest cell value that I'm calculating from?" So, it goes through there and says, ''Oh, there's one there, that's one.'' So, it keeps track of that, it keeps going through until it gets to the next one, oh, there's another one, keeps going until it gets to there. So, it has to find all of the potential points that it's measuring distances from, measure all of those distances, figure out which one is closest, and then put that value in the cell. So, in order for it to get an answer for that one cell, it actually has to consider all of the cells, and all of the distances, in order to know which one is the correct answer. So, that's what makes it a global operator. So, let's try a little more realistic scenario. So, for example, maybe I'm interested in knowing how far I have to go to get to an area that's heavily vegetated. So, in this case here, I've got NDVI values of five, those are the highest in my class range from one to five, where one is the least or the lowest NDVI value, class five is the highest. What would be really nice is to do a calculation of what's the average distance I have to go for each neighborhood in Toronto. So, that would be a way of characterizing the neighborhoods in terms of access to green space. Just in a general example way. So, we can take our Euclidean distance tool, we'll put in our NDVI five as our inputs, we're going to have a new output, that's going to be NDVI five distance. I'm not going to set a maximum distance, otherwise, I'm going to let it go as far as it needs to go in order to do the calculation, and I'm going to set the output cell size to be the same as the input cell size. In this case, it happens to be 30 meters. This has to do with the fact that the original data I'm basing the NDVI off of was the Landsat seven image, which has a spatial resolution of 30 meters. So, I'm just keeping it at that spatial resolution so that everything's consistent. We don't have to worry about an output direction raster, that's not needed for this, so we'll leave that part out. So, here's the Euclidean distance result that we get for this. So, you'll see that the distances are, blue is a low distance, red is a high, I'm using the dreaded rainbow color scheme here, which as I've probably mentioned in other videos, is not one that I highly recommend for most cartographic purposes, but sometimes it's useful to be able to visualize big differences or things like that quickly. So, that's what I'm doing here. So, in other words, here you can see that the red areas are the farthest away from a class five area. If we zoom in here, maybe you will notice something. What this is doing is calculating Euclidean distance from every single cell that has an NDVI five value. That may not be exactly what I had in mind when I was thinking about access to green space and areas that have a lot of vegetation. In other words, if you look at areas like this where there's just one little cell that has a value of five. So yes, that particular little patch may have an NDVI value five, but is that really useful in terms of me thinking, ''Oh, if I walked that little 30 meter by 30-meter patch, I would be able to enjoy some beautiful green space?'' Probably not, right? Yes, for someplace like high park over here, that would make sense, or something like this, that would make sense. But these tiny little ones, probably not. So, maybe there's a way that I can try to filter out, or remove these small little patches and keep the big ones. So now, our task just to work through this analytical scenario, is to find the patches that are NDVI five, but only larger ones. In order to do this, I'm going to use a different global operator which is known as Region group. This is a very handy useful tool that I highly recommend that you get used to, knowing what it does, and knowing when you might want to use it. So, I'll show you how this works. So, in my input dataset here on the left, we have zones with regions. Right? So, we have three different zones, zones one, two, and three, and each of those zones has its own region. So, for example, in zone one, this is a region, this is a region, and this is a region, and they're all together part of zone one. Right? In zone three, for example, this is a region and this region. What region group does, is it converts regions into zones. So, in our input where this is a region, this is a region, and this is a region, now these are all their own zones. We have zones one, three, and five. So, what this tells us, is that we now have a unique identifier for each separate contiguous area within our raster data set. This can be extremely useful. So, what this is doing by the way, just so you kind of see how this relates to a global operator, is that for every cell in the data set, the software goes through and says, "Does this one have a value? No, it's no data, okay, we'll ignore it. Does this one have one? No, we'll ignore it." It works its way across until it comes to one that has value. So, when it sees one that has a value, it says, ''Oh, what is that value?'' ''Oh, it's a two.'' It continues to go through, and it works its way along. What it's basically doing is keeping track of all of the cells that have values, then testing to see if they're contiguous with each other, and then assigning each one of those, it's own unique values. So, that's why typically with software, it starts in the upper left and works its way down to the bottom right. So actually, I suppose here, this should have been a cell value one, but it wasn't in this case. So, here's our one, here is our two, here is our three, and it works its way down. So, this is all contiguous, so this is a four, five, and a six. So, the reason this is particularly useful is, we now have a way of separately identifying every single contiguous thing in our raster data set. In my mind, I always think of, this is as close as you're going to get in a raster environment to be able to click on something like you would like a vector polygon and being able to do something with it on its own. So, now that we have these separately, we can use them to do lots of different types of operations. So, let's apply a region group to our class five raster data set. It's pretty straightforward. We just use the region group tool, we tell it to use the NDVI five as our inputs, and then we have a new file as our output, which is NDVI five region group, you can name this whatever you want. I'm specifying that I'm going to use eight, which is another way of saying queen's case, and this is important with region group. You have to really make sure that this is doing what you want it to do. What this will do is for every cell that has a value, it's going to check all of the cells around it to see are they contiguous and treat them that way. If I used four as the other option which is rooks case, it would only treat as contiguous the ones that are vertically or horizontally connected. In this situation, especially with natural features like forested areas, or vegetation, it makes more sense to me to use the Queen's case. I'm going to do zone grouping method which is within, which just means that I'm going to test for connectivity amongst all of the values. It doesn't really make a difference here, because they only have one value. So, that's fine the way it is. So, here's my NDVI five class before, and here's the region group version of this. So, I've used the crazy rainbow color again partially, so that it's really easy to see that there's differences between these. So, in other words, what we have here now are regions that have now been turned into zones. So, every single spatially separate but contiguous set of cells has its own value. Now, why is this important? One reason for this is that now each of these has its own ID value, and if it has its own ID value, I can treat them as separate things. I could use them as zones for example, or I can as we'll see, use them to separate them out from one another based on size. Now, to do that, I'm going to use the extract by attributes tool, and all that does is say, okay, I've got an input raster here, which is my region group version. I'm going to extract based on a query statement, what this is calling here a where clause, where I'm looking for regions that are now zones, that have a count greater than or equal to 100 cells. So, in other words, I'm trying to find a way of isolating out just the larger patches that are 100 cells or larger. You can just click on the little SQL button here, if you're not sure how to build that query statement, you can just click on each part over here, like, I could say, "Here's my count field, I'm going to use that." I could use the greater than or equal tool thing here. That builds the statement here, when I click okay, that just puts it back up into there. So here's my region group before, extracting by attributes, and here's what it looks like afterward. So, ta-da, it did what I expected it to do, so that's great. So now, I've only kept the larger regions. Now, why do I want to do that? Because what I'm interested in is I'd like to characterize neighborhoods based on how far you have to go to be able to get to an NDVI five, area that's greater than 100 cells. So, here's my values and counts, and you'll notice here at the bottom that we have 419 different values. That means that there's actually 419 different regions which are now zones, that are 100 cells or larger in my data set. Okay, so, now, I've just given them a color that consistent with what I was using before, so these are the NDVI fives that are larger than 100 cells. I can apply my Euclidean distance tool to those now using the same settings as before, and there's the results. So, this is a little more realistic because you can see that we don't have any of those tiny little single, or two, or three cells, or whatever, obviously everything less than 100. So, this makes more sense to us, as now we have Euclidean distances for every cell in our data set that tells me the distance to the nearest patch of NDVI five greater than 100. So, now, I can use that as an input to my zonal statistics for the neighborhoods. So, I'm going to use the neighborhoods as my zones based on the name, and I'm going to use my distance for 100, that's the for the NDVI five as my input value raster. I'm going to create a new data set that's going to be the zonal statistics for that. I'm going to use the mean here so that I'm getting the average distance for each of the neighborhoods. So, here's my Euclidean distances, and here's the mean based on those values for distances to the neighborhood. So, I've used the same rainbow color scheme as I did for the Euclidean distance, just so you can quickly make the connection between areas that are closer, versus ones that are farther. So, red is farther, blue is closer, but really in the end, when I'm trying to make a map that I want to produce for other people to see, it's better to use a more traditional color scheme or choropleth like this. So, this is exactly the same data. I've just made it look a little different so that the areas that are farthest away or darkest, because in this case, I'm thinking of that as, well, the ones that are farthest away would be of highest concern, of most interest, versus ones that are closer, which have a lighter color. So, you can see it's apparently areas downtown are farthest from large areas of NDVI five. In this case, this would be a ravine system. So, that answers our question. This gives us an example of how to use a couple of different global operators, so we have the Euclidean distance as well as the region group. I tried to give you a typical scenario when these might be used, especially the region group which is a really handy tool.