# How to create landscape resistance map using path level spatial randomisation in QGIS?

I need to create a landscape resistance map based on path level spatial randomisation, as I have read in some research papers. Are there tools for this? I need to randomly shift and rotate the the utilised path I have to create available paths with identical spatial topology. I then need to compare the distribution of utilised path with avialable paths from each landscape resistant factor to determine resistance values.

• Can you give a citation? What do you mean by identical spatial topology?
– jsta
Mar 7 '15 at 13:22
• It is the method followed in Cushman, S. A., Chase, M., & Griffin, C. (2010). Mapping landscape resistance to identify corridors and barriers for elephant movement in southern Africa. In Spatial complexity, informatics, and wildlife conservation (pp. 349-367). Springer Japan that I hope to follow. fs.fed.us/rm/pubs_other/rmrs_2010_cushman_s012.pdf. I would like to draw routes probably with similar land use types
– LSJC
Mar 7 '15 at 13:27

Here is some R code. The paper says that they randomly shifted the path. I take that to mean they randomly shifted each node of the path. They say that the path was shifted between 0 and 30 but I think that it only makes sense to shift between -30 and 30.

taking advantage of center of gravity rotation in the maptools package

``````library(sp)
library(maptools)

#create the nodes of a spatiallines object
set.seed(2)
path.mat<-matrix(c(seq(1,60,3),(seq(1,60,3))+ceiling(abs(rnorm(60)*5))),ncol=2)
path<-Lines(list(Line(path.mat)),ID="p")

#randomly shift nodes between 0 and 30km
shiftx<-sample(seq(-30,30,0.01),nrow(path.mat))
shifty<-sample(seq(-30,30,0.01),nrow(path.mat))
npath.mat<-cbind(path.mat[,1]+shiftx,path.mat[,2]+shifty)
npath<-Lines(list(Line(npath.mat)),ID="np")
npathSL<-SpatialLines(list(npath))

#randomly rotate between 0 and 360 degrees
npath.rot<-elide(npathSL,rotate=sample(seq(0,360,0.01),1),center=apply(bbox(npathSL),1,mean))
npath.rot.mat<-coordinates(npath.rot)[][]
npath.rot<-Lines(list(Line(npath.rot.mat)),ID="npr")

npath.alllines<-SpatialLines(list(path,npath,npath.rot))
plot(npath.alllines,col=c("black","red","green"))
``````
• I could make the code more realistic if you provided a sample path. I could add some code to analyse the resistance of each path if you provided a sample resistance map (landuse raster).
– jsta
Mar 7 '15 at 15:45
• I am not quite sure, how I can send a file through this. Can you tell me how to?
– LSJC
Mar 8 '15 at 9:36