I have a raster(.tif) and point(.shp) layer. To calculate the average value of points located in each pixels: (1) For each image pixel that include multiple points, the average value of all points located in the pixel were calculated. (2) For each image pixel that include single point, the point value was chose directly. How can I calculate it in R ?
Two ways in ArcGIS to solve this problem: 1. Create a fishnet 1) Using ‘Create Fishnet’ tool to create a fishnet capture the raster pixel; 2) Using ‘Identify’ tool to identify the points located in each fishnet grid; 3) Using ‘Dissolve’ tool to calculate the average value of points located in each fishnet grid, set ‘Dissolve_Field’ parameter with ‘fishnet grid id’; 4) Using ‘Extract multi-values to points’ tool to extract the raster value. 2. Convert point to raster 1) Using ‘Point to raster’ tool convert point to raster, set ‘Cell assignment type’ parameter with ‘Mean’; 2) Using ‘Extract multi-values to points’ tool to extract the raster value.