Building A Model With ArcGIS ModelBuilder Saves Time
Building A Model With ArcGIS ModelBuilder Saves Time
Step 1
I’m assuming you have the software installed as well as the data downloaded. Otherwise, you
can check here on how to install ArcMap 10.x and here to download Landsat imagery from the
USGS data archive.
1
The model
builder window
4. Add the data, (this can be done before step 3 as well)
5. When designing a model, there are two major ways we navigate through the model (personal
view):
a) Sketching/drafting method:
2
This is a process whereby the workflow for the whole analysis is sketched/drafted before
beginning the process. This is very good when designing a very complex model.
b) On-the-fly designing.
This is the direct opposite, it involves making decisions as the model evolves. It’s very good
when designing simple models.
Having known that, we can expand our model builder window or re-open using the method I
described above in case it’s closed.
Step 2
1. Add in the needed tools. Since we already defined our goal above (masking and NDVI
calculation), this has informed us of the needed tools which are the masking tool and the raster
calculator.
Search for
tools, ArcGIS.
To access the masking tool, I’ll be using the search for tools window from the Geoprocessing
tools in the menu bar (see above). When clicked, a search window will appear by the right (see
below).
3
Use the search window when using “search for tools” in ArcGIS.
When it’s opened: search for Masking tools and Raster Calculator
Scroll down to select the Extract by Mask (Spatial Analyst) tool and drag it into the model
builder window. You should have something like in the image below.
Extract by
Mask (Spatial Analyst) tool
Repeat the same for the raster calculator by searching for a raster calculator (spatial
analyst) and dragging into the Model Builder window. You should have something like the
image below.
4
The model builder has a lot of features that we can take a quick tour here to learn about. For the
sake of this demonstration, I’ll be going straight to the matter of the day.
We said our goal is to clip a portion from the imagery and calculate NDVI for that portion, and
NDVI calculation requires Band4 and Band5 of Landsat 8 imagery, this can vary depending on
your imagery source. That means we would need to add one more masking tool, so we can use it
to mask the Band4 and Band5. Let’s drag one more masking tool, following the steps above.
There are overlaps in the tools, right? To change this, click on the icon (check arrow direction) to
auto-layout the tools. Take a quick tour of ModelBuilder if you haven’t.
5
You should have something like this after clicking the icon.
Double click on the tools to fill in the data. Below is the Extract by Mask tool interface.
You should have something like this after you fill in all information (input raster, shapefile to
mask, and output raster location).
6
Color code: Yellow represents the tool, blue represents the input, green represents the output.
Now let’s open the raster calculator to calculate the NDVI. I’ll be using the B5mask.tif and
the B4 mask.tif for the calculation. This is because that is the name I gave the output of the
masking tool.
When you auto-layout using the icon I described above. You should see something like this.
7
for any errors. Click on the validate all model icon to do this. Before we run the model, If you
want the output/final result (NDVI) to appear in your table of content, right-click on NDVI.tif
and click ‘Add to Display’.
Now you can run your model. Using the icon beside the validate model icon or go to the menu
bar, left-click on the model, and click Run.
8
While executing the red color shows the current tool it’s executing. This took me only a few
seconds to execute, instead of more, If I do had gone the manual way. Now, I have my NDVI
ready in the table of content and the display. Cool right?
This is obviously the tip of the iceberg, I’ll show you how to turn the model we built above into a
reusable tool in a future tutorial.
9
Woo-Hoo! You made it! Thank you for reading along, If you found this tutorial article useful
kindly share with your network. Thank you!
RESOURCES
https://pro.arcgis.com/en/pro-app/help/analysis/geoprocessing/modelbuilder/what-is-
modelbuilder-.htm
https://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/what-is-modelbuilder.htm
https://desktop.arcgis.com/en/arcmap/10.3/analyze/modelbuilder/a-quick-tour-of-
modelbuilder.htm
10