[MUSIC] Hello everyone and welcome back. In this lecture, we're going to start into a large ModelBuilder 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 ArcMap 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 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 ModelBuilder 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 Valmeyer 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 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 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 this town across the river, and I suspect that 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 characterized whether or not this land unit, this 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 be 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 on how 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 this kinds of automated processes code using Python but we can also do them in ModelBuilder and a lot of the concepts translate. So that's to say that if we understand the problem with ModelBuilder, we can probably write the Python code once we know Python syntax and vice versa. There are a few things I'll need to show you first though, because there are some things you don't even know are geoprocessing 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 of these parcels around it but not to these ones based upon the fact that the town is on this side of this feature class and not on this 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 correct solution. So feel free to pause the video and think about this for a little bit. We have this line running through through all these parcels here. We have this polygon here representing the correct, or the town, and the correct side of the river. And we need to assign an attribute to all these parcels but not to the ones on the other side of this major river here. Okay. And once you are 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 basically 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 the value of 1 when it is the river and 0 when it's not. And so all these parcels right along here will get the value of 1 because they are where the river is and all the rest of these will be 0. 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 have two distinct polygons for none river and we'll get one big polygon running up the middle here for the is_river. So we get three major polygons here, one on the correct side of the river, one on the incorrect 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 afterwards. So, I think a Select By Location gets us a 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 named 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 the model has. So if I right click on this model and we take a look at here, we start up with our parcels and make a copy of the input layers that we're working non-destructively, especially use for. We add the fields for the whether or not it's a river or whether or not it's on the correct side of the river. And then, we calculate the default values and then we load them up and do the Select By Location and the new field calculation for whether it's the river. And then, some model logistics which also involve the dissolve step. And then, the Select By Location of the parcels on the correct side of the river or excuse me, the 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. Model tends to make your work flow 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 want to come back later, say in a couple of months, and see what we did or want to send it to somebody else as an example of 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.