 ## syntax

• griddist(impedance, destpoint_gridid, startvalues)

## definition

griddist(impedance, destpoint_gridid, startvalues) results in a travel impedance value for each cell of a grid towards the nearest point in a point set, taking into account the impedance of each grid cell (e.g. based on slope or land use type). The function has the following arguments:

• impedance is a grid attribute containing a resistance value for each cell.
• destpoint_gridid contains a set of grid index numbers for the pointset to which the impedances are calculated. See RelateToGrid for how to calculate such a grid relation attribute
• startvalues contains the initial impedance values for the point set.

The impedance is calculated taken into account the length of each cell (with value 1 for each cell) and the grid cell impedance. The resulting values unit has a float32 or float64 value type, based on the value type of the impedance and startvalues arguments. The resulting domain unit is the domain unit of the impedance argument.

## description

The griddist function is often used to calculate off road travel resistances, where e.g. the land use type and the slope have an important influence on the travel time/costs.

## conditions

The values unit of the arguments impedance and startvalues must match.

The domain of the arguments destpoint_gridid and startvalues must match.

5.85

## example

`attribute<gridDomain> GridDomain_rel (Destination);attribute<float64>    griddist       (GridDomain) :=   griddist(resistance, GridDomain_rel, const(0.0, Destination));`
 resistance 1 1 1 1 1 2 3 0 0 1 2 4 5 1 1 5 6 3 2 2 2 2 1 1 1
GridDomain, nr of rows = 5, nr of cols = 5

 GridDomain_rel {1, 1} {1, 3} {4, 1} {4, 4}
domain Destination, nr of rows = 4

 griddist 1.71 0.71 0.50 0.50 0.71 2.50 0 0 0 0.50 3.54 2.83 2.50 0.50 0.71 4.95 4 3.33 2 1.5 2 0 1.5 1 0
GridDomain, nr of rows = 5, nr of cols = 5

OBJECT VISION BV
Vrije Universiteit
De Boelelaan 1085
1081 HV Amsterdam
The Netherlands

tel: +31 (0)20 598 9083
fax:+31 (0)20 598 9904