Description Usage Arguments Value Examples
This function allows you to calculate the mean of all pixels within a buffer-zone around points of interest (POIs) for each layer in a raster stack. A tibble with mean values and additional columns with the provided date flags and other information is returned and can be used for forther analysis and plotting.
1 | ras_calc_mean_points(ras_stack, dir_shp, buffer, date_flag)
|
ras_stack |
Raster stack to analyze. |
dir_shp |
Full path to shape-file containing POIs (with file name and .shp) - e.g. created using dwd_stations_shp(). Provide unique point-IDs, column name = 'stat_id'! |
date_flag |
A vector containing the date flags of each layer, e.g. observation years, which is appended to result. Ascending numbers are assigned if empty. |
buffer_size |
Size of buffer around each point within which pixels are extracted and averaged (in meters). |
A tibble with calculated mean values per station and layer plus other information and date flags.
1 2 3 4 5 6 7 8 9 | # load processed data
ndvi_m_px_1 <- stack(".../phenoTS/example_scripts/MODIS_data_processed/ndvi_m_px_1.tif")
# mean of all pixels in layer within point-buffer (around DWD stations)
dir_shp <- ".../phenoTS/example_scripts/MODIS_data_processed/dwd_stations.shp"
# calculate mean per pixel-buffer
ndvi_m_1_poi <- ras_calc_mean_points(ndvi_m_px_1,dir_shp=dir_shp,buffer=5000,date_flag=c(2000:2018))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.