Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
tutorial:building_a_simple_model [2013/08/14 03:49]
admin
tutorial:building_a_simple_model [2017/01/17 18:06]
isabella
Line 23: Line 23:
 You should have something like this:{{ :​tutorial:​simple_model_1.5.jpg |}}\\ You should have something like this:{{ :​tutorial:​simple_model_1.5.jpg |}}\\
 \\ \\
-Now you need to connect the functors to establish a model. First, let’s understand what a //​[[:​Calculate Map]]// does. This container is a calculator used for map algebra to combine and process maps, tables and constants. As a container, it does not function by itself. There is a need to add supplementary functors to it. In this case, each map processed by this container will be represented by the functor //[[:Number Map]]// ​available ​in the Map Algebra Supplementary tabGrab //[[:Number Map]]// ​and place it inside the container //​[[:​Calculate Map]]//. The container will resize to accommodate the //[[:Number Map]]//.\\+Now you need to connect the functors to establish a model. First, let’s understand what a //​[[:​Calculate Map]]// does. This container is a calculator used for map algebra to combine and process maps, tables and constants. As a container, it does not function by itself. There is a need to add supplementary functors to it. In this case, each map processed by this container will be represented by the functor //[[:Number Map]]//. Click in the hook tool {{:​tutorial:​hook.jpg|}} to create a hook functor with //[[:Number Map]]// inside the container //​[[:​Calculate Map]]//. The container will resize to accommodate the //[[:Number Map]]//.\\
 \\ \\
 \\ \\
Line 32: Line 32:
 \\  \\ 
 \\ \\
-{{:​tutorial:​simple_model_3.0.1.jpg |}}+{{:​tutorial:​simple_model_3.0.1.jpg |}}\\
  
-Clicking on the arrow with the Edit Functor Ports tool allows us to visualize the links between a pair of functors.{{ :​tutorial:​simple_model_4.jpg?​300|}}\\                                                                                    +Clicking on the arrow with the Edit Functor Ports tool allows us to visualize the links between a pair of functors.\\ ​                                                                                   
-\\ + 
-\\ +Now that the functors are linked, you can rearrange the model by clicking on the execute layout. Note that the model will be organized\\ from left to right or left to bottom according to its execution sequence.\\
-\\ +
-\\+
 \\ \\
 \\ \\
Line 50: Line 48:
 \\ \\
 \\ \\
 +
 +In the next step, open the //​[[:​Calculate Map]]// container by grabbing the Edit Functor and clicking on it. Note that map #1 is represented by **i1**. The //​[[:​Calculate Map]]// enables the formulation of various algebraic and logic equations containing maps, tables and constants.\\
 \\ \\
 \\ \\
  
-{{ :tutorial:simple_model_3.0.2.jpg?300|}}Now that the functors are linked, you can rearrange the model by\\ clicking on the layout tool. Note that the model will be organized\\ from left to right or left to bottom according to its execution\\ sequence. \\+{{:​tutorial:​simple_model_5.1.jpg?nolink ​|}}
 \\ \\
 \\ \\
 \\ \\
 +[[:​image_expression_type|Here]] you can find examples of operators that can be applied to process data within this container.\\
 \\ \\
 \\ \\
 \\ \\
-In the next step, open the //​[[:​Calculate Map]]// container by grabbing the Edit Functor and clicking on it. Note that map #1 is represented by **i1**. The //​[[:​Calculate Map]]// enables the formulation of various algebraic and logic equations containing maps, tables and constants.{{:​tutorial:​simple_model_5.1.jpg |}}\\ 
-\\ 
-\\ 
-\\ 
-[[:​image_expression_type|Here]] you can find examples of operators that can be applied to process data within this container. 
  
 Besides writing the equation, there are two parameters that must be set. The **Cell Type** and the **Null Value**. You will always find these parameters in functors that produce maps as output. The default is "​Signed 32 Bit Integer",​ but you can use "IEEE 754 32 Bit Real" to represent fractional numbers. ​ Besides writing the equation, there are two parameters that must be set. The **Cell Type** and the **Null Value**. You will always find these parameters in functors that produce maps as output. The default is "​Signed 32 Bit Integer",​ but you can use "IEEE 754 32 Bit Real" to represent fractional numbers. ​
 \\ Try to use always the most economical representation for data cell type to save memory. If you are not sure about the numeric range of the output, use real number representation.{{ :​tutorial:​simple_model_6.jpg|}} \\ Try to use always the most economical representation for data cell type to save memory. If you are not sure about the numeric range of the output, use real number representation.{{ :​tutorial:​simple_model_6.jpg|}}
 \\ \\
 +\\
 +\\
 +\\
 +Now that you have learned the vast possibilities of this container, let’s write a simple equation: ​
 +\\ **if i1 = 9 then 1 else null** \\
 +\\
 +This means: Find the map class equal to 9, and set all others to null.\\ ​
 +Set the **Cell Type** to "​Unsigned 8 Bit Integer"​ and the **Null Value** to “Use default value”. Now you can close this container and open a map file to use as input for this model.
 \\ \\
 \\ \\
Line 79: Line 83:
 \\ \\
 \\ \\
-Now that you have learned the vast possibilities of this container, let’s write a simple equation: ​ 
-\\ **if i1 = 9 then 1 else null** \\ 
 \\ \\
-This means: Find the map class equal to 9, and set all others to null.\\ ​ 
-Set the **Cell Type** to "​Unsigned 8 Bit Integer"​ and the **Null Value** to “Use default value”. Now you can close this container and open a map file to use as input for this model. 
 \\ \\
 \\ \\
 Open the //[[:Load Map]]// functor and load the file ''​amazon_states.tif''​ from folder lesson1 (do not write the quotation marks). You do not need to worry about the other options, they are not needed for now.  Open the //[[:Load Map]]// functor and load the file ''​amazon_states.tif''​ from folder lesson1 (do not write the quotation marks). You do not need to worry about the other options, they are not needed for now. 
-{{ :​tutorial:​simple_model_7.jpg |}}+ 
 +{{ :​tutorial:​simple_model_7.jpg?​nolink ​|}}
  
 <note important>​Although you won’t need it in this lesson, you might set the null value by first turning on the **Null Value** flag on the //[[:Load Map]]// and then setting its value to "​0"​.</​note>​ <note important>​Although you won’t need it in this lesson, you might set the null value by first turning on the **Null Value** flag on the //[[:Load Map]]// and then setting its value to "​0"​.</​note>​
Line 97: Line 98:
 Now you need to save the result to a file. Open //[[:Save Map]]// and write ''​Mato_Grosso_state''​. {{ :​tutorial:​simple_model_8.jpg |}} Now you need to save the result to a file. Open //[[:Save Map]]// and write ''​Mato_Grosso_state''​. {{ :​tutorial:​simple_model_8.jpg |}}
  
-In the Advanced tab there is an option to set the file name **Suffix Digits**. Although the default is 2, this parameter will be ignored since there is only one iteration.\\ Use Compression is only applicable for geotiff and img format.+In the Advanced tab there is an option to set the file name **Suffix Digits**. Although the default is 2, this parameter will be ignored since there is only one iteration.\\ ​**Use Compression** is only applicable for geotiff and img format.
 The input map is a categorical map; its values do not represent quantities, but are identifiers to map classes, thus representing categorical data as follows: The input map is a categorical map; its values do not represent quantities, but are identifiers to map classes, thus representing categorical data as follows:
  
Line 114: Line 115:
 \\ \\
 \\ \\
-{{:​tutorial:​simple_model_9.jpg |}} +{{ :​tutorial:​simple_model_9.jpg?​nolink ​|}} 
 +\\ 
 +\\
 Save the model as ''​my_model''​ in lesson1 folder, click on check model script integrity to check out whether the model is ready to run, and if it is, run the model by clicking on the run model script button on the top toolbar and open the result on the Map Viewer. The output map depicts only the Mato Grosso state.{{ :​tutorial:​mato_grosso_state.1.jpg |}} Save the model as ''​my_model''​ in lesson1 folder, click on check model script integrity to check out whether the model is ready to run, and if it is, run the model by clicking on the run model script button on the top toolbar and open the result on the Map Viewer. The output map depicts only the Mato Grosso state.{{ :​tutorial:​mato_grosso_state.1.jpg |}}