# G Exercise 05

Last updated: 2021-03-31 00:29:22

## G.1 Question 1

• Recreate the DEM of the Carmel area in UTM, as shown in the right panel in Figure 9.10.
• Calculate a point geometry of the peak of the Carmel mountain, by finding the centroid of the pixel that has the highest elevation in the image.
• Calculate the nearest point in the Mediterranean sea from the peak, assuming the sea area is all of the NA pixels in the image. (Hint: calculate the distances from the peak to all NA pixels, converted to points, then use which.min to find the nearest one.)
• Plot the DEM, the peak, the nearest “sea” point, the line connecting them, and the distance, as shown in Figure G.1. Figure G.1: Length of the shortest line between Carmel mountain peak and the Mediterranean sea

(50 points)

## G.2 Question 2

• Read the MOD13A3_2000_2019.tif raster, with monthly NDVI values, into a stars object named r.
• Reproject r to UTM with st_warp(r, crs = 32636).
• Read the Shapefile named nafot.shp, which includes polygons of “Nafa” administrative regions in Israel, and reproject it to UTM as well.
• Calculate the average NDVI for each polygon in each date.
• Plot the resulting time series of average NDVI for each of the “Nafot,” as shown in Figure G.2. Hint: you can start from an empty plot using plot(..., col=NA), then add the NDVI times series using lines in for loop; see Section 6.1.3.
• The time series of “Nafa” where the highest and lowest average NDVI were observed, during the studied period, need to be highlighted in blue and red, respectively. The other “Nafa” should be displayed in grey. Don’t specific use “Nafa” indices (such as 6) or names (such as "Golan"), instead calculate the required indices in your code. Figure G.2: Average NDVI over time in “Nafa” polygons, “Nafa” with highest and lowest observed average NDVI are marked in blue and red, respectively

(50 points)