I would like to add the average, minimum and maximum value of, let’s say soil moisture (variable "value" in my case), to each NUTS3 region (= a NUTS3 region is a polygon of a certain small area in Europe).
However, soil moisture values are stored in little grids. Therefore, I need to find a way to calculate which grids overlap with a certain NUTS3 region in order to determine the average soil moisture value for that NUTS3 region. Visually, it can be compared to this picture where little grids approximate together the shape of US states: http://fieldguide.mt.gov/RangeMaps%5CESMapQUAD_9217.jpg
It is possible that one NUTS3 region consists of 2 full grid cells and 3 half grid cells, while another NUTS3 region consists of only a 0.75 grid. It is also possible that some grids are empty because I don’t have values there.
My raster and NUTS shapefile can be found through the following link: https://drive.google.com/folderview?id=0By9u5m3kxn9yfjZtdFZLcW82SWpzT1VwZXE1a3FtRGtSdEl1c1NvY205TGpack9xSFc2T2s&usp=sharing
- grid <- readOGR(".", layer = "Filled_grid") # the variable "value" is the variable that I want to transfer to the respective NUTS3 regions.
- nuts <- readOGR(".", layer = "NUTS_RG_60M_2006") # in the end, in this shapefile should be an additional variable with the average of "value". This information should come from overlapping the NUTS3 regions with the grids.
I would like to find a solution for this problem in R. For ArcGis, I already found numerous related questions (such as Extract Raster Value into Polygon Attribute ) that can help me.
In R, I found out that the rasterToPolygons command of the raster package, cannot help me because it takes forever due to the amount of data I have.
Another option in R could be this one: https://stat.ethz.ch/pipermail/r-sig-geo/2011-March/011093.html , however, it does not work for me and I am not sure how to indicate that I want the max, min and mean of the variable "value". I believe the mean reason why I have trouble with solutions proposed on the internet is the fact that I stored the raster data in a shapefile, and then want to overlap with another shapefile (with the nuts3 regions). But this shouldn't be a problem, or is it?
I am a beginner in ArcGis but have some basic knowledge in R.