-
Notifications
You must be signed in to change notification settings - Fork 0
/
parametrization.py
118 lines (82 loc) · 5.61 KB
/
parametrization.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
from viktor.parametrization import ViktorParametrization, Section, NumberField, FileField, TableInput, TextField, \
OptionField, DownloadButton, Text, Tab, GeoPolygonField, MultiSelectField, OptionListElement, GeoPointField, Page
option_roads = [
OptionListElement(label="Motorway", value="motorway"),
OptionListElement(label="Motorway Link", value="motorway_link"),
OptionListElement(label="Trunk", value="trunk"),
OptionListElement(label="Trunk Link", value="trunk_link"),
OptionListElement(label="Primary", value="primary"),
OptionListElement(label="Primary Link", value="primary_link"),
OptionListElement(label="Secondary", value="secondary"),
OptionListElement(label="Secondary Link", value="secondary_link"),
OptionListElement(label="Tertiary", value="tertiary"),
OptionListElement(label="Tertiary Link", value="tertiary_link"),
OptionListElement(label="Residential", value="residential"),
OptionListElement(label="Unclassified", value="unclassified"),
]
option_single_link_result_types = [
OptionListElement(label="Link redundancy", value="link_redundancy"),
OptionListElement(label="Detour", value="alt_dist"),
OptionListElement(label="Difference distance", value="diff_dist"),
]
class Parametrization(ViktorParametrization):
page_criticality_analysis = Page("Criticality Analysis", views=["get_map_view", "single_link_redundancy_map"])
page_criticality_analysis.tab = Tab("Settings")
page_criticality_analysis.tab.intro = Section("Introduction")
page_criticality_analysis.tab.intro.text1 = Text("""
### RA2CE
This is the documentation of RA2CE (just say race!) - the Resilience Assessment and Adaptation for Critical infrastructurE Toolkit Python Package developed by Deltares. RA2CE helps to quantify resilience of critical infrastructure networks, prioritize interventions and adaptation measures and select the most appropriate action perspective to increase resilience considering future conditions.
### Single link redundancy
The tool utilizes single link redundancy analysis from RA2CE to provide insights into the criticality of (road) networks. It identifies the best alternative routes and highlights areas with a significant lack of alternative routes where redundancy is absent. Redundancy is quantified by measuring the total distance or time of the alternative route, or by comparing the time or distance difference between the original and the alternative route.
### How does it work?
First, draw a region of interest on the map and then select the road types you want to include in the analysis. The road network is then extracted from OpenStreetMap, and the single link redundancy analysis is performed.
###
Want to know more? Visit our repository: https://github.com/Deltares/ra2ce
""")
page_criticality_analysis.tab.network = Section("Network configuration")
page_criticality_analysis.tab.network.text2 = Text(
"Select a region of interest and the road types associated with the network.")
page_criticality_analysis.tab.network.selection_polygon = GeoPolygonField("Region Selection")
page_criticality_analysis.tab.network.roadtype_select = MultiSelectField("Select road type", options=option_roads)
page_criticality_analysis.tab.single_link_redun = Section("Result types")
page_criticality_analysis.tab.single_link_redun.text2 = Text("""
### Redundancy
Shows for every link in the network its redundancy e.g. if a detour is feasible.
### Detour
Shows the total distance or time required for the best alternative route.
### Difference distance
Shows the difference in distance or time between the original and alternative route.
""")
page_criticality_analysis.tab.single_link_redun.result_type = OptionField("Result type", options=
option_single_link_result_types)
page_criticality_analysis.tab_disclaimer = Tab("Disclaimer")
page_criticality_analysis.tab_disclaimer.text1 = Text("""
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Risk Assessment and Adaptation for Critical Infrastructure (RA2CE).
Copyright (C) 2023 Stichting Deltares
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
""")
# tab.OD = Section("Origin-Destination")
# tab.OD.text1 = Text("ADD description from jupyeter notebook here and expllain that tiff file can be upaloded")
# tab.OD.upload_hazard_map = FileField("Upload hazard map", file_types=['.tif'])
# tab.OD.origin = GeoPointField("Origin")
# tab.OD.destination = GeoPointField("Destination")
# tab.OD.type_destination = OptionField("Type of destination", options=['Education', 'Hospital'])
page_origin_destination = Page("Origin Destination")
page_origin_destination.tab = Tab("Settings")
page_origin_destination.tab.intro = Section("Introduction")
page_origin_destination.tab.intro.text1 = Text("""
### Original-Destination
Work in Progress ...
Analyse the impact of road disruptions on the accessibility of critical infrastructure in case of a hazard event (flooding, earthquake, etc.).
""")