[R-sig-Geo] Efficient way to obtain gridded count of overlapping polygons?

Robert Hijmans r.hijmans at gmail.com
Thu Feb 17 17:48:00 CET 2011


> I am interested in creating a raster that summarizes the number of 
> overlapping polygons that underlie each cell (in order to display how 
> many species occur at that point). 

Lyndon, 

You can also do the below, with raster, see ?rasterize:

r <- rasterize(pols, r, fun='count')

or 

r <- rasterize(pols, r, fun=function(x,...)length(na.omit(x)))


-- 
View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Efficient-way-to-obtain-gridded-count-of-overlapping-polygons-tp6034590p6036670.html
Sent from the R-sig-geo mailing list archive at Nabble.com.



More information about the R-sig-Geo mailing list