An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130830/3bf51f9d/attachment.pl>
Extract function - too much data for R?
6 messages · Michael Treglia, Philippi, Tom, GD
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130830/a52f756d/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130830/375f88a0/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130830/4776bc71/attachment.pl>
An embedded and charset-unspecified text was scrubbed... Name: not available URL: <https://stat.ethz.ch/pipermail/r-sig-geo/attachments/20130830/ad82d2a5/attachment.pl>
I had related situation with 85000 non-overlapping polygons, and a raster dataset with dimensions ~ 10000x10000. In that case I wanted the full distribution of pixel values inside each polygon, rather than just the mean. An efficient approach (much faster than extract) was: 1) Rasterize the polygons (to a single raster with the same dimensions as the input raster dataset). My polygons had a unique ID value that was burned into the raster. I did this with 'gdal_rasterize' 2) Use the 'crosstab' function in the 'raster' package to cross-tabulate the values from the ID raster with the values on the input raster dataset. This gives the full range of pixel values associated with each polygon ID. 3) From there, it is straightforward to apply whichever function to the pixel values for each ID. -- View this message in context: http://r-sig-geo.2731867.n2.nabble.com/Extract-function-too-much-data-for-R-tp7584509p7584521.html Sent from the R-sig-geo mailing list archive at Nabble.com.