#### 联系方式

• QQ：99515681
• 邮箱：99515681@qq.com
• 工作时间：8:00-20:00
• 微信：codinghelp

#### 您当前位置：首页 >> Python编程Python编程

###### 日期：2021-12-13 09:46

CEGE0096: Flood Emergency Planning

2nd Assignment (50%)

Module Coordinator: Dr. Aldo Lipani

1 Introduction

Extreme flooding is expected on the Isle of Wight and the authority in charge

of planning the emergency response is advising everyone to proceed by foot to

the nearest high ground.

To support this process, the emergency response authority wants you to develop

a software to quickly advise people of the quickest route that they should take

to walk to the highest point of land within a 5km radius.

Figure 1: Isle of Wight

1

2 Instructions

To complete this assignment, you need to build a Python application. Your

task is to create a Python program named ‘main.py’ that does what explained

in the following subsections. To do this, you are allowed to use only the packages

presented in the module.

The first 5 tasks will award you a total of 70 marks. The 6th task (10 marks)

is designed to test your ability to carry out your own research in order to solve

it. Finally, the 7th tasks is a creativity task that can award you 20 additional

marks for the development of additional unspecified features.

2.1 Task 1: User Input

The application should ask the user to input their current location as a British

National Grid coordinate (easting and northing). Then, it should test whether

the user is within a box (430000, 80000) and (465000, 95000). If the input coordinate

is outside this box, inform the user and quit the application. This is done

because the elevation raster provided to you extends only from (425000, 75000)

to (470000, 100000) and the input point must be at least 5km from the edge of

this raster.

2.2 Task 2: Highest Point Identification

Identify the highest point within a 5km radius from the user location.

To successfully complete this task you could (1) use the window function in

rasterio to limit the size of your elevation array. If you do not use this window

you may experience memory issues; or, (2) use a rasterised 5km buffer to clip

an elevation array. Other solutions are also accepted. Moreover, if you are not

capable to solve this task you can select a random point within 5km of the user.

2.3 Task 3: Nearest Integrated Transport Network

Identify the nearest Integrated Transport Network (ITN) node to the user and

the nearest ITN node to the highest point identified in the previous step. To

successfully complete this task you could use r-trees.

2.4 Task 4: Shortest Path

Identify the shortest route using Naismith’s rule from the ITN node nearest to

the user and the ITN node nearest to the highest point.

Naismith’s rule states that a reasonably fit person is capable of waking at

Page 2 of 5

5km/hr and that an additional minute is added for every 10 meters of climb

(i.e., ascent not descent).

To successfully complete this task you could calculate the weight iterating

through each link segment. Moreover, if you are not capable to solve this task

you could (1) approximate this algorithm by calculating the weight using only

the start and end node elevation; (2) identify the shortest distance from the

node nearest the user to the node nearest the highest point using only links in

the ITN.

To test the Naismith’s rule, you can use (439619, 85800) as a starting point.

2.5 Task 5: Map Plotting

Plot a background map 20km x 20km of the surrounding area. You are free to

use either a 1:50k Ordnance Survey raster (with internal color-map). Overlay a

transparent elevation raster with a suitable color-map. Add the user’s starting

point with a suitable marker, the highest point within a 5km buffer with a

suitable marker, and the shortest route calculated with a suitable line. Also,

you should add to your map, a color-bar showing the elevation range, a north

arrow, a scale bar, and a legend.

Figure 2: An incomplete solution to task n. 5

Page 3 of 5

2.6 Task 6: Extend the Region

The position of the user is restricted to a region in where the user must be

more than 5km from the edge of the elevation raster. Write additional code to

overcome this limitation.

3 Material

You will be supplied with data and a report template.

The data consists of:

1. a shape file delimiting the island;

2. two shape files defining the roads;

3. a JSON file defining the ITN graph;

4. a raster file defining the elevation, and;

5. a raster file to be used as a background map.

The group repository will be available to you after following the instructions

you find at the following weblink: https://classroom.github.com/a/

Dra1GzZj. If you are the first member of your team to click on this link, please

use the name of your team when requested.

The report template contains indications of what to write. These indications

are highlighted in orange. Please delete them when you are done. You must

use this template and its format should not be changed. If you wish, you can

add an image in the cover page. This template should not be used only to get

a full mark on the task related to the report, but also to make sure you get a

full mark on the other tasks by presenting what you have done in a clear and

satisfactory manner. The report has no word limit, but be reasonable.

4 Submission

This assignment should be submitted as follows:

1. using the provided GitHub repository in GitHub Classroom;

2. a zip file containing the project solution to the Assessment tab of the

module Moodle page;

3. a pdf file of the project report to the Assessment tab of the module Moodle

page;

Failing to carefully follow these instructions may result in penalties.

Page 4 of 5

5 Marking Scheme

The mark scheme is distributed in tasks as follows (total of 100):

n. Task Description Marks

1 User Input. 14

2 Highest Point Identification. 14

3 Nearest Integrated Transport Network. 14

4 Shortest Path. 14

5 Map Plotting 14

6 Extend the Region. 10

7 Creativity marks are available under certain conditions for

adding features that have not been specified.*

20

*The creativity marks will be considered only if you have scored more than

zero on all the other tasks.

Each completed task will be evaluated based on: the submitted project, the

report, if you used OOP, if regular commits on the GitHub repository have

been made, if comments to your code are clear so that it can be understood by

others, if PEP8 style is applied, if you incorporated some simple error handling

functionality, if the work was properly distributed among the members of the

group.

Any of the following is not allowed, their violation can result in penalties:

? Screenshots of your code pasted in your report. Please copy and paste

your code as text;

? Copying code from other sources without referencing;

? Plagiarising is severely punished. Please read the assessment tab in Moodle

for more details about it;

? Copying your classmate report or code is also considered plagiarism, and

in this case all students involved are punished equally.

? Copying the work of previous students of this module is also considered

plagiarism, referencing the code in this case does not help.

Page 5 of 5