[MUSIC] Hello everyone, and welcome back. In this lecture we're going to start into a large model builder project that we will use to guide the next few lectures. First, I'm going to show you the goal of the project, what I'm hoping to learn through this spatial analysis. And then we'll start building our tools and learn about different geoprocessing tools that we haven't used yet, but that reflect interface options in arc map that you are used to already. And then we'll also learn about model prerequisites, and then about different things that you should do while constructing your models. Throughout it we'll focus on ways to analyze the data in sort of a non destructive manner, and in also a way that you can debug or in ways that you can figure out what's going wrong when you run into problems. This will all be across many different lectures. But by the end of it I hope you'll have a good sense of how to use Model Builder for your projects and the different quirks that come with building these reusable tools. Okay, so to start with, here's our problem sort of in the abstract. We have a town boundary here in green and for those of you who've taken the previous classes, this is actually the town of Valmire again. And we have a river here in blue and another part of a river coming into the river. And this is a very large river. And in relocating this town from here, ultimately to somewhere kind of uphill over here, we want to figure out what the best new site is. And I suspect that that one major criteria that a town like this would use when finding a new location for their town is that they probably don't want to move across a major river like this. In fact, this is the Mississippi River, the largest river in the United States. And going across the river, it goes into another state, the state of Missouri where over here it's the state of Illinois. So there would be far more logistics in moving the across the river. And I suspect they'll want to stay on the same side of the river. Well, in feeding this into the statistical model I'm developing, I need a way to characterize whether or not these land units, these parcels here are on the same side of the river as the town or on a different side of the river as the town. Now, interactively I could just select the parcels on one side or another and add an attribute and call it good. But I want this to be automated, because right now I have to do this 12 times. And I want it to be reproducible and I also want it to be able to redone easily if the parameters change. We might change the search area so we have more parcels going further out, or we might add other variables and have to destroy and rebuild our model. So I want this to be totally automated. In my case, since I am a software developer, I tend to write these kinds of automated processes as code using Python. But we can also do them in Model Builder and a lot of the concepts translate. So, that's to say that, if we understand the problem with model builder, we can probably write the python code once we know python syntax and vice versa. There are few things only to show you first though, because there's some things you don't even know audio processing tools that will be necessary to use in the course of this model. So before we proceed, let's think about this a little bit. How do we take this town and then assign an attribute only to all these partials around it, but not to these ones based upon the back of the town that's on this side of this feature class and not on the other side of this feature class. It seems like a simple problem at first, but it actually took me a little while to find a good solution. There are probably many different solutions, but a lot of them are pretty clunky, maybe somewhat unreliable even as to whether or not they will always find the correct solution. But I think I have one that will always get us the correction solution. So feel free to pause the video and think about this for a little bit. We have this line running through all these parcels here. We have this polygon here, representing the town and the correct side of the river, and we need to assign an attribute to all of these parcels, but not to the ones on the other side of this major river here. Once you're ready to proceed, here's how I plan to approach this. I'm thinking that what we want to do is first mark the parcels that actually intersect with the river. So we will do a select by location and then have an attribute added that says is it a river or is it not a river for all the parcels. And I'll make it, say, a value of one when it is the river and zero when it's not. And so all these parcels right along here will get the value of one because they are where the river is. Now all the rest of these will zero. From there, this should be a contiguous line of parcels here that should break everything up. And what we can then do is run a dissolve on the parcels layer based upon the attribute of is river. Since the river layer sort of bisects the whole parcels layer, we should get one polygon way over here and another polygon over here. And so we'd have two distinct polygons for non-river, and then we'd get one big polygon running up the middle here for the is river. So we'd get three major polygons here, one on the correct side of the river, one not on the correct side of the river, and one where the river runs. And from there we can do another select by location to find the polygon that actually is on the same side of the river as this particular one here. You can also do something like a spatial join, but then you have to find the right attribute and things like that afterward. So I think a select by location gets us the fastest way of doing this. But that still doesn't get us that attribute assigned back to the parcels. So once we select the dissolved polygon by location to get only this one here, we then need to use that polygon to select by location the original parcels again, which will only select the parcels on this side of the river. And then assign a new attribute there, maybe the name on correct side of river to the value of 1, instead of value of 0, which we would set by default or something like that. So, that's my plan of attack for this. So really quickly, let's take a look at what that actually is implemented with a model as. So if I right-click on this model, and we take a look at it here, we start out with our parcels and make a copy of the input layer so that we are working non destructively especially useful testing. We add the fields for whether or not it's a river and whether or not it's on the correct side of the river and we calculate the default values. And then we load them up and do the select by location and the new field calculation for whether its the river and then some model logistics that involve the dissolve step and then the select by location of the parcels on the correct side of the river. Or excuse me, select by location of the correct dissolved polygon by the town, which then feeds into the select by location of the parcels on the correct side of the river and then the field calculation and the ultimate output layer. Models tend to make your work field look a little bigger and a little scarier than usual, and one problem here is that in this model, things aren't named very well. It doesn't really tell us what's going on. So if we wanted to come back later, say in a couple of months, and see what we did, or we wanted to send it to somebody else as an example of a workflow, this doesn't really document it very well. So what we're going to want to do when we build this ourselves, is actually name things a little better, because it makes it much easier to follow and feel like much less of a big clunky scary thing. So that's it for this time where we just laid out the problem and what we're going to do in the next few lectures and what we're going to learn. And in the next lecture, we're going to actually start in on building this model. Okay, see you there,