So this module will build off of the preceding one on topography.
And we're gonna work more on spacial modeling, so
combining multiple different layers together into some sort of analysis.
Now there's lots of different things we can do under the subfield of spacial
analysis or spatial modeling.
And really, this is a set of methods whose results change when the locations of
the objects being analyzed changes.
So it's deriving information from data using any distributions or patterns, and
then combining those together into a way that gives us
one particular thing that we're trying to understand.
So a model is essentially a representation of reality,
it's not always gonna be perfect.
It's never gonna be completely perfect, since it's a simplified,
manageable way to view reality and to help us understand, describe, or
predict a particular thing, how something works in the real world.
So if we wanted to model something like erosion,
we would combine together multiple layers into it.
But the field of spatial analysis is more than just combining different layers
together.
There are several different analytical techniques under the field of spatial
analysis that I wanted to discuss in
this module because we're gonna work with them during demonstration.
Some of these we've seen before.
If you remember from module three when we did the interactive selections on vector
data, this is a type of spatial analysis.
We're using multiple layers together to sort of understand one characteristic of
one layer or how they interact together.
So this would be a relatively simple form of this, but
it's a type of analysis that we can do.
So this is where we would say select all of
the cities that fall within ten kilometers of a lake or a river.
We can do all of this sorts of analysis on the fly in the program itself.
But what I want to extend on this is something called a spacial join.
And just like we did joins with with tables, where we join two tables together.
We can also do this based on spacial location.
Essentially a spacial join is a way of making a permanent relationship
between these two different layers.
We're going to take the information from one layer and put it into the attribute
table for the other layer based on some sort of spacial relationship between them.
So we can calculate this based on pretty much anything we can do the selections on,
so within, nearby, intersects, all of those different things.
We can do the same sorts of calculations and create the spacial join out of them.
So let's just do a quick example of this.
This is the same data that we worked with in module three.
We have rivers, lakes, states, and cities of the U.S. and Mexico and Canada.
And we wanna say,
find the closest river to every city and how far away it is from that city.
So we have our city shape file where we have the names,
we have our river shape file where we have the names of the rivers.
So if we run the spacial join command, the same way we would a regular join.
What we'll end up with is a new shape file with the nearest river and
the distance to that river in the shape file of our cities.
For every city we know what river is closest and what our way is.
Now another type of analysis we can do, which is somewhere between a vector
analysis and a raster analysis, is something called zonal statistics.
Now zonal statistics, is essential summarizes the variation in a raster,
based on the areas we give it from either a vector model or a classified roster.
So these are more commonly done with polygon shape files.
But you could do them with some sort of classified raster if you really wanted to.
Now, the output is either going to be a new raster image that summarizes that
value across the entire area or it's gonna be a summary table for you.
So what this might look like is here if we have all of the USGS quadrangles, so
sort of regions of northern Indiana here, with a topographic layer underneath them.
So what we're seeing a transparent polygon shape file with topography underneath it,
what we might wanna do is find out what's the average elevation for
each one of this quadrangles.
We can do that with zonal statistics, we're bringing in the zonal data,
we're bringing in the field that we wanna use which is just elevation.
We're bring in the rastering that we want to summarize, and we're bringing in
the field from the original shape pallet that we want to use as the names.
And what we'll end up with is a raster that looks like this where the only
value for that raster is the individual the mean across that entire area.
Now, the raster itself I don't think is particularly useful.
There's a lot of repeated data in there.
It's something that would probably be better summarized by a table,
unless you were going to use it in a further analysis.
So you can do it for from a table as well.
And we'll run both of these commands during the demonstration for this module.
But when it generates the summary table it gives you all of the different values.
So it's gonna give you the mean, the max, the number of pixels that
were in that zone, the area all of these different things.
So it gives you a much more robust dataset that you can then use to create a summary
report of the variation across those different polygons.
Now, to turn to talk a little bit about, more directly,
raster-based analysis, one that's really commonly done are distance analysis.
So if we wanted to, say, find out how far away we are at any given spot from
one location, say Notre Dame campus, or something like that.
We can do a couple of different ways of understanding the distance there.
One of these is what we call a euclidean distance.
This is, essentially,
a straight line, as the crow flies is the sort of colloquial way we refer to this.
And it's basically the straight line distance between two points on a plane.
Calculated using the pythagorean theorem.
So it's relatively simple math, it's something we're used to thinking about,
but it creates a new raster image where the only value for
each cell is the distance from whatever it is we were trying to measure.
So here, if we had five cities in the US named Columbia, and we wanted to find
out how far away in the US we are from any city named Columbia, we can do that.
We can create a raster with the distance from
all of those features is the only pixel value.
We're not limited to doing this with points, we can do it from lines as well so
if we wanted to find out how far away, for any place in the entire US.
How far away we are from the Mississippi River we could do that also.
And you can see that the places where
the values change sort of mirror the geography of the river as well.
But we're not even limited to this, we can do it for polygons also.
So in this case, we've wanted to find out how far away we are from Missouri
at any point in the US, we can do that.
Anything that's within Missouri is gonna be a zero,
anything that's further out is gonna be increasing distance from
whenever the closest vertex on the edge of that polygon is.
Now, in the real world, euclidean distance is not often as important
as how hard it is to get between two places.
It is very rare that we are going to be able to follow a perfectly straight line
distance between two points.
Topography is going to be bad, there might be hills,
there might be buildings in the way.
There might be all sorts of things,
there might be shrubs that make us want to go around certain things.
So we might want to use another layer to kind of weight
how easy it is to travel across a particular surface.
And this is something we call cost weighted distance analysis.
Where the cost raster is another raster dataset that just indicates how
hard it is to travel across that surface.
So we can use this to create a cumulative cost of traveling from
one cell to another, across that raster to a particular destination.
Now as an example of this let's return to looking like we did in the preceding
module at Crater Lake a little bit.
As an example you if you wanted to go from the north edge of Crater Lake to the south
edge the euclidean distance would be straight across there.
That is completely impossible to travel.
You're gonna have to actually go down off the mountain, around, and
come back up is gonna be the easiest way.
And this is based on the slope, this is based on perhaps
some aspect of the fact we can't walk on water, other aspects in there.
So we need to be able to have some way of weighting this.
So we can understand how easy it is to travel across the surface.
So, let's look at an example here.
So, say we wanted to walk between the University of Notre Dame's library, and
a park that's just a little bit outside of campus here.
So we have a map sort of showing these.
It would look like the straight line distance if we calculated euclidean
distance would be relatively short and pretty easy to pass.
But if we look at the topography of that area,
we see that there's a hill in the way.
And it may be that it's easier to walk around that hill than to try to traverse
that difficult terrain.
So we could weight it just simply based on the slope, if the slope is high,
it's gonna be harder to pass.
If the slope is low, it's gonna be easy to pass,
if it's flat, it's gonna be very easy to pass.
So this is a simple way of weighting cost into these distance measurements and
something that we're gonna work on in the demonstration.
So this would be what cost-weighted distance looks like, between those
two points, and what I really wanna stress here is that this is no longer distance,
or this is not distance in a meter-based sort of thing.
This is ease of travel that it's showing us, so it's related to distance, but
it's no longer the same thing.
We can't just put meters on the values in this cost weighted distance raster.
So, we can see that the ease of traffic, the ease of passage actually does take
us around that hill, and if we wanted to look at what the ideal path would be.
Based on the cost weighted distance, this is what it would look like so
we actually want to follow it around those hills instead of traversing them directly.
Now the last type of analysis that I want to talk about is the most complicated and
this is what we really call spatial modeling.
This is where we're combining multiple different things together to give us
one measure of something in the real world that we might want to understand.
So this is a process we call raster algebra, are more complex calculations.
We're combining multiple layers together to model something.
So these layers can be weighted based on their importance.
They need to be processed independently to reflect
their importance to the final model, and this is a process we call reclassifying.
So we're gonna take something that used to maybe span from negative 1,000 to 1,000
and make it so that it's sort of scaled from one to ten.
Then we'll do that for another layer that might have been 5 to 15,
scale that to one to ten.
That way we get them into same units so
we can combine them together more effectively.
The process of reclassifying is essentially systematically new values to
a raster image based on ranges of the old values that are in there.
We can use this to adjust old layers to the same scale, we could use it to rank
differences, different values based on their importance to the final model.
So we had something that was just classified, we had something like soils.
We might wanna just simply go through and say, sand is high,
silt is low, sand is tan, silt is one or something like that.
So we have two different types of reclassifications that we work when
we're doing this.
We have a ranked one, where we're sort of ranking things from, say,
one to five or one to ten or 1 to 100.
So we decide what the ranks would be, this is where the sort of art behind it
comes in, when the understanding of the field that you're taking,
that you're trying to do your analysis in is important.
And then we scale these different variables, these different types of data,
to the same scale, and then combine them into the model.
In contrast, we can also do what's called a binary reclassification,
where weighting a character is either possible or not possible.
When we were talking before about traversing Crater Lake, I think it would
be fair to classify everything that's water as not possible to travel across.
So that would actually be something where we'd want to have water and
not water as two distinct classes, yeah.
So we would then multiply those two variables together or add them together in
a way that's going to give us a better understanding of that particular thing.
So I think the best way to understand the spacial modeling process is
to work through an example.
And the example that we're gonna work with is how to find good locations,
possible locations for solar panels on the Notre Dame campus.
So if we're gonna do this,
what we wanna do is combine together multiple different layers into something
that gives us a final layer that just says potential locations for these things.
This is a very, very simple model that I'm using as an example.
We're gonna really only combine together three things.
We wanna have these things in a location where they're facing south,
because there's more southern exposure.
There's more sun that they get if they're facing south.
We wanna have them in areas that are relatively steeply sloped.
So that there's a wider area that they can be put in a smaller sort of footprint.
We want to have them located a little bit farther away from roads,
both because they are not always aesthetically pleasing things.
But also because we don't want to have real over interest or
damage done to them by anything coming from the roads.
So we're gonna bring in a few different data layers,
reclassify them, turn them into the submodels that we need, and
then combine those submodels into the final model.
And the original data, all we really need are a shape file
showing us where roads are, and the elevation from the DEM.
So we can use that to calculate both the slope and the aspect.
So we're gonna manipulate those original two data layers into something that we
combine together.
Combine those three manipulated things into our final model.
So this is our DEM for the region, shows elevation.
This is the first data layer we wanna process.
First, we're gonna calculate a slope raster from it, which you can see here.
Sort of scaled from green to red, and then we're going to reclassify that
in to areas that are either with a slope of greater than three degrees or
areas that are lower than three degrees.
So a value of one means it's suitable,
it's greater than, greater than three degrees slope an area or value of zero is
means its less than three degrees of slope and it's not suitable for solar panels.
So these are sort of symbolized here in green and
purple, green is good and purple is not good one and zero.
We can also create that aspect layer using the DEM.
Which we see here, and
then we can reclassify this into the image that we actually need, which is aspects
of sort of southern facings, of south, and southwest, and southeast.
So we see these in purple here, or sort of pink.
The pink ones are good aspects, south facing slopes.
The blue areas are less suitable,
these are areas that are facing to the northeast or to the west.
So the last layer that we want to bring in is our roads layer, so distance from
roads and this is a vector shapefile showing the roads sorted as a base layer.
That we wanna then calculate an euclidean distance from
to be able to understand what the distance is then reclassify that into our model.
So this is euclidean distance from any one of those roads,
and then we've reclassified that so
that anything that's greater than 1.5 kilometers away from a road is suitable.
Anything that's less than that is not suitable so that gets a one and
gets a zero.
So there are two different things that we can do now for our final calculation.
If we multiply these three layers together,
we're going to get something that's either zero or one.
If something's one in one layer and
zero in the other two, it's going to become a zero.
If it's one in two layers and then zero in the last layer,
it's still going to become a zero.
So it's either suitable or not, or we can add them together and
sort of have a ranked view.
If it's a three, then it's really suitable,
it hits all three of the characteristics.
If it's a two, it hits two of them, if it's a one, it hits one of them.
So let's look at what both of these might look like.
This is our final model if we just use either suitable or unsuitable.
We have not a lot of areas, you can see them in blue here.
There's some little spots in the north, and
some little spots in the south and the west.
And the overwhelming area is not suitable in one of the three characteristics.
If we add them together, it looks a little bit different.
We have some areas that are very, very highly suitable.
It's the exact same ones,
anything that has a three in this one also had a one in the proceeding one.
But then we have things that are in there as sort of the darker browns,
all the way down to zero.
Those are really unsuitable areas, they're very dark brown.
The lighter browns kind of tans are ones and
twos, so there are different ways that we can rank the final thing.
Depending on what we want to be using the model for.
So spacial modeling is not just combining three layers all the time.
It can be many, many layers, it could be just one, it could be multiple different
things depending on what the question is that you want to address.
We're gonna follow this particular module with the next one we're gonna look at
a specialized version of this and that's hydro-logical modeling.