[MUSIC] Hello everyone, and welcome back. In this lecture, we're going to start delving into automation in ArcGIS. Yes, we'll start by taking a look at how to use models and ArcMap and what models are and we'll run through one that you should be a little familiar with what it does from some of your previous work in this specialization. And by doing this, we'll build the foundation upon which we'll construct your knowledge of models in the following lecture. So in this lecture you're mostly just going to get the conceptual understanding of models and automation. And then in the following ones, we'll actually start building our own models, and then your assignment this week you'll practice building a model I show you in this lecture. So to start with, why do we care about automation? Well, for a couple reasons. One is sometimes when we go through a GIS process we don't actually remember what we did afterward in time to write metadata or even just in time to tell somebody else about it or in a couple years we need to do the same thing again and we don't remember how we did it. So models help us keep track of that by actually formalizing the process by which we run our GIS analysis, and that has to do with reproducibility of our results on our own side. But the other end of it is reproducibility from 3rd parties. By providing this model we can have others actually take a look at what we did and validate it. They could say, well actually you should've put this or that in between these two steps because you need to correct for this factor in your data. Or actually, this looks like you did a great job and you went through the right process. So when people are paying you to do an analysis sometimes they want some visibility into what you did so it could validate that you knew what you're doing and that you did the right work. So let's take a look at a model in action. So to do that I'm going to open up our tool box here. And I'm going to right click on the root element of ArcToolBox and go to add tool box. And this is what I'll do when I want to add tools to another source. And I'll navigate to the tool box, Hydrologic tools.tbx And I'll click once on it because if I double-click on it, it goes inside of the tool box, so I'll click once on it. And then click open, and what it does is kind of subtle, but it adds it into ArcToolBox here. Now if I want to make it permanent, if I have tools that I use all the time, like these two toolboxes that I have made that I use a lot, I will add them in ArcMap. Now if I add them in ArcCatolog, then, a toolbox in ArcCatolog, they become part of my default map template so they are in every map document I have. But if I add them, just an ArcMap, they're live only for this map document. So if I expand Hydrologic Tools, I get a maybe slightly unfamiliar looking icon here. Most of our tools have this little hammer. This one has these little boxes around the center spoke here. But if I double click on it, I get a geoprocessing tool just like any other. So, it's still a geoprocessing tool, right? Well, yes and no. It's a model. And, so, we're going to use model builder to take look at what's going on inside. And model builder is ArcGIS' model editor. And when I right-click on a model, which can always ID based upon that icon, there are a few geoprocessing tools built-in, that are models as well. I can click edit to go take a look at what's going on under the hood, and when I do, I get this kind of canvas here that has a bunch of different boxes and ovals on it and some colors and lines. And right now this might look a little like Greek to you, unless you speak Greek, then it looks like some other language. Sorry, for those of you who aren't from the United States, that's a slightly humorous expression for something that looks unfamiliar. But just know that in time you;re going to understand exactly what's going on here. And by the end of this week of this module you're going to be able to build this yourself. So one other thing I didn't mention is beside forgetting what you did models help us formalize more compact processes, so it can help make it much faster and easier to undergo an analysis. Maybe I need to do something a lot of times and it's a lot of hand work to go through it. So it can be really helpful if I can just run one geoprocessing tool that runs a bunch of others in the background or can run it on a stack of items instead of just on one item. So it can be really handy when we need to automate a process many times in addition to formalizing a process. For now, let's just add some data that we'll need for this model to our map document. It will make a few things a little easier. So I'm going to go to model data.gb and add nav dem 10m which you should be familiar with by now from assignments in previous courses. Looks like this, it's a digital elevation model, ten meters in cell size, for the Navarre River watershed. But nothing happened in our model yet, so what are we looking at here? Well, the kind of square rectanglish items, these are geo processing tools. They even have the little hammer on them. And the ovals are variables and sometimes they are inputs to tools like the fill tool has its own parameter that's input surface roster. But sometimes they're outputs of the tools. So we can think of these almost as feature classes. It's an output service roster but we can use those as inputs to other tools. And that's the crux of model builder is that oftentimes the outputs of some of our tools become inputs to other tools. We do this all the time without thinking about it. We run one tool in order to get an output that we then use for another tool. So this helps us actually visualize that work flow right here on our canvas and lay it out in a way that we can see the full process in front of us. Now our model's not yet really ready to run. I can tell because it's not in full color yet. So what I'm going to do right now is, instead of running it as a geoprocessing tool, I'm going to make our model ready to run here so we can run it interactively and step by step. So if I double-click input service roster here I get a little prompt to fill in that value. And I'll click the navdm10m and I could browse from on disk but I added it to the map document just so I could do this. I'll click OK. And it thinks for little bit. And now, everything is in color and when in something is in color, we know it's ready to run. But, I can also tell that it hasn't run yet because Model Builder gives me a little signal when something already has run by putting a little shadow behind it. But what we can do now is run the model. So, what I'm going to do is just hit the play button here, the run button and it's going to start. Now this is big but it pops up the geoprocessing dialog, but we can tell what's currently running based upon what gets a little bigger and shows in red. And we can tell it's finished because those shadows go behind it. If flow direction failed right now, I would not have to rerun fill because it's already running and has this output saved. So if I need to fix something this would already know that it's been run and I can just proceed from where it left off. So it's great for debugging a workflow too because I don't have to really keep track of what I'm doing and where my outputs are. I can just have it keep track of it for me and run something successfully and then go keep working up ahead of it. So running flow accumulation right now and that'll take a little bit of time. Now, those of you who took previous courses, as I said, would be familiar with this. This is the model by which we can generate streamlines from a digital elevation model. So what happens is we provide the DEM here, and we fill sinks in the DEM, which we haven't really talked about yet. But basically, it takes localized low spots in the landscape, spots where water would flow into, but not flow out of. And it fills them up to a height on the DEM where water would actually flow out again. Because, mostly those don't exist very often. And then it passes them into flow direction. And we get a flow direction roster that we can then use to pass into flow accumulation. And then we're going to create basically a set of raster streamlines out of it with the set null tool. And then we'll use stream link to find distinct stream segments. And then we'll convert those stream segments to feature class with the stream to feature tool. So just as kind of a recap of that assignment that you did in the geospatial and environmental analysis course that generated streamlines. That's what's going on here. Now we're unto set null. Then stream link where we create the distinct stream segments. Then using that as input to convert to feature class. And our model is done so I can close this. And expand here and see that I've streamlines at the end. Now, nothing new showed up in our map document though we're used to geo processing results showing up there. Well, I can add these to my display so I can right click on streamlines here and click Add to Display. And here I get the stream lines that's resulted from our model. And some of you who did that last lab in the last class are saying, well that's not what the the stream line looks like, right? Well that's because we used some slightly different model parameters here, and let me find the model really quickly and I'll show you. So, right here the number of cells upstream was set to a much lower value than you used. You used 10.000 previously and we're using 100 here. But we can tweak that and run it again if we wanted to. But in the mean time, we can add any of these other stored display, too. So maybe we just wanted to see what the flow direction roster looked like. So we can right-click on that do add the the display as well and, see the flow direction roster right in our map document, just like if we had run it manually. And what I could do if I wanted to now is I could change then put surface [INAUDIBLE] and run this process again for a different digital elevation model representing a different area, or maybe a different resolution for the same area. But the process itself is automated and I have full control over it and I can run it again and again and again for as many different locations as I want, and get consistent results based upon the same workflow being run each time without the potential for error that comes with me trying to reproduce the steps each time. I can also send this toolbox to somebody else so that they can use the same exact workflow, which is what you'll do if you are following along with this lecture, and then they can also verify my workflow. Has all the right pieces if they want to or add to it and enhance it and then send it back to me. So, there are a lot of different advantages of using models. They're pretty easy to put together. They don't require any coding knowledge but, the work flow the geoprocessing workflow you've been getting used to translates directly into them. And you can still do automation. Okay, that's it for this lecture. In this lecture, I showed you model builder. Just a brief introduction and we're going to start diving into it in the upcoming lectures. And we learned a bit about using automation in ArcGIS and ran this model to see in action a few different mechanics that model builder uses to give you an at a glance sense for what's ready to run and what has run and then to be able to add it to your map document. Okay, see you next time.