[MUSIC] Hello, everyone. And welcome back, and welcome to the final lecture on model builder. You're still going to use it in your assignment for this module, and you'll build your own model there using a lot of the same tools that we used. But after this we will be done with our lectures on Model Builder. I've just a few things I want to show you in this lecture. I want to show you some model specific tools that help you do advanced things like lopping and iteration in your model. As well as how to export your models to python code, so that you can either learn python or incorporate something that you decided was easier to structure conceptually as a model into some existing python code. To do, this let's take a quick look at the model we've just built. So I'll close out that geoprocessing window and go to the edit for it. And let's start with the tools for models only. And if I go to insert, there are model only tools and then there are Iterators. And each of these connects to some advanced parts of Model Builder, and they are parts of Model Builder that make it behave a little more like a programming language than as just kind of a structure drag and drop editor to connect your tools together. I don't plan to go through each of these individually, but what I do want to point out is that these tools work on particular variables in model builder that aren't necessarily your feature classes or your data that you're working with. Instead this is where you might want to create variable, maybe a variable that just holds a number, and you can use calculate value to maybe calculate the number of times you need to do something. And then iterate through from there. You can also select different rows in a feature class and work specifically on those in model builder. So, were not limited to just specific due processing tools. You can kind of dive in a little deeper into your data and do some analysis on it their. There are some good tutorials on using these sets of tools in the ArcJS desktop help. And so, if you think that you're going to need to do some advanced Model Builder work where you need to loop through some data sets or features, things like that. Go take a look at those in the Model Builder section of Desktop Help, because that's a great way to learn how to use all of these. For now and for this class, what you really need to be proficient in is making your algorithms, your workflows in GIS into this kind of structure graph presentation. You will use this in the capstone project, and it's just a great way to bring your thoughts together into a single workflow and make sure that you're getting what you think you should be out of your process in ArcJS. Okay, and the other thing I want to show you is exporting your model either to a graphic or to a python script. So we can export to a graphic just so you could send somebody a visual representation of it. Basically, it just makes your model show up as an image, but what I really want to show you is the Python script. So let's export it to a Python Script, and I'll call it mark_parcels.py And let's find that script that I just exported and open it up for editing. Okay, so for those of you who haven't seen or heard of Python before, Python is a scripting language. You can think of it as computer code, but it's a much easier one to learn than many languages are. And it's also tightly integrated with ArcGIS with this arcpy package that you can import into your own code, and then access different functionality of ArcGIS from. And what's really handy is, if you are new to Python code or just new to working with it in ArcGIS, exporting a model can be a great way to see what the commands are to use in python for tools you're familiar with. So here's the command for field calculator, and here's the command for adding a field and for copying features. So if you really just want to find out how to do some of the things you already know how to do in ArcGIS from Python code and how to work on automating them in Python, exporting model can be a great way to get started. The code can get a little weird and isn't really following best practices sometimes since a computer generated it, but over all, if you name your variables well, your code is actually pretty easy to read, because it's using the same variable name as I created like Correct_side_polygon here. So it makes it a lot easier to follow this code. If you don't, then you sometimes get very long name like this that are pretty hard to understand in parts and make your code a lot less readable. This would be a runnable code though, and since I made those parameters I can still pass these as parameters to the script on the command line, or if I made this into its own geoprocessing tool, which you can do with Python scripts and ArcGIS. So, the point of showing you this isn't to make you read this code right now. It's more to show you what's possible that you can translate from a model where you can build your algorithm directly into Python code where I can enhance this into a much bigger script or incorporate certain parts of this into other code I have, maybe to just reuse some steps that I've made. So again we've seen two things in this video. We've seen that there are bunch of tools that are specific to Model Builder and to creating compacts event models that can iterate through your features or run multiple time on the same data sets, and then we can also export our models to Python, so that can edit them as computer code, or incorporate them into other code we have. Okay, that's it for this time and for our work on Model Builder. I hope you enjoyed the videos, and I hope you enjoyed the assignment for this model in building your own model. It'll be on building a hydrologic workflow that you have done before without ModelBuilder. So it could be kind of nice to see how to do it manually versus how to make a ModelBuilder workflow that does it for you. Okay, see you next time.