[R-sig-Geo] help me find a buffer around a polygon

Robert J. Hijmans r.hijmans at gmail.com
Thu Nov 18 15:29:18 CET 2010


Roman, Have you tried combinations of the functions 'edge', and
'distance' (and perhaps adjacency, if the 'amount' is expressed in
cells rather than distance). Robert

On Thu, Nov 18, 2010 at 5:58 AM, Roman Luštrik <roman.lustrik at gmail.com> wrote:
> Dear list,
>
> I've been searching around and I continue to do so, but in the mean time I'm
> seeking your advice on how to improve my approach.
>
> I'm using raster package and I'm trying to find cells around (let's call it
> a buffer) and inside a polygon. These subsetted cells are used for
> calculations later on. I'm basically trying to "grow" a polygon by a certain
> specified amount.
>
> I have created a raster with values derived as 1:ncell(my.object), where
> each value actually represents cell number and in a sense, position. This is
> the playground for my polygon.
>
> So far, I've approached this by:
> - find cell values inside the polygon (former raster::polygonValues)
> - find cell values within the buffer of SpatialLines object (made from the
> above polygon) (former raster::lineValues)
> - find unique cell values from the above results
>
> The problem is that finding buffers around each cell on a line (second step)
> is pretty RAM greedy. Would there be a more efficient way of "growing" a
> polygon, preferably without using external software?
>
>
> Cheers,
> Roman
>
>
>
> --
> In God we trust, all others bring data.
>
>        [[alternative HTML version deleted]]
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>



More information about the R-sig-Geo mailing list