# Home assignment 5#

Last updated: 2023-05-27 16:41:27


## Question 1#

• Import the following layers:

• data/statisticalareas_demography2019.gdb—Statistical areas

• output/sentinel2.tif—Sentinel-2 satellite image

• Rescale the raster values to the 0-1 range (see Rescaling) and calculate NDVI (see Calculating indices)

• Calculate the average NDVI per statistical area in Beer-Sheva ('SHEM_YISHUV' column == 'באר שבע'), using zonal statistics (see Zonal statistics).

• Plot the layer of average NDVI in statistical areas of Beer-Sheva. Use the "Greens" color map.

• Note: Do not re-create sentinel2.tif in your code. Instead, import it from output/sentinel2.tif.

## Question 2#

• Import the following layers:

• data/muni_il.shp—Israel towns

• output/sentinel2.tif—Sentinel-2 satellite image

• Aggregate the towns layer according to the 'Muni_Heb' column to dissolve the separate polygons per town (see Aggregation (.dissolve)).

• Calculate an attribute named prop with the proportion of each towns’ polygon area that is within the extent of the sentinel2.tif image (Stacking raster bands). For example, Beer-Sheva is 100% within the image (prop=1.0), Meitar is ~60% within the image (prop=0.6), etc. Hint: calculate the area of the original polygons, then calculate the area of the intersections (see Set-operations (.overlay)) with image extent polygon (see Raster extent), and finally divide the intersection area by the total area.

• Print the subset of towns layer where the proportion intersecting with the image extent is above 0, sorted by the proportion.

• Note: Do not re-create sentinel2.tif in your code. Instead, import it from output/sentinel2.tif.

Muni_Heb geometry prop
0 ×××¤×§×× POLYGON Z ((164539.498 577897.3... 1.000000
19 ×ª× ×©××¢ POLYGON Z ((186092.170 571779.8... 1.000000
9 ××§×× POLYGON Z ((189351.635 580896.1... 1.000000