Calc Cost Map


This functor calculates an accumulated cost surface from source features using a friction map.


Name Type Description
Sources Map Type Source feature map. A map of non-null cells representing source features. If null value is not defined, an error will be reported.
Frictions Map Type Map expressing the difficulty to cross each cell. Difficulty is proportional to the cell value. An insurmountable cell can be represented by very high value. Null value cells will be passed to the cost map. Friction values must be positive, otherwise an error will be reported.
Also Calculate Cost Direction Map Boolean Value Type If true, the cost direction map will also be generated during the cost calculation and placed in the “Directions” output port. Otherwise, that output port will be left empty. Directions are represented using a Moore neighborhood (NONE=0, NW=1, N=2, NE=3, E=4, SE=5, S=6, SW=7, and W=8).

Optional Inputs

Name Type Description Default Value
Cell Type Cell Type Type Data cell type of the cost map must be compatible to the source feature and friction data cell types, otherwise an error will be reported. Signed 32 Bit Integer
Null Value Null Value Type Null value of the cost map. This value cannot be equal to zero because zero value represents source features on the cost map. If it is set to zero, an error will be reported. Default1)
Diagonals Cost More Boolean Value Type If true, diagonal movements are more expensive than orthogonal movements (horizontal / vertical). In this case, the cost of a diagonal movement is multiplied by 1.414213562. True
Maximum Number Of Passes Non Negative Integer Value Type Maximum number of passes that are used to calculate the cost map. The value 0 (zero) indicates that this functor will execute as many steps as needed in order to produce the best cost (optimized) map. Usually two passes are enough to produce optimized cost maps. 0
Frictions Are Relative Boolean Value Type If true, the friction values are relative to map resolution and represent friction units per meter. In this case, the friction values are automatically multiplied by the cell resolution (in meters). False


Name Type Description
Costs Map Type Accumulated cost surface map from each feature source. Output map has the same dimensions of the source feature map.
Directions Map Type Map showing the directions following the least costly path in the cost map. Directions are represented using Moore neighborhood (NONE=0, NW=1, N=2, NE=3, E=4, SE=5, S=6, SW=7, and W=8).



Cost calculation example

The algorithm that calculates the cost map is general type of “Pushbroom”. However, its spatial performance approximates to the so called “Pushgrow” algorithm, especially when using two or more passes.

Penalization for diagonal movements is effective only when the cell dimensions (width and height) are considered in the calculation of cost, friction values are high, or the cost map is represented using real numbers.

A friction map with cells represented by real numbers requires a cost map with cells represented by real numbers or an error will be reported.

Each pass used to calculate the cost map corresponds to four map passes originating from opposite directions.

Unreachable places on the friction map are excluded on the cost map and thus represented as null value cells. Costs are not accumulated across null value cells, thus regions surrounded by null value cells will not have their cell costs calculated, unless there is a source feature inside this region.

Math behind cost calculation
Cost calculation passes

Internal Name


Based on the value of the Cell Type input.