[MUSIC] Hello, everyone and welcome back. In this lecture, we're going to continue where we left off last time with the big model we're building to determine which side of the river specific parcels are on and whether they're on the same side of the river as an original town boundary. So, where we left off last time, we had been using the copy features, add field, and calculate field tool in order to add a default field on our parcels layer that says whether or not it's a river and it fills that with 0s now, saying that none of these parcels are rivers. So let's continue on with that, and actually make that a real value. And by that, I mean let's find which parcels actually are the river and fill the is river field with the value 1 where the parcel is a river. So to do that, though, we need to do a little bit of a weird workaround. While I want to be able to use Selections to select by location the parcels that are in line with the river, I can't do that with just a feature class. A feature class only exists on my disk. And that's what we're using right now, so we're using feature classes. So instead, what I need to do is make a feature layer. Now, a feature layer is a lot like what we're seeing here in our table of contents, it's a feature class that's loaded into memory and has some properties related to it and can be used in an analysis such as a selection workflow. Now, this one might already be a feature layer but if I want to be able to provide the quick parameters to people in the future when they run this tool, the Copy Features tool can take feature causes as input. So, I need to make it a feature layer just to make sure. So let's actually move this back over here. And let's go search for the Make Feature layer tool. And once again, I can just drag and drop it onto the canvas. And I'm going to connect that last parcel's layer here to the Make Feature Layer tool, as the Input Features. And in this case, I'm going to just name it parcels_layer, call it OK. And let's make the output layer called parcels layer as well. That's what we're going to reference in the future, is this parcels layer will be the name basically of our feature class but of our feature layer that we use when we're working with it in other tools. Okay and now that we have a feature layer, we can actually run selections on it. So again, we're going to look at another tool that we have used in interface but that we have yet to use in geoprocessing which is the Select Layer By Location tool. Or otherwise known as Select By Location when we've used it in the selection Select By Location menu. And when I double click it, again, it looks a little different but all the same options are there. I can have my layer being selected. The selecting features. I can have a relationship type like we're used to. A search distance and the selection type whether it's new or whether we're adding to an existing selection or what. So let's cancel out of that for a moment. And we're going to just provide this as the Input Feature Layer. And then to get the other one for now, let's right click on it and do Make Variable From Parameter and then Selecting Features. So, I want to show the Selecting Features on the canvas without having specified it yet. Maybe I don't actually have it defined yet, or what, but I haven't maybe loaded it up. And what I can do now, after I've made it a variable so it shows up on my canvas, is I can right-click and make it a Model Parameter and I can do the same for the parcels layer so that in the future when this is run, both of these can be provided as parameters to a geoprocessing tool. And I could have done this another way. I could have dragged the rivers layer onto the canvas and then connected it just like we did before but I wanted to make sure you knew all the different ways to get these variables to show up on your model canvas here. And now, I can double-click it, and I can select the major rivers layer in my tool here. And I'll rename it and call it Rivers. And I'll rename this and call it Parcels so that should anybody use it in the future, that's what's going to show up when they run the geoprocessing tool. So if I save it and go take a look at our tool here and double-click it, I see Rivers and Parcels. Okay, so now, we've provided two inputs to this tool from our geoprocessing work flow. We provided the parcels layer and the rivers layer and it says it's ready to run but let's make sure we've set all the options. So in order to find the parcels that have a river running through them, I'm going to select the Parcels Layer using the intersect relationship where intersects with the rivers layer. That looks good to me, a new selection is fine, and I'll click OK. And let's once again do auto layout. And we're getting a very linear model here for the most part. And notice that our label is way up here here now. So, it's just moving around, we'll correct it at the end. Okay, and now that we have our river parcel selected, we can override the default that we set in this calculate value step by setting the selected parcels to have the value of one, so I'll click Ctrl+C and copy that tool and result here. So that's one thing we can do on a model builder canvas too is we don't have to constantly go back to the search. We can just copy tools and rerun them and it linked it there for me but without even moving it, I can say well I want this selected layer to be the input table, in this case, and then I need to make sure I go correct the values in here. So I'll double click on it to open it up, and we'll calculate the value for is river, and in this case we're going to set it to 1. So we've selected the parcels that intersect with the river. And then we're now going to calculate those selected parcel's values for the is river field and say yes, they are rivers and make that value of that field to 1. So again let's auto lay it out. And since this is all pretty opaque since we're doing it on the model builder canvas, let's use the power of model builder and make sure we're doing it right and run our model as it is now even though it's not finished. So I'll save it, and let's just run it piece wise here. So I could validate it, up here, make sure everything's good and then run it. But let's just run it piece by piece. So I'm going to right click on the copy features tool and run it, and it runs over here. And it's completed, I get the shadow, cool. And then let's run the add field tool, and that completed as well. And then we can watch this, so let's right-click here and go to add to display. And so we now have a new copy of this data here, parcels_with_river_field, just as we had it named, and I can open the Attribute Table. And let's go find is_river field and it's null everywhere. Okay, so now let's run the Calculate Default River Value. Sorry, these keep appearing offscreen. So it ran, and now I can close it. And let's just do a quick sort on this layer here and that updated the values. So we ran the tool here, I just did a sort to force it to refresh the values in the field. So we can that is_river is now zero here. And now, let's make it a feature layer. So I did and it runs very quickly. And now it's not necessarily working with this version here so I can add this to display, so I have parcels layer now which is different from parcels_with_river_field, even though the values in the attribute table will update. But if I want to see the selection and action, I need to go to parcels layer. So let's remove the previous version we were looking at. And let's run Select By Location now. So Select By Location ran. And I'll close it. And let's minimize model builder. Sorry, minimize to offscreen. So they usually minimize this just kind of within the application here. Okay, so Select By Location ran. And now if I just update my display by going View, Refresh, or if I zoom in or zoom out, I can see the selection again. So it doesn't automatically update the display in ArcMap after we run an operation model builder. But if we forced the display to refresh, we can see what we're doing here. So yeah, it's selecting what I want correctly, selected all the parcels that intersect with the river. And now, we can calculate the value of those parcels since remember, field calculator only works on selected features. So I ran that and it finished. And I will close it. And now, let's go take a look at parcels layers attribute table. And these are all zero which is to be expected, but they're not selected parcels right now. So the one's that are selected still should be one. So that's perfect. Everything's selected on here and it's selected attribute table should have been updated to a 1, saying yeah, it's a river parcel, and everything else is a 0, saying no it's not a river parcel. Okay so our workflow works so far, we have successfully built our model, a very complicated model so far, that figures out which parcels have the river running through them which we can then use as a jumping off point for the rest of our model. We'll leave it there for now but in the next video, we will continue where we left off and we'll go on and dissolve the parcels based upon that river value since the ones that aren't river can then be joined into one big polygon. And then we will do the rest of our selections and attribute updates. Okay, see you there.