Using the concept of region
What will you learn?
- How to use the concept of Regions
An alternate way to solve the exercise of the previous lesson is by means of Region. This subset of functors permits division of a map into several regional maps, which can be input for separate models or submodels, whose parameters are customized for each map’s region. Let’s adapt the previous model to use the concept of regions. First open the Region Tab in the library window.
These functors can be combined to produce regional maps and submodels, as well as to merge the regional maps into a single map after a processing is performed. In this lesson you will learn how to retrieve the area of the remaining forest for each state; as a result each regional map will correspond to a state area. Open the model completed in the previous lesson. Select the functors within the container Repeat with the Hand tool and then drag them out of Repeat.
Delete the container Repeat and place the containers Region Manager from the Region tab and For Each Category from the Control tab. Place the latter within the first.
Region Manager manages the regionalization process, while For Each Category replaces the Repeat making the model iterate for each category present in the categorical map used to define the regions, in this case the map of the Brazilian Amazon states.
Now select all functors, except the input and output maps, and place them within For Each Category.
Now break the link between Load Categorical Map and Calculate Map (use the Remove Items tool and click on the arrow connecting both functors); next, connect the first to Region Manager and to For Each Category too. This map will control the regionalization process splitting the other maps into several regions according to its cell classes or categories through the functor Regionalize Map. Drag this functor and place it within For Each Category, break the link between Map brazilian_amazon_lanscape.tif
and Calculate Map and finally connect the first to Regionalize Map.
Note that there are two Number Map functors disconnected within Calculate Map. You do not need the Map #2 and Value #1 anymore, so delete them. Now connect Regionalize Map to Map #1. Open the Save
Lookup Table functor and change the file name to remaining_forest_extent_per_state
. Make sure it will be saved into folder lesson3.
At a last step, you will need to modify the Calculate Map. Open it with Edit Functor. Write: if i1 = 2 then 1 else null. Remember that “2” represents forest.
Finally save the model as a new file my_calc_forest_remaining_per_state_using_subregions.xml
into folder Region_Lesson and run it.
Compare this model’s output with the result from the previous lesson. Do they match? Can you explain how this model works?
Observe that you did not need to segregate the information per state in Calculate Map because Regionalize Map already did it.
Now let’s move on to more advanced spatial analyses.