[R-sig-Geo] finding coordinates of points on a dilation contour

Adrian.Baddeley at csiro.au Adrian.Baddeley at csiro.au
Wed Feb 1 03:27:20 CET 2012


Lorenzo Cattarino <l.cattarino at uq.edu.au> writes:

 > I have a set of coordinates representing a shape (i.e. a square). I would like to perform an Euclidean dilation operation,
 >  i.e., find all the point that lie at a distance r from the shape contour. I tried with the dilation function in the "spatstat" package 
 > but I could not get the coordinates of the points forming the dilated contour, nor the number of those points.

Use the function 'vertices'. You need to ensure that gpclib is enabled. For example:

library(spatstat)
spatstat.options(gpclib=TRUE)
w <- square(1) # or whatever your shape is
r <- 0.1             # Dilation distance
z <- dilation(w, r)
v <- vertices(z)

------
Adrian Baddeley


More information about the R-sig-Geo mailing list