Model Builder Map Tutorial – Arc GIS Pro

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi this is Kevin Matt practical tonight we're going to be working in model builder in ArcGIS pro this little exercise where we try to figure out where the best places to live in the United States are so if you look at all the cities in the United States it's kind of overwhelming but I have a lot of students who are graduating finishing up their degree and they might be trying to figure out where do I want to live so the point is to reduce this mass down to just a few places that you might find interesting so I've created a model that looks at average income population density average education so on and so forth and when you run it through then it will choose only the cities that meet all of those curricula all right so Bend that's a nice place to live right Kalispell not too bad a couple other places Grand Junction I would live in Montrose it's really nice page a lot of nice canyoneering and things around there and st. George you know close to Zion but a little hot but anyways this all depends on all this data in here so what I have is average temperature for the United States for the last 30 years this is prism data coming out of University of Oregon let's see if we can open it up and take a look yep so it's an average for the entire year right so to get to an average of only 23 degrees that's to be pretty darn cold but on the other side of that to get to an average of 77 it has to have cold and then also some hot so you have to kind of you know figure out it it's not the average temperature that you would like to have it's for the entire year all right same thing with the average rainfall so this is inches per year goes you know this last class from 9:00 down to about zero all the way up to you know just under 200 inches in places like the Olympic Peninsula so and then I've got a verge income for the United States so it's going to turn off the rainfall so this is four counties so this is you know from under 16,000 a year up to about 64 almost 65,000 here and that's only in a couple of the really dense metropolitan areas around San Francisco and New York and so forth you would be surprised that some places that you feel like you can make a good living their average income is pretty low kind of same thing with things like percent educated right so this is anywhere from just below 7% up to only a few places that are 45 almost 46 percent educated the average the United States is about 12% of folks with a four-year degree or higher right and then biomes right so do you want to live in a desert or a temperate coniferous so on and so forth all right so when we look at all these different things how do you figure out what the best settings are well one way to do it is to you know turn on all of the cities and then zoom in to one so if you had a couple of things like average income and education turned on and you zoomed into and let's just turn off all and go to some cities that I know so what is the average income of say Bend org and so if I were to zoom in to band and then click on band you'll get a pop-up it'll give us some information about that so average income and that's Deschutes and we scroll down here average income is around almost $28,000 a year right and what about education so the percent educated off the scroll over is around almost 17% so you get a sense so then you can start setting the different variables inside the model all right all right whoops zoom out I'm gonna turn off some of these things and turn off my first round of pics and sorry I only have data for the continental United States it's just hard to get full datasets for all of the US but you know you can dig around and find them if you want so to do the model building thing first you go to your catalog pane and then take a look in your toolbox so every time you make a new project in art Pro it's gonna make you a toolbox I've already made a couple of tools and we'll get to those in a second but to make a new model you would right click new and say model and it's going to open up a new model for you on this model then it's going to open up kind of the model menu and you can go to properties for that menu and this is where you can name it so I'm just gonna call it test model and it's always a good idea to name your tools and your outputs you know any art products and then store relative toolpath I think that's a good one I'll say okay and then in order for this to become permanent you have to save it so I'll hit save great okay so how do you would work it is let's just say I'm going to drag some data so I'm going to grab my average income and drag it onto the model field and then you can grab tools either from up here so with this drop down I'm going to just type in select and if you double click on select it'll put it there on the screen so I'm going to just click on average income and drag the arrow over to select tool and then tell it it's an input feature so there we go so blue circles represent data going into a model yellow squares usually are tools and then these green circles are your output data so let's go into the settings for this selection I've had some strange docking things where menus dock up high so if you just resize them a little bit you can get to so average income is going in and then instead of letting that put it just into the geodatabase for this project I have a little piece of code here and this is called scratch gdb and it's got a % scratch gdb % and then backslash and then this is going to become best income right let's get on there great and then you have to add an expression so create an expression and then you have to scroll down and find the average income right there and it's going to be equal to or greater than and I'm gonna go with about 50,000 so that's that's quite a bit right not too many counties in the country or making 50 grand or more you could go less you could go more but we'll just go with that for now and then you have to hit save or okay so that's pretty much how you do it I'm also going to take a look at education so do that I'm gonna bring another select and I'm going to go ahead to add another one because I know I'm going to need both of them so I'm going to put one down here so that's going to be this one and I'm gonna need one also to select out my city so I'm gonna drive my cities out here great so I'm going to connect this is going to be input and connect that one and that's going to be my input great and then there's this great little button of your called auto layout and that'll just clean everything up okay all right so we still need to work with the selection for the education and come on alright and I'm gonna get rid of just pick a path and put my scratch geodatabase in there and this is going to be best II D u and then we have to set an expression of some kind and this is going to be percent educated and this turns out is and menus are really strange right now in art pearl I don't know why and once you select what you're actually after if you hit the little SQL button then it allows you to build out some SQL so this one I'm going to use the between functions of bTW and and once it shows up you just hit enter and in this particular case I'm going to be looking for educated between say like 0.15 415 and then I'll type in the word and and once that shows up there we go and 0.20 for 20% right and hit enter and it likes it whoops don't want that extra returned and I hit okay cool and then my cities also I need to set some selections for those so again I'm gonna put it in my scratch work space let's pull this out and we're going to drag it down man that's just giving me a hard time this can be best sees and what we're trying to do here is set the overall population for cities so let's put a new expression this is going to be pop 2010 and we're looking for is less than or equal to and I'm gonna go for forty thousand I don't want to live in too big of a city okay you can always hit the little green checkbox and just check and see if it likes it and then it hides the okay button though you left yeah there we go alright so we've got one more tool and you can drag tools or you know double click out of this toolbox or from the geoprocessing menu you can also do it so let's let's get the intersect tool there it is and you'll just I want to highlight I want to drag it on to my field yeah all right and so what we want to do is intersect the average income and the education so I'm just going to drag these into the intersect that's an input feature drag this one in input feature great I have to go in here and again or with all those parameters that we were working with before in this case I'm just gonna put this also in my scratch work space and this is just going to be the intercept great and that's going to become the tool I use to clip my cities by so I'm gonna find the clip tool double click on it and there it is and the output of the intersect is going to end up being the clip feature and what's it going to be clipping in my best cities are going to be the import feature and then I'll double up and go in here and these things are all over the place today and where's it going in this particular case because it's clipping I want this to become my final output so I'm gonna put this into my main geo database for this project and in my feature data set and I'm just gonna call this my best cities actually I'm gonna call it keV pics because I already have best city somewhere so keV pics too and I already have that in there let's make your cat pics three okay and everything looks good all right and I'm gonna hit the autolayout again just to clean it up I'm gonna save my model and real quick I'm gonna go over to catalog and then I'm gonna go inside of my folders and the model builder folder and there's a scratch geo database in there because that's from a previous run I'm going to delete that just so I can show you when we come back that that little bit of code is actually going to create that geo database okay so now we're going to go back to our model and look test model that's what we're working on and then we're gonna run it actually I'm gonna hit validate first it'll only give me an error if it finds a problem didn't find anything and then I'm gonna hit run so when the model is running the red means that the tool is working so it works through these things that's selecting from average income from education now it's intersecting the intersect tool usually takes the longest and now it's clipping it and when it's finished we can also grab this guy up here take a look warning empty output generated that happens sometimes so that means that even though it's selected all these things out but for at some point there was a problem and I think I know what it was because I changed one thing so what I'm gonna do is first thing I'm gonna have to do is go back to my catalog I'm gonna have to refresh my folder here and you'll see the scratch geodatabase and this is the problem if you run these tools on their own you'll have to go and clean out the the scratch to your database every time so let me go ahead and delete that yeah I want to get rid of those so now the scratch is cleaned out and now if we go back to our test model if we hit the validate it'll get rid of all those under drop shadows which were letting us know that the tool at intermediate data I think I know what the problem was is that I messed around with my percent educated so let's go in here yes I saw a B in between so I'm going to remove that one I'm going to add a new expression once I bring this down where we can see it and we're just going to go with greater than 20% so % educated it's going to be greater than or equal 2.2 lol and see if it likes it does say okay cool I'm going to save the model and I'm gonna run it one more time see what you're lucky alright it did run and apparently it has an output so now I can go over the catalog I'm going to go to my database and I'm going to refresh my main database and then look inside my future data set there it is Jeff picks three right click on that one and say add to the current map and then we'll go over to the map and take a look alright so we did get a few so I'm gonna go ahead and turn on labeling them in those guys so it looks like with those parameters I'm going to have to live in some pretty high-end places right so I'm gonna have to live in the Bay Area and around Inverness Inverness point raised those are nice places I wouldn't mind living in those but I know it's going to be pricey right mere beach all these places are pretty expensive well stood to put me in I think it put me some places over here in Colorado zoom in and take a look oh yeah Aspen boy I'm gonna and Snowmass Village gonna need some money to live there and then what else put me on a couple places over here on the East Coast Nantucket I think it is yep so I guess I could live in Nantucket if I was going to be a whaler and then a couple of areas like Falls Church yep just outside of DC okay so maybe not necessarily the ideal places for me but those were the parameters that I set within the model okay so that was just the test model let me turn that guy off and let's take a look so I built another model that has all these different ones I'm going to get rid of this expression for now because that is for another part of that okay so I've added average rainfall pop density education biomes average income right if you hover over the tool it will tell you so this is a between 12 and 18 inches pop density between 30 and 50 people per square mile education between 15 and 25 percent biomes looking like like deserts Mediterranean forest temperate mixed forest and temperate coniferous forests and then for the average income between 20 and 30 thousand a year right and then for my cities I went with less than or equal to 70,000 people and so once you run all of those things together and then it'll kick them out and I added a feature class to feature class which will just put it into my main geo database so it'll get rid of the clipped one back there now I got to make sure that my biomes is cleaned out or excuse me - scratched geo database so right click and refresh there and then I'll have to open that guy up and take a look yeah so I've got to get rid of these because if you have things name the same in the model it'll it'll kick you an air if it's trying to overwrite data so let's delete these guys very good and now back to this one okay super I'm going to save this model and I'm gonna hit validate just to see if there's any problems and doesn't seem so and then I'm going to let it run let's see what we get so it's working through all these now the intersect could probably take a little bit longer because there's a lot more data going into it and then it's going to clip my cities my best cities that is only a selection of the overall population in each city by and the intersect of all these different parameters it's thinking it's going to get there so there are endless combinations you can play with this for a long time and eventually you'll get the model tuned to kind of finding the ideal place for you to live so let's take a quick look it looks like it ran it succeeded I got to be able to close this though there we go and then you see all of these little drop shadows means that there's intermediate data in the tool okay so I'll go over to catalog and then I'm gonna have to refresh my main geo database the model builder and then under best places keV big six is what that one was named I'm going to add it to the current map and I'm gonna go over whoa we got everything there's a little glitch for some reason it keeps adding the best cities but never fair fear all right let's take a look and label these so there we go if I go to labeling I can get these to label a little bit better by just clicking on this basic offset point maybe come on it's thinking a couple of the good places in there let's see sisters sisters in Oregon I could live there yeah absolutely Idaho Falls Swan Valley those are pretty nice looks like our pros having a hard time all I want to do is to change how it labels there we go there we go clean those up a little bit so those meet all the parameters that was set in that model right so this works this would be fine but the one problem is that every time you want to change things you have to go back you'd have to go in and change different parts and you would also have to go to art catalog and then refresh down here in your model builder and then delete everything inside the scratch geo database to rerun it that's kind of a pain if I go over to another model so this is the best of us model so this is very similar to the one I just showed you I've just added the thirty-year temperature but you'll also notice I have all these expressions and expressions are basically the selection inside this tool of selection and then the little P means it's been set as a parameter now let me show you how I did that back on this older model so if I wanted to do it on this guy and we right-click and then go to create variable and then from parameter and then expression and it's gonna pop up this little guy here and then I would right-click on that one and tell it that it's a parameter and once I've done that that means the tool can be run in the geoprocessing realm so because I've done that in all of the different tools inside this best of the US one then I can go over to our catalog and then look inside my model builder and then I can right click on my best of the US and say add to favorites it's grayed out now because I already have added it to my favorites and now I'll go to the map I'm going to turn off these kev pics and if I go to my geoprocessing here I'm gonna go back and under favorites there it is there's my model and because I've set parameters when I double-click on it it's a tool inside of the geoprocessing environment and so there's everything that I have set and you can change in here the other cool thing about this is that when it runs it will delete everything out of the scratch workspace so it's important though to scroll down and check there might be some internal errors like this internal error if you just click on this SQL expression usually we'll fix those so I'm gonna go ahead and do that for each one of these okay looks like everything is ready to rock one thing I do need to check is back in our catalog to make sure that the scratch geo database doesn't have anything in it nothing it does I'm just gonna go ahead and delete it it's gonna recreate it because I used that little bit of code okay there we go back to map back to geoprocessing looks like everything is good one thing to always be sure is that the output feature class has a decent name on it I'm going to put and just in case I already have a 9 inside the geodatabase alright no errors everything looks fine look and I'll run it and the disadvantage is you don't get to see it go through the flow chart but it does give you this kind of prompt that lets you know if the tools are working there we go it's working through things looks like it's clipping it already great and then you can hit the scroll down and see yeah complete looks good all green fantastic now go to our catalog and I'll refresh my geo database kind of wish this refresh automatically but what I want and what they do are two different things right click on my kev pics output add to map let's go to my map and there we go so turn on the labeling on that very good so that one only picked four different cities out of all those the United States Bend Missoula Bismarck and Rapid City and the reason for that is limited selections because I fine-tune that model around Missoula and I found out what all the parameters were by just clicking on Missoula with all the variables turned on and looking at what Mozilla's statistics were I could back into the Missoula because I do but I could also live in back don't know about this mark a little bit cold Rapid City I've had a good night in Rapid City alright so that's the basics of model builder it's a little bit tricky down in the description I'll give you a geodatabase with all of this data and I'll also throw a copy of the toolbox with the best of the US model in it on your computer you're probably going to have to go into each one of the tools and set the paths and make sure that everything lines up correctly but you should be able to get it to work all right that's all I have for you today if this was helpful please give the video a like and if the channels been good for you go ahead and subscribe and that'll help me out a lot have a good evening and take care
Info
Channel: MapPractical
Views: 10,502
Rating: 5 out of 5
Keywords:
Id: Yu457Vrc93g
Channel Id: undefined
Length: 23min 22sec (1402 seconds)
Published: Fri Apr 24 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.