Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
tutorial:calculating_accumulated_cost_surface_and_least-cost_pathway [2013/08/14 15:05] admin |
tutorial:calculating_accumulated_cost_surface_and_least-cost_pathway [2017/01/27 16:46] (current) francisco [What will you learn?] |
||
---|---|---|---|
Line 59: | Line 59: | ||
| > 20 | 5 | | | > 20 | 5 | | ||
- | Let’s begin the model by loading the maps ''landuse.tif'' and ''slope.tif'' using the functor //[[:Load Map]]//. Then, let’s incorporate the two previous tables. Add a Lookup Table from Table tab. | + | Let’s begin the model by loading the maps ''landuse.tif'' and ''slope.tif'' using the functor //[[:Load Map]]//. Then, let’s incorporate the two previous tables. Add a [[:Lookup Table]] from Lookup Table tab. |
You should have something like this:\\ | You should have something like this:\\ | ||
Line 66: | Line 66: | ||
\\ | \\ | ||
\\ | \\ | ||
- | Now place three //[[:Calculate Map]]// and four //[[:Number Map]]// functors, one within each //[[:Calculate Map]]// and two //[[:Number Map]]// functors within the third, and one //[[:Number Table]]// within one of the two first //[[:Calculate Map]]// functors and //[[:Save Map]]//. Open //[[:Number Map]]//, assign a unique number (1 and 2) to each one and assign "1" to //[[:Number Table]]//. Finally connect Map ''landuse.tif'' to //[[:Number Map]]// 1 and Map ''slope.tif'' to //[[:Number Map]]// 2 of the two first //[[:Calculate Map]]//. Then, connect the two first to the third //[[:Calculate Map]]// and it to //[[:Save Map]]//. Open //[[:Save Map]]// and enter ''friction.tif''. This is what you get. | + | Now place three //[[:Calculate Map]]// and four //[[:Number Map]]// functors, one within each //[[:Calculate Map]]// and two //[[:Number Map]]// functors within the third, and one //[[:Number Table]]// within one of the two first //[[:Calculate Map]]// functors and //[[:Save Map]]//. Open //[[:Number Map]]//, assign a unique number (1 and 2) to each one and assign "1" to //[[:Number Table]]//. Finally connect Map ''landuse.tif'' and Map ''slope.tif'' to //[[:Number Map]]// 1 of the two first //[[:Calculate Map]]//. Then, connect the two first to the third //[[:Calculate Map]]// respectively and it to //[[:Save Map]]//. Open //[[:Save Map]]// and enter ''friction.tif''. This is what you get. |
{{ :tutorial:cost3.jpg |}} | {{ :tutorial:cost3.jpg |}} | ||
Line 86: | Line 86: | ||
**i1*i2**\\ | **i1*i2**\\ | ||
\\ | \\ | ||
- | Save the model as ''my_friction'', verify its integrity and if it is O.K., run it.\\ | + | Save the model as ''my_friction'', and run it.\\ |
\\ | \\ | ||
Open on the Map Viewer ''friction.tif'', using “Pseudocolor” as Current Color Palette and in the Histogram click on Limits to Actual and Histogram Equalize. | Open on the Map Viewer ''friction.tif'', using “Pseudocolor” as Current Color Palette and in the Histogram click on Limits to Actual and Histogram Equalize. | ||
Line 115: | Line 115: | ||
</WRAP>\\ | </WRAP>\\ | ||
- | The **Source** port will receive the Map ''railroad.tif'' and the friction map output by the third //[[:Calculate Map]]//. Turn on **Diagonals Cost More**. This will penalize the movement across diagonal cells. Set **Maximum Number of Passes** to “2”. Leave all other options untouched.{{ :tutorial:cost7.2.jpg |}} | + | The **Source** port of [[:Calc Cost Map]] functor will receive the Map ''railroad.tif'' and the **Friction** port will receive the map output by the third //[[:Calculate Map]]//. Turn on **Diagonals Cost More**. This will penalize the movement across diagonal cells. Set **Maximum Number of Passes** to “2”. Leave all other options untouched. |
- | Open //[[:Calc Pathway Map]]// now with the Edit Functor Ports. Link Map ''town1.tif'' to the **Source** port <note tip>**TIP**: **Source**, in this case, also represents the destiny since the cost map was built from the existing railroad. Thus, this algorithm will search for the least-cost pathway from the source to the existing feature, i.e. the railroad.</note> | + | Open //[[:Calc Pathway Map]]// now with the Edit Functor Ports. |
- | Link the map output from //[[:Calc Cost Map]]// to the port **Cost** and Map ''railroad.tif'' to **Network** (because it represents a linear feature network) and the output **Network** port to //Save Map//. {{ :tutorial:cost8.2.jpg |}} | + | Link Map ''town1.tif'' to the **Source** port <note tip>**TIP**: **Source**, in this case, also represents the destiny since the cost map was built from the existing railroad. Thus, this algorithm will search for the least-cost pathway from the source to the existing feature, i.e. the railroad.</note> |
+ | |||
+ | Link the map output from //[[:Calc Cost Map]]// to the port **Cost** and Map ''railroad.tif'' to **Network** (because it represents a linear feature network) and the output **Network** port to //[[:Save Map]]//. {{ :tutorial:cost8.2.jpg |}} | ||
Activate the option **Use Lottery** (this is an artifact that permits the model to solve the path when two or more local minima are found).\\ | Activate the option **Use Lottery** (this is an artifact that permits the model to solve the path when two or more local minima are found).\\ | ||
\\ | \\ | ||
- | {{ :tutorial:cost9.jpg?300|}}//[[:Calc Pathway Map]]// ignores cells with values equal or lesser than 0 or null cells. In turn //[[:Calc Cost Map]]// needs a network map with null cells representing non-features. Go to //[[:Load Categorical Map]] and open it with the Edit Functor. Press the flag **Null Value** and make sure **Use specific value** is set to “0”.\\ | + | {{ :tutorial:cost9.jpg?300|}}//[[:Calc Pathway Map]]// ignores cells with values equal or lesser than 0 or null cells. In turn //[[:Calc Cost Map]]// needs a network map with null cells representing non-features. Go to //[[:Load Categorical Map]]// and open it with the Edit Functor. Press the flag **Null Value** and make sure **Use specific value** is set to “0”.\\ |
\\ | \\ | ||
\\ | \\ | ||
Line 130: | Line 132: | ||
Click on //[[:Save Map]]// with the Edit Functor, change the folder to an upper level, change the file format to “geotiff” and set **Suffix to Digits** to “0”, finally enter ''railway.tif''. The final model will look as follows: {{ :tutorial:cost10.jpg |}} | Click on //[[:Save Map]]// with the Edit Functor, change the folder to an upper level, change the file format to “geotiff” and set **Suffix to Digits** to “0”, finally enter ''railway.tif''. The final model will look as follows: {{ :tutorial:cost10.jpg |}} | ||
- | Save the model to a new file ''my_pathway.egoml'', verify it and if it is O.K., run it. This is going to take only a little while. Dinamica EGO has superior performance in relation to most commercial GIS packages; you may want to try this model on other software just for performance comparison. Open on the Map viewer ''railway.tif'', using "PseudoColor" as **Current Color Palette**. What do you see?\\ | + | Save the model to a new file ''my_pathway.egoml'', and run it. This is going to take only a little while. Dinamica EGO has superior performance in relation to most commercial GIS packages; you may want to try this model on other software just for performance comparison. Open on the Map viewer ''railway.tif'', using "PseudoColor" as **Current Color Palette**. What do you see?\\ |
\\ | \\ | ||
{{ :tutorial:cost11.2.jpg |}}\\ | {{ :tutorial:cost11.2.jpg |}}\\ | ||
\\ | \\ | ||
\\ | \\ | ||
- | You may try to maximize the solution for the Calc Cost Map algorithm by setting the **Maximum Number of Passes** to “0”. Compare the time spent by this run and its resulting path with that of previous model? Did it make a big difference?\\ | + | You may try to maximize the solution for the //[[:Calc Cost Map]]// algorithm by setting the **Maximum Number of Passes** to “0”. Compare the time spent by this run and its resulting path with that of previous model? Did it make a big difference?\\ |
\\ | \\ | ||
This type of model can also be modified to develop simultaneously multiple paths. Open the model ''join_towns.egoml'' in lesson 4 folder.{{ :tutorial:cost12.jpg |}} | This type of model can also be modified to develop simultaneously multiple paths. Open the model ''join_towns.egoml'' in lesson 4 folder.{{ :tutorial:cost12.jpg |}} | ||
Line 141: | Line 143: | ||
This model shows how you can use //[[:Calculate Map]]// to merge information from several maps into a single one. The product will be a map depicting the center cells for four towns. TIP: use always a sole cell to represent a location to be reached by //[[:Calc Pathway Map]]//.\\ | This model shows how you can use //[[:Calculate Map]]// to merge information from several maps into a single one. The product will be a map depicting the center cells for four towns. TIP: use always a sole cell to represent a location to be reached by //[[:Calc Pathway Map]]//.\\ | ||
- | Now replace the input in Map ''town1.tif'' with the file ''multiple_towns.tif'' and change the file in Map ''railway.tif'' to ''xrailways.tif''.\\ | + | Now replace, into model my_pathway.egoml, the input in Map ''town1.tif'' with the file ''multiple_towns.tif'' and change the file in Map ''railway.tif'' to ''xrailways.tif''.\\ |
Did you get something like this?\\ | Did you get something like this?\\ |