Re: [R-sig-Geo] Rasterize polygons

2014-01-07 Thread Tim Sippel
Thanks Robert, much appreciated. On Tue, Jan 7, 2014 at 1:57 PM, Robert J. Hijmans wrote: > Tim, > > To count the number of points (obsdeep) in each polygon, you can do: > > table( over(SpatialPoints(obsdeep), poly) ) > > There is no role for rasterizing polygons here. But to answer your > quest

Re: [R-sig-Geo] Rasterize polygons

2014-01-07 Thread Robert J. Hijmans
Tim, To count the number of points (obsdeep) in each polygon, you can do: table( over(SpatialPoints(obsdeep), poly) ) There is no role for rasterizing polygons here. But to answer your question: you are getting a count of 1 because there is never more than 1 polygon that matches a raster cell (n

[R-sig-Geo] Rasterize polygons

2014-01-07 Thread Tim Sippel
Hi- I need to count the number of observations in each of 8 polygons. I'm using the raster package for this, but am having trouble getting what I need. Why am I getting a count of 1 in each of the polygons defined below? Sample data can be downloaded here: https://drive.google.com/file/d/0B0d3zfS