[MUSIC] Hello everyone and welcome back. In this lecture, we're going to start delving into automation and ARC GIS.. We'll start by taking a look at how to use models in ArcMap and what models are and we'll run through one. And 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 will construct your knowledge of models in the following lecture. So in this lecture, you're mostly just going to get a conceptual understanding of the 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 the model I showed 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 meta-data or even just in time to tell somebody else about it. Or in a couple years, we need 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's to do with reproduceability of our results on our own side. But the other end of it is, reproduceability from third parties. By providing this model, we can have others actually take a look at what we did and validate it. They can say, well actually, you should have 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, they could validate that you knew what you were doing and that you did the right work. So, let's look at our model in action. So to do that, I'm going to open ArtToolbox here. And I'm going to Rrght-click on the root element of ArtToolbox and go to Add Toolbox. And this is what I'll do, when I want to add tools from another source, and I'll navigate to the toolbox, HydrologicTools.tbx. And I'll click once on it cause 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 our toolbox 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've made that I use a lot, I will add them in ArcMap. If I add them in our catalog, then to ArcToolbox and Arc catalog they become part of my default map templates. So, they are in a map document I have but if I add them just in 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 a center spoke here. But if I double click on it I get a geo-processing tool just like any other, so it's still a geo-processing tool, right. Well, yes and no. It's a model and so, we're going to use model builder to take a look at what's going on inside. And model builder is ARC GIS' built in model editor and when I right-click on a model, which I can always ID based on that icon. There are few geo-processing tools build 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 canvas here. That has bunch of different boxes and ovals on it and some colors and lines. And right now, it 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 slightly humorous expression for something that look 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 or this module, you're going to be able to build this yourself. So one other thing I didn't mention is, besides forgetting what you did, models helps us formalize more complex processes. So, they 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 GEO processing 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 the process. For now, let's just add some data that we'll need for this model to our map document. It'll make a few things a little easier. So, I'm going to go to model_data.gdb and add nav_dem_10m. Which you should be familiar with by now from assignments in the previous courses. We'll click this. It's a digital elevation model, ten meters in cell size for the Newar River watershed. So but nothing happened in our model yet, so what are we looking at here? Well, the square rectangle-ish items, these are geo-processing tools. They even have a little hammer on them and the ovals are variables and sometimes they are inputs to tools. Like the fill tool has it's own parameter that's input surface posture. But sometimes they're the outputs of the tool, so we can think of this 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 often times 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 workflow 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 geo-processing 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 raster here, I got a little prompt to fill in that value. And I'll click the nav dem 10m, and I can browse for long disk, but I add to the map documentary, so I can do this. I'll click ok and thinks for a little bit and now, everything's in color and when something's in color, we know it's ready to run. But I can also tell that it hasn't run yet. Because model below 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 at your processing 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 as this output saved. So if I needed 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 work flow 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 it track for me and run something successfully and then, go keep working up ahead of it. So, we're running flow direction or flow cumulation right now and that will take a little bit of time. Now, those of you who took previous courses, as I said, will 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 syncs in the DEM, which we haven't really talked about yet. But basically, it takes localized low spots on the landscapes. 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 in the flow direction and we get a flow direction roster. That then we can use to pass into flow accumulation and then, we're going to create basically a set of roster stream lines out of it. With the Set Null tool and then, we'll use stream length to find distinct stream segments. And then, we'll convert those stream segments to the feature class with the stream to Feature tool. So, just as kind of a recap of that assignment that you did in the geo spacial and environmental analysis course. That generated the steam lines, that's what's going here. Now we're onto set null, then stream link where we create the distinct stream segments. And then, using that as imput to convert to a 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 streamlines that 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 streamlines look 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 too. But in the meantime, we can add any of these others to our display too. So maybe we just wanted to see what the flow direction roster looked like. So we could right click on that to add 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 the input surface luster and run this process again. For a different digital ovation model representing a different area, or maybe a different resolution for the same area. But the process itself is automated and I have four control opponent and I can run it again and again and again. For as many different occasions 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 right pieces. If they want 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 geo-processing 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 run 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.