I'm currently working on MODIS satellite product "MOD16A2" which provides regular 500m's resolution pixel of evapotranspiration. I basically need to extract from the map the mean value of different drainage basins. What I have is the raster map of evapotranspiration with no datum and a sinusoidal projection and shapefile of the basins.
I learnt, from this forum, I should use the zonal statistics choosing as input the raster map and basins shapefile and calculate the average. I'm facing two problems though:
- There are many fill values which space from 3276 to 3276.6, which is a problem because they're going to be counted on the average,
- I have to reproject the raster into the same datum of the shapefile, but when I try to use the "save as" and select the new CRS it generates another map with different number of columns and rows and also different pixel values.
For the first problem I settled on "save as" as null values all the values in the range 3000-4000 and it apparently works but still I'm going to have to deal with the 2nd problem.
I also tried to use the raster calculator and use the following formula:
("myraster" < 3276 ) * "myraster" and then using the GDAL conversion to set 0 as NODATA, but now I tried again the raster calculator doesn't transform into 0 the values any more. Also, I have to be able to repeat those steps for about 800 times (the number of maps that I have) to get a time series of evapotranspiration.
I don't have any knowledge on writing scripts yet and I'm only able to use QGIS.
I don't know how to use Google Engine and the time I have left is not much. I understood that reprojecting satellite's products, such as the MOD16 A2 MODIS'S product, can give some problem during the resampling in fact I obtained as result different number of rows and columns and different values. What I did is to use the "save as" right clicking the raster and only set the no data value in the range from 3000 to 4000. In this way the new map, matched perfectly the original one and provides all the values in the range settled before as no data. Later I just changed the projection of the drainage basins into the same projection of my raster, and then applied the zonal statistics. This time seems to work but just with a "small" incovenience: I had to repeat, manually, this step for all the maps. The zonal statistics from GRASS helped me to do a batch process but instead I obtained as many shapefile as the number of rasters is. Since I need the mean value of evapotranspiration which is calculated in table attributes of every shapefile generated, I wonder if there's a way to automatically extract the column I need from every table.