You can measure distances with raster data using something called Euclidean distance. To show you how this works, I've got some data for library locations in the city of Toronto. If I created a vector buffer just for comparison sake here, I've got my vector buffer I'm going to make for libraries. I'm going to use a distance of 1,000 meters. I'm going to dissolve them and this is the result that I get and the thing about vector versus raster, and this is why I want to make this comparison. Is that with vector buffers, it's literally a discrete boundary. So, all we can really say once we've completed this, is that something is either at that distance, it's less than that of distance, or it's more than that distance. But if I have something here, I don't know how far away that is from the closest library. Even if it's inside this distance, all I know is that it's within that set distance. I don't know what that distance actually is at any given location. So, vector is great, it works really well, but it has its limitations whereas raster as you can see where I'm going with this, gives you a much more full, richer data set. If we use the Euclidean distance tool, I'm going to use the same inputs, so you can use vector data as input to a raster operation depending on which one it is, and I'm going to create an output called library. In this case it's short for Euclidean distance, and this is raster data. I'm not going to set a maximum distance but I do have to set the cell size, and I'm going to go with 30 meters. I use that a lot because I've worked with a lot of satellite imagery that said that spatial resolution. So, it's one. That's a go-to size for me but you can choose other ones if you want. So, this is the result that we get. So, this is of course very different than you're going to get from vectors that we're actually getting. For every cell location in our data set, we're getting the distance to the closest library point. If I compare that to vector, I'm just zooming in here, you can see that okay, all we have with vector is its either inside or it's outside, but with our raster we have all values for every single cell in our data set with the actual distance to that location. I will tell you if I zoom out here again that I don't often use this hot to cold or as some people call it the rainbow color ramp, but here I wanted to use it intentionally to show you the gradation of values very easily from close to far. I wouldn't normally recommend using this too much but here I think it might be useful. How are these distances measured with raster? The distances are measured from cell-center to cell-center. That's what we're showing here. So, for example, if you have a point which is represented by a cell here, which of course is zero distance to itself, and then you have a cell resolution of one meter, then the distance to that cell center is one meter, the distance of that cell center an additional meter, and so on. If it is 10 meter resolution, then it is going to be 10 meters, 20 meters, 30 meters. For the diagonal distances, we just use the Pythagorean theorem. Again, you don't have to do these things yourself. It's just for me to show you how the calculations are actually done. So, you have an appreciation of how the numbers are generated, and the result is that if you look at the red squares as being the original points in this case libraries, what happens once the Euclidean distance function is complete, is that it's providing a cell value for every cell in the data set, that is the distance to the closest point. So, now when I say we have a fuller more richer data set, what that means is for any given location in our data set, we can say what's the cell value there, and then we automatically know the distance to the closest point. So, that's how Euclidean distance works. While we're talking about Euclidean distance, we might as well mention Thiessen polygons. They're a simple but powerful and popular way of finding out what things are closest to what. Let me show you how that works, okay? So, here we have our libraries. Here we have our Euclidean distances, and you may notice that again with this crazy color scheme that I've got, that you can see the locations are the lines where there's these light blue areas here and here, and you can see it over there, and what this is actually showing is what is the maximum distance between two features? So, that's the line that's equal distance from this library versus that library. If you do that for all of them, and you connect those together, you end up with what are known as Thiessen polygons. If I zoom out here you can see them for all the libraries in Toronto, and I can actually convert these to vector which I've done here just because they look nice. So, what this is, is that there's lots of ways that these get used but essentially what this comes down to, is that if you have a point that is inside this Thiessen polygon, then you automatically know that this point is closer to this library than to any other library. That's really the fundamental thing about Thiessen polygons and they get used all the time for things like, it's a simplistic assumption sometimes but for example, you might say well if I lived in this Thiessen polygon, I'm most likely to use the library that's closest to me, and so you could use that to say count up the number of people that are inside that Thiessen polygon, to say well, how many people are most likely to use that library versus another one, there's lots of reasons why that may not actually be true. It could have to do with access or parking or hours, but it is a simple distance analysis that gets used, if nothing else that's as a starting point to get the conversation going about well, if we started from there, how could we then make this a little more sophisticated or nuanced from there but it's always a good thing to know if Thiessen polygons exist and that they are simple but useful. How do they work? Well, if these cells represent our inputs, so these could be libraries or whatever it happens to be, then for every cell that's near that it says well, what's the distance from there to the closest cell with a value, and as we can see here the result is that all of the cells that are closest to there, so this one, that one, and so on, get the same value as that point. So, what that's essentially delineating is that all of the cells that are in yellow here are closer to this original set of cell. These are all closer to that one, and these twos are all closer to that original two. That's essentially, if you're thinking about just basically the the logic behind it that's how it works. So, often these are referred to as regions of influence. Again, if you just think of this simplistic assumption that distance will be an overriding factor that will influence the decision that's made or whatever it happens to be, then you can think of these Thiessen polygons as these regions of influence, and that every location inside a Thiessen polygon is closer to the source point than to any other point. That's just a way of summarizing what I was just showing you. A great example of Thiessen polygons was the application that was done by John Snow. This was in the 1800's when he was looking at the horrific number of cholera deaths and how they might be related to which drinking water pump people were using, and I always found it fascinating that this spacial analysis was being done long ago, long before GIS software, but if you create these as he did, these Thiessen polygons around each of the pumps, then it's a way of narrowing down, or isolating, or identifying if you lived inside this Thiessen polygon, you're more likely to use the closest pump, in this case the Broad Street pump, to get your water. It was not the only way that he did his analysis and if you aren't familiar with the story, essentially what he was trying to find out was how did cholera get spread, it turned out it was through contaminated pump. There's a long fascinating story behind that, but one of the things he did to generate evidence to show how this might work was that he created these Thiessen polygons to show that most of the people that were within the closest distance of the Broad Street pump, were most of the people that were being affected by this or dying from it, and that was part of the argument that he made to try and convince officials to shut down that pump, prevent people from using it, and to help prevent more deaths. So, just nice, well not a nice but an interesting example of the application of Thiessen polygons.