Skip to content
Prev 8105 / 29559 Next

assigning raster cell values based on predefined criteria

Sorry, that was the distance to the border of the polygon.




For the distance to the centroid:

# A example of polygon:
  ho_sp <- 
SpatialPolygons(list(Polygons(list(Polygon(cbind(c(0,1,1,0,0), 
c(0,0,1,1,0)))), ID="ho")))

ho.win <- as(ho_sp,"owin")

centroide <- centroid.owin(ho.win)
h2.ppp<-ppp(centroide$x, centroide$y, window=ho.win)
ho.dist<-distmap(h2.ppp)

plot(ho.dist)
ho.dist$v[1:5,1:5]



HNTH,

Marcelino
At 14:54 22/04/2010, Marcelino de la Cruz wrote:

            
________________________________

Marcelino de la Cruz Rot

Departamento de  Biolog?a Vegetal
E.U.T.I. Agr?cola
Universidad Polit?cnica de Madrid
28040-Madrid
Tel.: 91 336 54 35
Fax: 91 336 56 56
marcelino.delacruz at upm.es
_________________________________