[R-sig-Geo] Sampling SpatialPolygonDataFrame attributes from points in a grid..

reeves at nceas.ucsb.edu reeves at nceas.ucsb.edu
Thu May 22 08:29:43 CEST 2008


Greetings:

I'd like to get some advice on performing this task:


Given a SpatialPolygonsDataFrame, and a regularly-spaced point grid
created 'over' the polygons using spsample() or similar method, how
to extract one attribute from the polygon 'beneath' the location of
each point in the grid, and then assign the computed attribute to
the point? Best end product would be a SpatialPointsDataFrame.

The next step would be to replace the attribute of all points corresponding
to each polygon with a weighted average of all the point subset's attribute
value.

I am reviewing the spsample() and overlay() methods, which look like
good candidates for this task. But perhaps there is a better way.

Can someone direct me to a sample solution to a similar task,
for example, a vector polygon to raster grid conversion?

Thanks in advance,
Rick Reeves
NCEAS




More information about the R-sig-Geo mailing list