Skip to content
Prev 22678 / 29559 Next

Using gdistance to compute a least cost path which avoids certain cells entirely, no matter the distance

Hi Sharon,

note that if the road is "thin" (i.e. it takes only one or two pixels
wide), and if you use the function "mean" when creating the transition
layer, then it will always be possible to cross the roads.

I faced a similar problem, where I wanted to model an absolute barrier
(impossible to cross), and found it more convenient to work with
permeability rasters (rather than cost). So I can define permeability =
0 for barriers (i.e. infinte cost). Moreover, I defined a transition
function that returns the mean when both cells have non-zero values, but
returns zero if not.

?acu.-


El 01/05/2015 a las 17:08, sharx escribi?: