Skip to content

Commit

Permalink
Chore/352 osdamage analysis of the damage module returns a tuple (#441)
Browse files Browse the repository at this point in the history
## Issue addressed
Solves #<issue number>

## Code of conduct
- [x] I HAVE NOT added sensitive or compromised (test) data to the
repository.
- [x] I HAVE NOT added vulnerabilities to the repository.
- [x] I HAVE discussed my solution with (other) members of the RA2CE
team.

## What has been done?
Explain how you addressed the resolution of the related issue, what
choices you made and why.

### Checklist
- [ ] Code is formatted using our custom `black` and `isort`
definitions.
- [x] Tests are either added or updated.
- [x] Branch is up to date with `master`.
- [x] Updated documentation if needed.

## Additional Notes (optional)
Add any additional notes or information that may be helpful.
  • Loading branch information
sahand-asgarpour authored May 27, 2024
2 parents 989cf0f + 76afa93 commit f690774
Show file tree
Hide file tree
Showing 29 changed files with 486 additions and 70 deletions.
10 changes: 10 additions & 0 deletions examples/data/direct_analysis_OSdamage/analysis.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[project]
name = beira

[analysis1]
name = OSdamage_direct_damage_event
analysis = direct
event_type = event
damage_curve = OSD
save_csv = True
save_gpkg = True
File renamed without changes.
File renamed without changes.
37 changes: 37 additions & 0 deletions examples/data/direct_analysis_huizinga/network.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[project]
name = beira

[network]
directed = False
source = OSM download
primary_file = None
diversion_file = None
file_id = rfid_c
polygon = region_polygon.geojson
network_type = drive
road_types = motorway,motorway_link,primary,primary_link,secondary,secondary_link,tertiary,tertiary_link,residential
save_gpkg = True

[origins_destinations]
origins = None
destinations = None
origins_names = None
destinations_names = None
id_name_origin_destination = None
origin_count = None
origin_out_fraction = None
category = None

[hazard]
hazard_map = max_flood_depth.tif
hazard_id = None
hazard_field_name = waterdepth
aggregate_wl = mean
hazard_crs = EPSG:32736

[cleanup]
snapping_threshold = None
segmentation_length = None
merge_lines = True
merge_on_id = False
cut_at_intersections = False
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<PAMDataset>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">15.197619438171</MDI>
<MDI key="STATISTICS_MEAN">1.3522161249402</MDI>
<MDI key="STATISTICS_MINIMUM">0.050009727478027</MDI>
<MDI key="STATISTICS_STDDEV">2.4887893417283</MDI>
<MDI key="STATISTICS_VALID_PERCENT">24.02</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"coordinates":[[[34.83813584786725,-19.849253564071716],[34.85731866455188,-19.850207061044827],[34.87923074377409,-19.8538743037071],[34.89685398186816,-19.847713287630185],[34.908004968802516,-19.84155203240664],[34.85349769700147,-19.814263600532954],[34.83361306994894,-19.81492385983684],[34.82877837631224,-19.837591099222138],[34.83813584786725,-19.849253564071716]]],"type":"Polygon"}}]}
10 changes: 10 additions & 0 deletions examples/data/direct_analysis_manual/analysis.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[project]
name = beira

[analysis1]
name = Huizinga_direct_damage_event
analysis = direct
event_type = event
damage_curve = MAN
save_csv = True
save_gpkg = True
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
depth damage
cm % of total construction costs
0 0
100 0.1
200 0.2
400 0.4
800 0.8
12000 1
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Road_type \ lanes lanes
unit euro/m
tertiary_link 100
tertiary 100
secondary_link 10
secondary 10
residential 1000
['tertiary', 'residential'] 500
37 changes: 37 additions & 0 deletions examples/data/direct_analysis_manual/network.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
[project]
name = beira

[network]
directed = False
source = OSM download
primary_file = None
diversion_file = None
file_id = rfid_c
polygon = region_polygon.geojson
network_type = drive
road_types = motorway,motorway_link,primary,primary_link,secondary,secondary_link,tertiary,tertiary_link,residential
save_gpkg = True

[origins_destinations]
origins = None
destinations = None
origins_names = None
destinations_names = None
id_name_origin_destination = None
origin_count = None
origin_out_fraction = None
category = None

[hazard]
hazard_map = max_flood_depth.tif
hazard_id = None
hazard_field_name = waterdepth
aggregate_wl = mean
hazard_crs = EPSG:32736

[cleanup]
snapping_threshold = None
segmentation_length = None
merge_lines = True
merge_on_id = False
cut_at_intersections = False
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<PAMDataset>
<PAMRasterBand band="1">
<Metadata>
<MDI key="STATISTICS_APPROXIMATE">YES</MDI>
<MDI key="STATISTICS_MAXIMUM">15.197619438171</MDI>
<MDI key="STATISTICS_MEAN">1.3522161249402</MDI>
<MDI key="STATISTICS_MINIMUM">0.050009727478027</MDI>
<MDI key="STATISTICS_STDDEV">2.4887893417283</MDI>
<MDI key="STATISTICS_VALID_PERCENT">24.02</MDI>
</Metadata>
</PAMRasterBand>
</PAMDataset>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"type":"FeatureCollection","features":[{"type":"Feature","properties":{},"geometry":{"coordinates":[[[34.83813584786725,-19.849253564071716],[34.85731866455188,-19.850207061044827],[34.87923074377409,-19.8538743037071],[34.89685398186816,-19.847713287630185],[34.908004968802516,-19.84155203240664],[34.85349769700147,-19.814263600532954],[34.83361306994894,-19.81492385983684],[34.82877837631224,-19.837591099222138],[34.83813584786725,-19.849253564071716]]],"type":"Polygon"}}]}
Loading

0 comments on commit f690774

Please sign in to comment.