Here is a small height raster of a coast, with cells of and the sea along the west edge. You will find the slope of a cell, flood the coast from the sea, and turn the count into an area.
The idea. With central differences, and , and . A sea at level floods a cell if the cell is at or below . The cell must also be joined to the sea by neighbours that share an edge and are at or below .
Your tasks.
slope_deg, return the slope in degrees at a cell that is not on the edge of the raster.flooded, return the number of cells that a sea of level level reaches from the west column.area_ha, return the area in hectares of a number of cells.Run your code once to unlock the worked solution.
Have you tried it?
Do the tasks in the editor first, and run the checker after each one. Its hints help when a check fails. When you are ready, compare your code with this solution.
Log in to join the discussion.
Loading…