H Exercise 06

Last updated: 2020-08-12 00:41:56

H.1 Question 1

  • Read the modis_south.tif raster to a multi-band raster object. This raster is a series of NDVI images from southern Israel. The date each layer refers to is recorded in the corresponding modis_south_dates.csv file.
  • Calculate a 12-band raster that will contain the maximal NDVI per pixel (excluding NA) for each month. The first band will contain the maximal values per pixel in all images taken in January, the second band will contain the maximal values per pixel in all images taken in February, and so on. Use corresponding the modis_south_dates.csv table to determine the layers corresponding to each month.
  • Plot the resulting raster as shown in Figure H.1 (including month names).
  • Remember: you cannot use the raster package in your solution! (see Section B.5.5.)
Maximum NDVI value per month in `modis_south.tif`

Figure H.1: Maximum NDVI value per month in modis_south.tif

(50 points)

H.2 Question 2

  • The following code creates a data.frame named elk_data:
  • The elk_data table contains the locations (x=Easting, y=Northing, crs=32617) of four different animals (ID) (elks in Canada), as shown in the following map.

  • Add the code section to load elk_data in your exercise.
  • Create an sf line layer with the trajectory of each animal (four features) and one attribute (the ID).
  • Calculate the convex hull polygon of each animal trajectory.
  • Plot the trajectories and the convex hull polygons, using a different color for each animal (Figure H.2). You can use col=hcl.colors(4, "Dark 2") to plot the geometries with four different colors and lty=2 to draw the convex hull polygons using dashed lines.
Trajectories and convex hull polygons of four elks

Figure H.2: Trajectories and convex hull polygons of four elks

(50 points)