[R-sig-Geo] overlay polygon with raster

Simone Ruzza simone.ruzza12 at gmail.com
Thu Dec 4 01:15:02 CET 2014


Dear R-sig-geo users,

apologies for the simplicity of my question, but I have been
struggling with this for a bit I have not managed to find a solution.
Basically, I would like to overlay a polygon onto raster grid and
extract some statistics for the polygon in question i.e. the area of
every raster cell covered by the polygon. Here is a figure that might
make it clearer
<https://dl.dropboxusercontent.com/u/33966347/example.JPG> . I have
been fiddling around with the extract function from the raster
package, which works to some extent, as I am able to retrieve
information on the categories of each of the raster cells covered by
the polygon. However, as I said, I am interested in the area covered
by the polygon within each raster cell. I know that perhaps I should
try and convert my polygon into another raster and then overlay the
two rasters, but this perhaps would mean that the polygon should be
converted into a raster at a high resolution? If this was case, it is
not computationally feasible for me as some polygons I have cover a
huge area and it would take forever to overlay all those rasters. Any
help, suggestions would be highly appreciated!

thanks in advance!

Simone



More information about the R-sig-Geo mailing list