I'm trying to create a barrier (rivers) that can't be crossed by the least cost path.
I've created a transition layer using "areas" which contains the transition values on land, and on rivers. However, the barrier has a 'buffer' around it, with increasing values, instead of being a discrete barrier.
Any ideas on how to create a discrete boundary? preferably with the barrier as a value 1000, with everywhere else a value of 1.
## Create cost surface where "land" exists in the middle
cost <- raster(nrow=100, ncol=100,
xmn=0, xmx=100, ymn=0, ymx=100, crs="+proj=utm")
cost <- 10
cost[cellFromRowColCombine(cost, 50:55,20:80)] <- 1000
costf <- asFactor(cost < 100)
## Produce transition matrices, and correct because 8 directions
trCost <- transition(costf, "areas", directions=16)
trCost1 <- geoCorrection(trCost[], type="c")