How does the function “extract” deal with different projections?
问题 I need to use the function extract() to do a weighted average extraction from a raster using a grid cell of equal sized squares. My polygon grid is in UTM21n and the raster is in GCS WGS84 datum D. Do I have to reproject the raster before using it into extract()? Or will the function handle it properly? 回答1: You can find the source code of function extract for SpatialPolygons here. The code starts with the following snippet: setMethod('extract', signature(x='Raster', y='SpatialPolygons'),