1 00:00:01,340 --> 00:00:03,910 - [Instructor] In this lecture, we'll walk through 2 00:00:03,910 --> 00:00:06,320 demonstrations of different kinds of models 3 00:00:06,320 --> 00:00:10,700 you can construct using Model Builder and ArcGIS Pro. 4 00:00:10,700 --> 00:00:12,370 We'll start with a simple model, 5 00:00:12,370 --> 00:00:15,500 expand that to include some parameter values 6 00:00:15,500 --> 00:00:17,410 and then take a look at two different examples 7 00:00:17,410 --> 00:00:19,670 of how we can incorporate iterators 8 00:00:19,670 --> 00:00:21,463 into a geoprocessing workflow. 9 00:00:22,700 --> 00:00:26,380 In the first example, we'll look at recreation sites 10 00:00:26,380 --> 00:00:29,040 and Winooski River Basin. 11 00:00:29,040 --> 00:00:32,330 We'll use the calculate field, select by location, 12 00:00:32,330 --> 00:00:36,420 buffer, union and summarize geoprocessing operations 13 00:00:36,420 --> 00:00:37,890 to create a table 14 00:00:37,890 --> 00:00:40,080 with the total area of Winooski River Basin 15 00:00:40,080 --> 00:00:42,143 covered by a recreation buffer. 16 00:00:43,060 --> 00:00:44,003 Let's get started. 17 00:00:45,120 --> 00:00:47,650 Here we are in the ArcGIS interface. 18 00:00:47,650 --> 00:00:51,080 I'm got my recreation sites symbolized as green dots 19 00:00:51,080 --> 00:00:52,670 and the Winooski River Basin 20 00:00:53,730 --> 00:00:56,300 symbolized with an orange outline. 21 00:00:56,300 --> 00:00:58,550 If I look at the attribute table 22 00:00:58,550 --> 00:01:00,860 for the recreation sites data set, 23 00:01:00,860 --> 00:01:03,070 we see some attributes we've worked with before, 24 00:01:03,070 --> 00:01:07,300 acreage and the various summer and winter parking spaces. 25 00:01:07,300 --> 00:01:09,510 I also wanna point out two other attributes 26 00:01:09,510 --> 00:01:10,760 that I've created. 27 00:01:10,760 --> 00:01:13,350 The first is recreation site. 28 00:01:13,350 --> 00:01:16,030 These are all coded with the value of one. 29 00:01:16,030 --> 00:01:18,950 Of course it makes sense that a recreation site point 30 00:01:18,950 --> 00:01:20,680 is a recreation site. 31 00:01:20,680 --> 00:01:23,700 So the point is not to use this here now 32 00:01:23,700 --> 00:01:28,320 but remember that when you buffer and union data, 33 00:01:28,320 --> 00:01:30,350 that the attributes are carried over. 34 00:01:30,350 --> 00:01:33,160 So in the end stages of our example here, 35 00:01:33,160 --> 00:01:35,600 when we want to summarize the amount of area 36 00:01:35,600 --> 00:01:37,780 within the Winooski River Basin, 37 00:01:37,780 --> 00:01:40,840 that's covered by a recreation site buffer, 38 00:01:40,840 --> 00:01:42,630 we'll need this value of one 39 00:01:42,630 --> 00:01:45,210 to be able to make the proper selection. 40 00:01:45,210 --> 00:01:46,830 The other attribute of note here 41 00:01:46,830 --> 00:01:48,230 is the buffer distance. 42 00:01:48,230 --> 00:01:50,180 Right now, these are all coded as zero. 43 00:01:53,320 --> 00:01:56,140 Over on the Winooski River Basin data set, 44 00:01:56,140 --> 00:01:59,860 one other attribute to point out is WRB. 45 00:01:59,860 --> 00:02:02,170 Again, this will serve that same function 46 00:02:02,170 --> 00:02:05,063 as the Is Recreation Site that I just described. 47 00:02:06,220 --> 00:02:07,403 Let's create our model. 48 00:02:08,810 --> 00:02:12,920 From the Analysis ribbon, I click Model Builder 49 00:02:13,870 --> 00:02:17,323 to open up a new blank model interface. 50 00:02:19,630 --> 00:02:21,770 The first order of operations here 51 00:02:21,770 --> 00:02:22,970 is to calculate a field. 52 00:02:25,860 --> 00:02:28,520 I can search from the Tool dropdown 53 00:02:28,520 --> 00:02:31,533 and add Calculate Field to my interface. 54 00:02:33,040 --> 00:02:35,720 Okay, I added the rest of the geoprocessing tools 55 00:02:35,720 --> 00:02:37,420 that we'll use in our model. 56 00:02:37,420 --> 00:02:41,800 Select Layer by Location, Buffer, Union 57 00:02:41,800 --> 00:02:43,870 and Summary Statistics. 58 00:02:43,870 --> 00:02:45,573 Now, let's add some data. 59 00:02:47,060 --> 00:02:49,480 I'm gonna use the Winooski River Basin 60 00:02:50,440 --> 00:02:52,010 as part of my union operation 61 00:02:53,100 --> 00:02:54,890 and the rest of the model will be driven 62 00:02:54,890 --> 00:02:57,200 by the recreation sites. 63 00:02:57,200 --> 00:03:02,200 So we see we've added two data variables into the model. 64 00:03:03,590 --> 00:03:05,463 Now let's begin to set the model up. 65 00:03:07,960 --> 00:03:10,720 I drag a connector from my recreation sites 66 00:03:10,720 --> 00:03:12,450 to calculate field 67 00:03:12,450 --> 00:03:14,440 'cause the first thing I want to do 68 00:03:14,440 --> 00:03:18,053 is calculate the value of the buffer distance. 69 00:03:19,700 --> 00:03:22,630 My recreation sites will serve as the input table 70 00:03:23,800 --> 00:03:25,193 in the field calculation. 71 00:03:26,530 --> 00:03:29,260 If I double click Calculate Field, 72 00:03:29,260 --> 00:03:31,803 we see a familiar looking dialog box. 73 00:03:32,810 --> 00:03:37,800 We're going to use our buffer distance as the field 74 00:03:38,870 --> 00:03:42,400 and we'll multiply the number of summer parking spots 75 00:03:42,400 --> 00:03:47,273 by five to calculate the buffer. 76 00:03:48,720 --> 00:03:50,350 Note that when I click okay here, 77 00:03:50,350 --> 00:03:52,560 I'm not actually making that calculation. 78 00:03:52,560 --> 00:03:54,760 I'm just setting up the tool parameters 79 00:03:54,760 --> 00:03:56,160 to be included in the model. 80 00:03:57,500 --> 00:04:01,780 I click Okay and notice that now this portion of the model 81 00:04:01,780 --> 00:04:02,883 is ready to run. 82 00:04:04,880 --> 00:04:07,150 Okay, well the next step here 83 00:04:07,150 --> 00:04:11,830 is that I wanna select all of the recreation sites 84 00:04:11,830 --> 00:04:13,880 that are within the Winooski River Basin. 85 00:04:16,370 --> 00:04:18,450 So I drag that connector 86 00:04:18,450 --> 00:04:20,573 and specify that's an input feature. 87 00:04:22,060 --> 00:04:25,920 My Winooski River Basin is going to be the selecting feature 88 00:04:26,920 --> 00:04:30,830 This way, I only select those recreation sites 89 00:04:30,830 --> 00:04:34,750 within the Winooski River Basin for the buffer operation. 90 00:04:34,750 --> 00:04:36,513 This just saves time later on. 91 00:04:38,150 --> 00:04:40,033 Now that we've selected our features, 92 00:04:41,020 --> 00:04:45,513 we can use those as the input for the buffer operation. 93 00:04:46,410 --> 00:04:48,130 Specify the input features 94 00:04:49,700 --> 00:04:52,120 and then I just need to also indicate 95 00:04:52,120 --> 00:04:53,350 that we're using a field 96 00:04:54,230 --> 00:04:57,350 and that that field is the buffer distance value 97 00:04:57,350 --> 00:04:59,003 we just calculated before. 98 00:05:02,100 --> 00:05:05,320 Let's also be sure to dissolve all those features 99 00:05:05,320 --> 00:05:06,663 into a single feature. 100 00:05:09,210 --> 00:05:12,800 Okay, now we've got our buffer output 101 00:05:12,800 --> 00:05:17,800 and that's going to be one part of the union. 102 00:05:19,420 --> 00:05:21,550 Specify those recreation sites 103 00:05:23,820 --> 00:05:27,523 and my Winooski River Basin as my two input features. 104 00:05:30,010 --> 00:05:35,010 Now, with my output from the union operation, 105 00:05:35,410 --> 00:05:38,260 that will serve as my input for the summary statistics 106 00:05:40,390 --> 00:05:43,640 and I double click to open the Summary Statistics Dialog box 107 00:05:47,340 --> 00:05:49,310 So we just need to specify 108 00:05:49,310 --> 00:05:51,540 the summary statistics we want to calculate 109 00:05:51,540 --> 00:05:53,540 and whether or not there's a case field. 110 00:05:55,070 --> 00:05:57,520 When I open up the Field Options here, 111 00:05:57,520 --> 00:06:01,450 we know that we wanna sum the shape area in this case 112 00:06:01,450 --> 00:06:04,253 but I see two different versions represented here. 113 00:06:05,840 --> 00:06:08,393 Since I can't tell which comes from which source, 114 00:06:09,760 --> 00:06:12,110 I'll just calculate both 115 00:06:12,110 --> 00:06:13,420 and we'll see what happens. 116 00:06:13,420 --> 00:06:16,600 That should make it easier to identify the correct one 117 00:06:16,600 --> 00:06:19,010 and we can fix the model later. 118 00:06:19,010 --> 00:06:24,010 Now remember those Is Recreation Site and Is WRB attributes 119 00:06:24,010 --> 00:06:26,060 that I described before, 120 00:06:26,060 --> 00:06:28,563 those are gonna be our case variables. 121 00:06:30,100 --> 00:06:33,340 This way any of that buffered area that falls outside 122 00:06:33,340 --> 00:06:37,440 of the Winooski River Basin will not be selected 123 00:06:39,360 --> 00:06:43,610 and any of the areas inside the Winooski River Basin 124 00:06:43,610 --> 00:06:46,110 that are not covered by a recreation site 125 00:06:46,110 --> 00:06:49,500 will also be able to be selected 126 00:06:49,500 --> 00:06:50,963 from the rest of the records. 127 00:06:52,640 --> 00:06:55,953 Okay, at this point, our model's complete. 128 00:06:58,070 --> 00:07:00,083 I click the check mark to validate. 129 00:07:01,040 --> 00:07:02,940 Probably a good idea to save at this point 130 00:07:02,940 --> 00:07:05,480 since we've made a lot of changes 131 00:07:05,480 --> 00:07:06,793 and from here I can run. 132 00:07:12,570 --> 00:07:15,093 Well, looks like I creates us a problem here. 133 00:07:16,060 --> 00:07:18,970 Got an error message that caused the model to fail 134 00:07:18,970 --> 00:07:22,690 indicating that there's an invalid case field name 135 00:07:22,690 --> 00:07:24,893 in my Summary Statistics operation. 136 00:07:25,840 --> 00:07:28,350 Let's try to take a look at what that might actually mean 137 00:07:28,350 --> 00:07:29,683 and how we can fix it. 138 00:07:31,150 --> 00:07:34,173 First thing I'll do is look at my Union data set. 139 00:07:35,500 --> 00:07:37,660 It's already been added to the display here 140 00:07:39,540 --> 00:07:42,040 and if I look at that attribute table, 141 00:07:42,040 --> 00:07:44,590 maybe we'll get some insight as to what's going on. 142 00:07:50,272 --> 00:07:51,840 We see in the attribute table 143 00:07:51,840 --> 00:07:54,730 that the Is WRB attribute is there 144 00:07:54,730 --> 00:07:58,170 but the Is Recreation Sites attribute is not. 145 00:07:58,170 --> 00:08:01,900 It must have been dropped out earlier in the geoprocessing. 146 00:08:01,900 --> 00:08:05,150 So let's come back to our buffer output 147 00:08:05,150 --> 00:08:09,363 which is the previous step and look at that attribute table. 148 00:08:13,040 --> 00:08:16,050 Sure enough, it doesn't appear there. 149 00:08:16,050 --> 00:08:19,500 I think I might have the Dissolve settings incorrect 150 00:08:19,500 --> 00:08:21,260 in the buffer operation. 151 00:08:21,260 --> 00:08:22,710 So let's take a look at that. 152 00:08:24,280 --> 00:08:26,490 I set it to Dissolve All Output Features 153 00:08:26,490 --> 00:08:28,690 into a single feature. 154 00:08:28,690 --> 00:08:32,960 Instead, I meant to dissolve based on a listed field 155 00:08:32,960 --> 00:08:36,633 and the field that I want is that Recreation Site. 156 00:08:38,530 --> 00:08:42,800 Okay, let me validate the model, 157 00:08:42,800 --> 00:08:44,420 save the model 158 00:08:44,420 --> 00:08:46,143 and try to run it one more time. 159 00:08:47,610 --> 00:08:51,050 Notice a bunch of the polygons, our points are skipped 160 00:08:51,050 --> 00:08:53,960 because of a negative or very small distance 161 00:08:53,960 --> 00:08:56,820 indicating that the buffer size was really small 162 00:08:56,820 --> 00:08:57,893 in that location. 163 00:08:59,150 --> 00:09:01,750 Looks like the model ran to completion. 164 00:09:01,750 --> 00:09:04,643 Now, I can look at the Attribute Table, 165 00:09:05,600 --> 00:09:09,220 the Summary Table sorry that I just derived 166 00:09:09,220 --> 00:09:11,263 to get a better idea of the results. 167 00:09:12,330 --> 00:09:15,400 Okay, well this clears up the sum shape area. 168 00:09:15,400 --> 00:09:17,670 We obviously don't need the second one 169 00:09:17,670 --> 00:09:21,133 to be included in that summary statistics calculation. 170 00:09:22,100 --> 00:09:25,890 And what we can see here is that we've got one polygon 171 00:09:26,760 --> 00:09:31,070 where both it's inside the Winooski River Basin 172 00:09:31,070 --> 00:09:32,837 and it is a recreation site 173 00:09:32,837 --> 00:09:34,883 and we can see that area here. 174 00:09:35,790 --> 00:09:37,200 If we want to compute the percent 175 00:09:37,200 --> 00:09:39,850 of the Winooski River Basin that was covered 176 00:09:39,850 --> 00:09:42,250 by the buffered recreation sites, 177 00:09:42,250 --> 00:09:44,840 we could simply refer back to the original 178 00:09:44,840 --> 00:09:46,830 Winooski River Basin data 179 00:09:46,830 --> 00:09:50,010 and divide the output value from this analysis 180 00:09:50,010 --> 00:09:52,943 by that shape area from the Winooski River Basin. 181 00:09:55,790 --> 00:09:59,030 We'll continue our example by extending the simple models 182 00:09:59,030 --> 00:10:00,460 to include parameters 183 00:10:00,460 --> 00:10:02,800 for both the Calculate Field expression 184 00:10:02,800 --> 00:10:04,203 and the buffer distance. 185 00:10:06,520 --> 00:10:09,340 Note that I've made a slight change 186 00:10:09,340 --> 00:10:11,780 to the Recreation Sites Table. 187 00:10:11,780 --> 00:10:12,613 Our buffer distance, 188 00:10:12,613 --> 00:10:15,280 we'll refer to the summer buffer distance 189 00:10:15,280 --> 00:10:17,570 and I've added another column to represent 190 00:10:17,570 --> 00:10:19,143 the winter buffer distance. 191 00:10:22,320 --> 00:10:24,920 We'll use the parameters to control 192 00:10:24,920 --> 00:10:26,960 which buffer we're calculating the summer 193 00:10:26,960 --> 00:10:28,990 or the winter buffer distance 194 00:10:28,990 --> 00:10:32,400 as well as the buffer that's applied 195 00:10:32,400 --> 00:10:34,550 to the recreation points that are selected. 196 00:10:35,590 --> 00:10:38,240 We come back over to our model. 197 00:10:38,240 --> 00:10:41,510 Again, we see its the same model that we had before. 198 00:10:41,510 --> 00:10:43,170 I'm gonna clean it up a little bit 199 00:10:43,170 --> 00:10:44,980 by clicking on the Auto Layout 200 00:10:46,670 --> 00:10:49,300 which in turn means I need to expand the window a little bit 201 00:10:49,300 --> 00:10:51,230 so I can see everything. 202 00:10:51,230 --> 00:10:54,220 ArcGIS has simply organized the layout 203 00:10:54,220 --> 00:10:56,313 according to the workflow I specified. 204 00:10:57,220 --> 00:10:59,710 Okay, let's create a parameter 205 00:10:59,710 --> 00:11:02,543 from our Calculate Field operation, 206 00:11:04,290 --> 00:11:06,867 a variable from our parameter 207 00:11:06,867 --> 00:11:09,200 and we're gonna use the expression 208 00:11:10,740 --> 00:11:13,063 as what we want to specify for our parameter. 209 00:11:14,090 --> 00:11:16,380 Now, the language gets a little bit confusing here 210 00:11:16,380 --> 00:11:18,700 because the expression is a parameter 211 00:11:18,700 --> 00:11:20,760 of the Calculate Field tool 212 00:11:20,760 --> 00:11:23,020 but if we want the expression to also serve 213 00:11:23,020 --> 00:11:26,160 as a parameter in the model that we're running, 214 00:11:26,160 --> 00:11:31,160 we right click once again and check the parameter button. 215 00:11:31,610 --> 00:11:33,510 You see the little P next to it, 216 00:11:33,510 --> 00:11:35,450 that indicates that's something that you can set 217 00:11:35,450 --> 00:11:38,603 at runtime to affect the way the model performs. 218 00:11:39,830 --> 00:11:41,860 If we double click this, 219 00:11:41,860 --> 00:11:43,720 we look and we see right now 220 00:11:43,720 --> 00:11:45,640 that the expression is set to 221 00:11:45,640 --> 00:11:48,933 number of summer parking spots times five. 222 00:11:54,330 --> 00:11:56,590 That value's automatically assigned 223 00:11:56,590 --> 00:11:59,490 to the summer parking buffer 224 00:11:59,490 --> 00:12:01,420 that we specified earlier. 225 00:12:01,420 --> 00:12:03,430 We can add one more parameter here 226 00:12:05,960 --> 00:12:08,340 so that we can determine the field name 227 00:12:08,340 --> 00:12:10,540 or the field that we're going to calculate. 228 00:12:10,540 --> 00:12:14,720 Once again I'll set that as the parameter for the model 229 00:12:14,720 --> 00:12:16,130 and if I double click, 230 00:12:16,130 --> 00:12:20,050 I see that I now have access to a dropdown window 231 00:12:20,050 --> 00:12:24,373 to indicate the different fields that I can update here. 232 00:12:26,800 --> 00:12:30,890 Okay, one more parameter that we need to add here 233 00:12:34,530 --> 00:12:36,080 and that's our buffer distance. 234 00:12:41,220 --> 00:12:43,100 I'll set that as a model parameter 235 00:12:43,950 --> 00:12:46,740 and if I double click, I see already that it's indicated 236 00:12:46,740 --> 00:12:49,510 as a field which is what we want 237 00:12:49,510 --> 00:12:51,633 and here are my list of options. 238 00:12:53,540 --> 00:12:56,110 The winter buffer distance doesn't show right now 239 00:12:56,110 --> 00:12:59,173 but it will once the data reloads into the model. 240 00:13:01,080 --> 00:13:06,080 Okay, note that I validated and saved my model. 241 00:13:06,640 --> 00:13:08,513 Now if I run from here, 242 00:13:10,640 --> 00:13:13,290 the model will compute with the settings 243 00:13:13,290 --> 00:13:15,190 that are already enabled, 244 00:13:15,190 --> 00:13:16,600 the parameter settings I should say 245 00:13:16,600 --> 00:13:17,850 that are already enabled 246 00:13:17,850 --> 00:13:19,143 and produce my output. 247 00:13:23,530 --> 00:13:28,420 But instead, let's run it from the Catalog 248 00:13:29,480 --> 00:13:31,513 from within one of our tool boxes. 249 00:13:32,950 --> 00:13:34,520 Actually not one of our tool boxes, 250 00:13:34,520 --> 00:13:36,770 the tool box specific to this project 251 00:13:38,500 --> 00:13:39,923 and if I double click that, 252 00:13:41,370 --> 00:13:43,400 we see now that I've got some parameters 253 00:13:43,400 --> 00:13:44,513 that I can set here. 254 00:13:45,670 --> 00:13:47,400 Not in a very nice order 255 00:13:47,400 --> 00:13:49,410 and I could fix that as well 256 00:13:50,500 --> 00:13:54,600 if I want to get into updating the interface here. 257 00:13:54,600 --> 00:13:57,480 But the field name pertains to the calculation 258 00:13:57,480 --> 00:13:58,860 that's being made 259 00:13:58,860 --> 00:14:01,420 and the distance value pertains to the buffer 260 00:14:01,420 --> 00:14:02,483 that we're applying. 261 00:14:04,560 --> 00:14:08,183 So, let's keep our summer buffer parking. 262 00:14:09,420 --> 00:14:12,370 Instead of five let's set that to 25 263 00:14:14,030 --> 00:14:15,123 and I'll click Run. 264 00:14:19,570 --> 00:14:22,140 Another error message just to keep things interesting. 265 00:14:22,140 --> 00:14:24,120 This one about a schema lock. 266 00:14:24,120 --> 00:14:27,280 Think I might have to close this window here 267 00:14:28,300 --> 00:14:29,693 for the attribute table. 268 00:14:30,870 --> 00:14:32,993 Okay, let's try that one more time. 269 00:14:37,650 --> 00:14:42,120 Note that it reverts to that value of five. 270 00:14:42,120 --> 00:14:45,330 We've got our other attributes set already properly 271 00:14:45,330 --> 00:14:46,930 so let's go ahead and click Run. 272 00:14:50,980 --> 00:14:54,680 Model's running writing my summary statistics 273 00:14:54,680 --> 00:14:56,480 and we get those same kinds of warnings 274 00:14:56,480 --> 00:14:58,420 that we saw before. 275 00:14:58,420 --> 00:14:59,480 Note that none of the data 276 00:14:59,480 --> 00:15:02,350 is added to the interface this time. 277 00:15:02,350 --> 00:15:03,200 That's okay. 278 00:15:03,200 --> 00:15:05,163 We can come back into our Catalog, 279 00:15:09,680 --> 00:15:12,860 refresh that geo database 280 00:15:15,370 --> 00:15:17,560 and we have our Output Table right here. 281 00:15:17,560 --> 00:15:19,340 Looks like I neglected to specify 282 00:15:19,340 --> 00:15:21,920 a good output naming convention for that. 283 00:15:21,920 --> 00:15:24,300 Note also that all of the intermediate data 284 00:15:25,210 --> 00:15:26,660 has been deleted 285 00:15:26,660 --> 00:15:30,120 so I no longer have that Select Later By Location Result, 286 00:15:30,120 --> 00:15:34,140 that buffer result or the union that appears. 287 00:15:34,140 --> 00:15:36,570 I could modify that so that the intermediate data 288 00:15:36,570 --> 00:15:37,900 is not deleted 289 00:15:37,900 --> 00:15:40,120 by checking this box here 290 00:15:41,000 --> 00:15:43,190 which will affect the entire model 291 00:15:43,190 --> 00:15:45,660 or I can manage data sets individually 292 00:15:45,660 --> 00:15:47,240 if I wanted to keep them. 293 00:15:47,240 --> 00:15:51,350 For now let's just be happy with letting those get deleted 294 00:15:51,350 --> 00:15:54,193 as the successful conclusion of the model run. 295 00:15:55,240 --> 00:15:58,780 Okay, so you can see now how pretty rapidly 296 00:15:58,780 --> 00:16:02,450 you could run a number of different versions of this model, 297 00:16:02,450 --> 00:16:04,270 each with their own buffer distance, 298 00:16:04,270 --> 00:16:06,300 each with their own selection criteria 299 00:16:07,810 --> 00:16:11,570 be it for summer or winter buffers that you're interested in 300 00:16:11,570 --> 00:16:14,700 and rapidly calculate the amount of the watershed 301 00:16:14,700 --> 00:16:15,603 that's affected. 302 00:16:16,990 --> 00:16:19,600 Now, let's take it one step further 303 00:16:19,600 --> 00:16:22,273 and look at some iterators in our next example. 304 00:16:23,370 --> 00:16:26,390 In this next example, we're gonna change things up a bit. 305 00:16:26,390 --> 00:16:30,210 We'll look at town boundaries and some invertebrates data 306 00:16:30,210 --> 00:16:32,920 and we'll use the iterate feature selection Iterator 307 00:16:32,920 --> 00:16:36,900 which is kind of like a select by attribute operation. 308 00:16:36,900 --> 00:16:39,140 The output we're going to produce 309 00:16:39,140 --> 00:16:43,000 will be an Invertebrates feature class for each town. 310 00:16:43,000 --> 00:16:45,710 Now why would you maybe wanna do something like this? 311 00:16:45,710 --> 00:16:48,430 Well, suppose that this information is confidential 312 00:16:48,430 --> 00:16:51,570 and you don't wanna share it or distribute it too broadly 313 00:16:51,570 --> 00:16:55,270 but town's only administrator might need this information 314 00:16:55,270 --> 00:16:58,970 for making permit decisions based on whether there's 315 00:16:58,970 --> 00:17:02,440 endangered invertebrate species in that location. 316 00:17:02,440 --> 00:17:04,590 So, suppose you're working for the state 317 00:17:04,590 --> 00:17:06,880 and you control this data set 318 00:17:06,880 --> 00:17:09,460 and you want some easy and repeatable way 319 00:17:09,460 --> 00:17:11,710 to accommodate these requests. 320 00:17:11,710 --> 00:17:15,010 You could construct a model with an iterator 321 00:17:15,010 --> 00:17:18,330 to cycle through the data as the request come in 322 00:17:18,330 --> 00:17:20,713 and rapidly turn that request around. 323 00:17:25,320 --> 00:17:27,010 I've already taken the liberty of constructing 324 00:17:27,010 --> 00:17:29,660 the initial stage of the model here. 325 00:17:29,660 --> 00:17:32,680 We're gonna use a Select Later by Location operation 326 00:17:32,680 --> 00:17:35,320 and then copy those features that are selected 327 00:17:35,320 --> 00:17:37,193 into a new output data set. 328 00:17:38,390 --> 00:17:40,240 And of course if I run this now, 329 00:17:40,240 --> 00:17:41,980 what will happen is that 330 00:17:41,980 --> 00:17:45,160 all of the invertebrate point locations 331 00:17:45,160 --> 00:17:47,760 located within my Central Vermont towns 332 00:17:47,760 --> 00:17:51,660 will be selected and copied to a new output data set. 333 00:17:51,660 --> 00:17:54,070 But that's not exactly what we want. 334 00:17:54,070 --> 00:17:56,890 Instead, we wanna go town by town 335 00:17:56,890 --> 00:17:58,540 through my list of towns here 336 00:17:59,864 --> 00:18:02,450 and select only the invertebrates that are located 337 00:18:02,450 --> 00:18:04,113 within that town boundaries. 338 00:18:05,880 --> 00:18:09,700 In this case, we use the Iterate Feature Selection iterator 339 00:18:09,700 --> 00:18:10,853 to make that happen. 340 00:18:12,160 --> 00:18:14,083 If I click on the iterator dropdown, 341 00:18:15,220 --> 00:18:17,170 I click that Iterate Feature Selection 342 00:18:17,170 --> 00:18:18,800 from the list of options 343 00:18:18,800 --> 00:18:20,313 and it appears in my screen. 344 00:18:22,030 --> 00:18:26,320 Once again I'm going to expand my interface here 345 00:18:26,320 --> 00:18:28,920 and maybe shrink the display size just a little bit. 346 00:18:30,380 --> 00:18:33,100 So, now that I've got my iterator in, 347 00:18:33,100 --> 00:18:34,683 it's time to populate that. 348 00:18:35,810 --> 00:18:37,530 First things first, 349 00:18:37,530 --> 00:18:40,160 since we're gonna iterate over the towns, 350 00:18:40,160 --> 00:18:42,240 I'm gonna break my connection 351 00:18:42,240 --> 00:18:45,110 to that Select Later by Location with the town data 352 00:18:46,670 --> 00:18:50,200 and instead, I'm gonna connect my town 353 00:18:50,200 --> 00:18:52,690 to my Iterate Feature Selection 354 00:18:52,690 --> 00:18:54,983 and they will be my input features. 355 00:18:56,610 --> 00:18:59,810 So, from here, I'm gonna just rename this 356 00:18:59,810 --> 00:19:02,410 to make this a little bit easier for me to remember. 357 00:19:03,810 --> 00:19:05,473 This is the town boundary, 358 00:19:08,060 --> 00:19:10,083 the actual feature itself, 359 00:19:12,050 --> 00:19:14,780 and this is the town name, the attribute 360 00:19:16,850 --> 00:19:18,663 of the selected feature. 361 00:19:19,740 --> 00:19:24,740 Okay, from here, I'll connect my town boundary 362 00:19:27,130 --> 00:19:28,750 as the selecting features 363 00:19:28,750 --> 00:19:31,283 in my Select Later by Location operation. 364 00:19:32,460 --> 00:19:34,520 Let's clean up that window one more time 365 00:19:36,470 --> 00:19:38,800 and see what we can see here. 366 00:19:38,800 --> 00:19:43,800 Now, I've got my Central Vermont towns being iterated over 367 00:19:43,950 --> 00:19:46,070 and for each one of those selections, 368 00:19:46,070 --> 00:19:49,100 that information's passed to the town boundary 369 00:19:49,100 --> 00:19:52,290 which is then used as the Select Later by Location, 370 00:19:52,290 --> 00:19:53,420 the selecting layer, 371 00:19:53,420 --> 00:19:58,040 to select the appropriate invertebrates point locations 372 00:19:58,040 --> 00:20:02,430 that can then be copied into a new output feature class. 373 00:20:02,430 --> 00:20:04,513 So we've got one last thing here to do. 374 00:20:05,750 --> 00:20:08,490 Instead of naming every output feature class 375 00:20:08,490 --> 00:20:10,403 Invertebrate Copy Features, 376 00:20:13,100 --> 00:20:15,540 let's specify the town name 377 00:20:18,260 --> 00:20:20,990 using inline variable substitution. 378 00:20:20,990 --> 00:20:25,070 So again, that value town name comes from here 379 00:20:25,070 --> 00:20:28,070 and when we want to do that inline variable substitution, 380 00:20:28,070 --> 00:20:33,070 we surround that variable with percent signs. 381 00:20:33,790 --> 00:20:35,460 Did I already say one last thing 382 00:20:35,460 --> 00:20:38,470 because we have one more thing that we should do here 383 00:20:38,470 --> 00:20:40,150 before we move on. 384 00:20:40,150 --> 00:20:43,070 In this case, I'm gonna use this Group field 385 00:20:43,070 --> 00:20:44,780 and my Town Name attribute 386 00:20:45,740 --> 00:20:48,563 and specify that we should skip any null values. 387 00:20:50,620 --> 00:20:55,600 Okay, at this point we can save and validate the model 388 00:20:55,600 --> 00:20:56,743 before we click Run. 389 00:21:05,929 --> 00:21:08,240 Here we are, the model has finished running 390 00:21:08,240 --> 00:21:11,630 and we can scroll back through the model log 391 00:21:11,630 --> 00:21:14,430 to find out if there are any problems. 392 00:21:14,430 --> 00:21:17,983 So for example, for the town of Johnson, 393 00:21:18,928 --> 00:21:20,670 we generated an empty output. 394 00:21:20,670 --> 00:21:23,170 That means there are no invertebrate points 395 00:21:23,170 --> 00:21:25,183 located within that particular town. 396 00:21:26,460 --> 00:21:28,620 Likewise, we've got an error message here 397 00:21:28,620 --> 00:21:30,850 that did not cause the model to fail 398 00:21:30,850 --> 00:21:33,850 but means that the data for this particular town 399 00:21:33,850 --> 00:21:35,950 was not written to output. 400 00:21:35,950 --> 00:21:39,780 In this case, it's an issue with spaces in the filename. 401 00:21:39,780 --> 00:21:43,170 Hyde Park has a space in the town name attribute. 402 00:21:43,170 --> 00:21:45,860 If this was more important than just a demonstration, 403 00:21:45,860 --> 00:21:49,330 I could go back in to the attribute table 404 00:21:49,330 --> 00:21:51,510 for my Central Vermont town boundaries 405 00:21:51,510 --> 00:21:53,863 and make adjustments to those town names. 406 00:21:55,180 --> 00:21:56,300 In this last example, 407 00:21:56,300 --> 00:22:00,850 we use the For iterator to create variable size buffers 408 00:22:00,850 --> 00:22:03,940 based on the number of parking spaces in the winter 409 00:22:03,940 --> 00:22:05,893 at each one of the recreation sites. 410 00:22:06,910 --> 00:22:10,230 As you can see, I've already created most of the model here 411 00:22:10,230 --> 00:22:11,830 and I've added the For iterator. 412 00:22:12,690 --> 00:22:15,793 Everything's ready to go except for that iterator. 413 00:22:17,810 --> 00:22:20,310 In this case, you see that you need to specify 414 00:22:20,310 --> 00:22:24,060 a From value, a To value and the step size 415 00:22:24,060 --> 00:22:27,053 or the increment between that From and To value. 416 00:22:28,490 --> 00:22:32,460 Let's ago from 10 to 50 417 00:22:34,240 --> 00:22:35,703 with a step size of 10. 418 00:22:37,240 --> 00:22:39,280 I click Okay and now it appears 419 00:22:39,280 --> 00:22:40,830 that everything's ready to run. 420 00:22:41,750 --> 00:22:44,210 Let's check in on my Field Name. 421 00:22:44,210 --> 00:22:47,760 I'm gonna make a calculation for that winter buffer distance 422 00:22:50,170 --> 00:22:52,630 and in terms of my calculation, 423 00:22:52,630 --> 00:22:56,270 I'm gonna multiply the number of winter parking spots 424 00:22:56,270 --> 00:22:59,400 by the value that comes out of my iterator. 425 00:22:59,400 --> 00:23:02,983 10, 20, 30, 40 or 50. 426 00:23:05,300 --> 00:23:08,260 From there, I set my buffer 427 00:23:10,350 --> 00:23:12,410 for the BufferDistanceWinter 428 00:23:13,758 --> 00:23:15,070 and the last thing I need to do 429 00:23:15,070 --> 00:23:17,190 is change my Output Feature Class name 430 00:23:17,190 --> 00:23:21,520 so that I write a new feature class for each buffer size. 431 00:23:21,520 --> 00:23:24,940 Once again I add that percent value percent 432 00:23:24,940 --> 00:23:28,593 inline variable substitution and click Okay. 433 00:23:29,590 --> 00:23:34,590 At this point, I can save, validate and run the model. 434 00:23:35,620 --> 00:23:38,140 I'll join you in a minute when it's done. 435 00:23:38,140 --> 00:23:40,410 Well, the model ran to completion 436 00:23:40,410 --> 00:23:42,580 and we can see the outputs here 437 00:23:42,580 --> 00:23:44,450 all in different shades of blue, 438 00:23:44,450 --> 00:23:48,190 all representing the dissolved boundaries 439 00:23:48,190 --> 00:23:51,740 around the buffered regions for our recreation sites 440 00:23:51,740 --> 00:23:56,640 based on that winter parking space availability. 441 00:23:56,640 --> 00:23:58,870 All right, well that's it for iterators 442 00:23:58,870 --> 00:24:01,330 or at least that's all I'm gonna show for now. 443 00:24:01,330 --> 00:24:03,950 There's plenty more to learn here like always 444 00:24:03,950 --> 00:24:06,180 but I think it's time to let you get your hands dirty 445 00:24:06,180 --> 00:24:07,480 and see what works for you 446 00:24:08,690 --> 00:24:11,733 as you develop your own geoprocessing workflows.