Skip to content

Commit

Permalink
chore: normalize characteristic points releated properties (#207)
Browse files Browse the repository at this point in the history
* chore: replace dikeside with waterside

* chore: adjust readmes

* chore: configuration io changes

* chore: rename variables configuration\io\ini

* chore: rename configuration\io\ini

* chore: fix issues

* docs: adjust readme

* chore: delete koswat.log

* chore: rename last configs

* chore: small changes

* chore: rename sheet_pile to sheetpile

* chore: rename input_profile base and protocol variables

* chore: some leftovers

* chore: fix koswat_scenario

* chore: revert scenario changes

* chore: fix issues

* chore: revert section to traject

* docs: update readme files

* test: update reference summary_costs.csv

* chore: add translations to READMEs

---------

Co-authored-by: Carles S. Soriano Pérez <[email protected]>
  • Loading branch information
ArdtK and Carsopre authored Oct 31, 2024
1 parent 5d3719f commit bf93f81
Show file tree
Hide file tree
Showing 111 changed files with 1,449 additions and 1,384 deletions.
4 changes: 2 additions & 2 deletions docs/reference/koswat_cost_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,12 @@ These characteristics are then used to estimate how much surface of the infrastr

A reinforced profile can be different from its original state in many ways, however here we are only intestered in two things:

1. The new profile's width from the original outsides (waterside) crest point.
1. The new profile's width from the original waterside crest point.
2. Whether there is a crest's height increase (`dh0`),

By using the old and the reinforced profile's geometries, we can determine what we call zone `A` and zone `B`, `A + B = {profile's width from waterside crest point}`.

- Zone `A` represents the length of the dike old profile's crest (highest surface).
- Zone `A` represents the width of the dike old profile's crest (highest surface).
- Zone `B` the distance between said crest and the end of the dike's reinforcement.

|![Dike profile with zone A and B](./imgs/surroundings_zone_a_b.png)|
Expand Down
16 changes: 12 additions & 4 deletions docs/reference/koswat_dike.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,23 @@ In this section we will describe how a Koswat dike is defined and what its parts
A koswat dike is represented by an instance of a `KoswatProfileProtocol`. And its properties represent different aspects of a 'real domain'. With _Image 1. Base profile properties_ as reference, we can see the mapping between said 'real domain' and the koswat properties:

- `input_data`: The parts of a dike (written on the image reference), which are directly mapped as an implementation of the `KoswatInputProfileProtocol`.
- `characteristic_points`: 8 points given by the user describing the dike on (x,y) coordinates, the first four represent the waterside, the last four the polderside. Numbered in the reference picture from 1 to 8.
- `characteristic_points`: 8 points given by the user describing the dike on (x,y) coordinates, the first four represent the waterside (_buitendijks_), the last four the polderside (_binnendijks_). Numbered in the reference picture from 1 to 8. Point 4 is considered to be the reference value (0) with respect to distances of e.g. surroundings and widths of certain parts of the dike.
- `layers_wrapper`: The description on how the layers of the dike are built. Further described in [Dike layers](#dike-layers).
- `location`: coordinate (x, y) where the dike is situated.
- `profile_width`: The difference between the lowest and the highest 'x' coordinates of the profile characteristic points. The distance between characteristic point 1 and 8.
- `location`: Geospatial coordinates (x, y) where the dike is situated.
- `profile_width`: The difference between the lowest and the highest 'x' coordinates of the profile characteristic points. The distance between characteristic points 1 and 8. This can be broken down into:
- `waterside_width`: The distance between characteristics points 1 and 4.
- `polderside_width`: The distance between characteristics points 4 and 8.

|![Base profile properties](./imgs/base_profile_properties.png)|
|:--:|
|Image 1. Base profile properties|

The geometry of a dike has certain additional characteristics:
- `crest` (_kruin_): The flat part on top of the dike.
- `berm` (_berm_): The flat part between either point 2 and 3 (waterside) or point 6 an 7 (polderside).
- `slope` (_talud_): The (steepness of the) diagonal parts between points 1 and 4 (waterside) or points 5 and 8 (polderside).
- `ground level` (_maaiveld_): The level of the area to the left of point 1 (waterside) or to the right of point 8 (polderside).

## Dike layers
A dike is composed by three layers:

Expand All @@ -34,7 +42,7 @@ Using _Image 3. Clay layer highlighted_ as an example, we can map the previous p

- `material_type`: Clay, the 'in-between' layer.
- `upper_points`: Line with the 'orange' points, without 'closing' the polygon, something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0)].
- `outer_geometry`: Closed geometry using the `upper points` and the 'ground floor' points: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), __(-18, 0)__].
- `outer_geometry`: Closed geometry using the `upper points` and the 'ground level' (_maaiveld_) points: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), __(-18, 0)__].
- `material_geometry`: Closed geometry using the `upper_points` from Clay and the `upper_points` from the layer below (Sand, green points). Should be something like: [(-18, 0), (0, 5.5), (8, 5.5), (21, 0), __(19, 0), (8, 4.75), (0, 4.75), (-14, 0), (-18, 0)__]

|![Base profile sand layer](./imgs/base_profile/base_profile_sand.png)|
Expand Down
4 changes: 3 additions & 1 deletion docs/reference/koswat_reinforced_profile.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ A reinforcement profile implements the `ReinforcementProfileProtocol`, which is

We have two main different sort of reinfocements which contain also subtypes for said reinforcements:

- __Outside slope reinforcement__: Cofferdam (_kistdam_), based on the `OutsideSlopeReinforcementProfile`.
- __Outside slope reinforcement__: Cofferdam (_kistdam_), based on the `OutsideSlopeReinforcementProfile`. With this reinforcement the outside slope (_buiten talud_) of the dike is impacted.
- __Standard reinforcement__: Piping wall (_kwelscherm_), soil (_grondmaatregel profiel_), stability wall (_stabiliteitswand_), vertical piping solution (_verticale piping oplossing_). The previous being based on the `StandardReinforcementProfile`.
- A piping wall can be implemented by a cb wall (_cement-bentoniet wand_) and an unanchored sheet pile (_onverankerde damwand_).
- A stability wall can be implemented by a diaphragm wall (_diepwand_) and an anchored sheet pile (_verankerde damwand_).

In addition, the above mentioned reinforcements can also implement their own `ReinforcementInputProfileProtocol`, which are after all extensions of the `KoswatInputProfileBase` with extra properties.
5 changes: 4 additions & 1 deletion docs/reference/koswat_surroundings.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,13 @@ Their headers are divided in the following columns:
- `SECTIE`, section of the location in the dike's traject,
- `Xcoord`, x coordinate of the location,
- `Ycoord`, y coordinate of the location,
- `afst_{x}m`, distance from the location, where 'x' are all the values between `5` and `200` with steps of 5, thus 40 columns. The values in these cells are called define whether there are obstacles at this distance or not and in `Koswat` are usually built in the `SurroundingsPoint.surroundings_matrix`, each type of surrounding interprets the weights in a different manner.
- `afst_{x}m`, distance from the reference point of the location, where 'x' are all the values between `5` and `200` with steps of 5, thus 40 columns. The values in these cells define whether there are obstacles or infrastructures at this distance or not and in `Koswat` are usually built in the `SurroundingsPoint.surroundings_matrix`, each type of surrounding interprets the weights in a different manner.


## Obstacles

An obstacle usually represents a building, because they cannot be removed they become a constraint to the possible reinforcements that can be applied at a given location. For instance, if a dike's reinforcement will become 5 meters wider, but within that distance there are obstacles, said reinforcement will be discarded as a possible option at that location.
The distance from the reference point of the dike to the closes point of the obstacle is given.

The values in the columns `afst_{x}m` are either `1` or `0` and are simply interpreted as having a surrounding or not. Thus ignoring other characteristics of the surrounding and just focusing on its presence.

Expand All @@ -59,6 +60,8 @@ Infrastructures are mostly "roads". Contrary to the [obstacles](#obstacles) thes

With the above values we know what's the __affected area__ of an infrastructure when a reinforced profile needs to be applied and therefore can estimate their costs.

The distance from the reference point of the dike to the center point of the infrastructure is given.

### Infrastructures types

Currently we identify and support the following surroundings as written in the `.csv` file names:
Expand Down
29 changes: 14 additions & 15 deletions docs/user_manual.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@ from koswat.dike.profile.koswat_input_profile_base import KoswatInputProfileBase
from koswat.dike.material.koswat_material_type import KoswatMaterialType
from koswat.configuration.settings.koswat_scenario import KoswatScenario
from koswat.dike.profile import KoswatProfileBase, KoswatProfileBuilder
from koswat.cost_report.profile.profile_cost_report import ProfileCostReport
from koswat.cost_report.summary import KoswatSummary, KoswatSummaryBuilder
from koswat.configuration.settings.koswat_run_scenario_settings import (
KoswatRunScenarioSettings,
Expand All @@ -50,17 +49,17 @@ assert _shp_trajects_file.is_file()
## Define input profile case
input_profile_case = KoswatInputProfileBase()
input_profile_case.dike_section = "test_data"
input_profile_case.buiten_maaiveld = 0
input_profile_case.buiten_talud = 3
input_profile_case.buiten_berm_hoogte = 0
input_profile_case.buiten_berm_breedte = 0
input_profile_case.kruin_hoogte = 6
input_profile_case.kruin_breedte = 5
input_profile_case.binnen_talud = 3
input_profile_case.binnen_berm_hoogte = 0
input_profile_case.binnen_berm_breedte = 0
input_profile_case.binnen_maaiveld = 0
input_profile_case.pleistoceen = -5
input_profile_case.waterside_ground_level = 0
input_profile_case.waterside_slope = 3
input_profile_case.waterside_berm_width = 0
input_profile_case.waterside_berm_height = 0
input_profile_case.crest_height = 6
input_profile_case.crest_width = 5
input_profile_case.polderside_slope = 3
input_profile_case.polderside_berm_height = 0
input_profile_case.polderside_berm_width = 0
input_profile_case.polderside_ground_level = 0
input_profile_case.pleistocene = -5
input_profile_case.aquifer = -2

## Define the scenario case
Expand All @@ -70,8 +69,8 @@ scenario_case.scenario_section = ""
scenario_case.d_h = 1
scenario_case.d_s = 10
scenario_case.d_p = 30
scenario_case.kruin_breedte = 5
scenario_case.buiten_talud = 3
scenario_case.crest_width = 5
scenario_case.waterside_slope = 3

## Define the layers case
layers_case = dict(
Expand All @@ -82,7 +81,7 @@ layers_case = dict(
],
)

## Import surroundings
## Import surroundings (TODO: update with latest implementation of SurroundingsWrapperCollectionImporter)
_surroundings_importer = KoswatSurroundingsImporter()
_surroundings_importer.traject_loc_shp_file = _shp_trajects_file
_surroundings = _surroundings_importer.import_from(_test_dir)[0]
Expand Down
16 changes: 8 additions & 8 deletions koswat/configuration/io/csv/koswat_surroundings_csv_fom.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,25 +10,25 @@
class KoswatSurroundingsWrapperCsvFom(KoswatCsvFomProtocol):
traject: str = ""
buildings_polderside: KoswatSurroundingsCsvFom = None
buildings_dikeside: KoswatSurroundingsCsvFom = None
buildings_waterside: KoswatSurroundingsCsvFom = None

railways_polderside: KoswatSurroundingsCsvFom = None
railways_dikeside: KoswatSurroundingsCsvFom = None
railways_waterside: KoswatSurroundingsCsvFom = None

waters_polderside: KoswatSurroundingsCsvFom = None
waters_dikeside: KoswatSurroundingsCsvFom = None
waters_waterside: KoswatSurroundingsCsvFom = None

roads_class_2_polderside: KoswatSurroundingsCsvFom = None
roads_class_7_polderside: KoswatSurroundingsCsvFom = None
roads_class_24_polderside: KoswatSurroundingsCsvFom = None
roads_class_47_polderside: KoswatSurroundingsCsvFom = None
roads_class_unknown_polderside: KoswatSurroundingsCsvFom = None

roads_class_2_dikeside: KoswatSurroundingsCsvFom = None
roads_class_7_dikeside: KoswatSurroundingsCsvFom = None
roads_class_24_dikeside: KoswatSurroundingsCsvFom = None
roads_class_47_dikeside: KoswatSurroundingsCsvFom = None
roads_class_unknown_dikeside: KoswatSurroundingsCsvFom = None
roads_class_2_waterside: KoswatSurroundingsCsvFom = None
roads_class_7_waterside: KoswatSurroundingsCsvFom = None
roads_class_24_waterside: KoswatSurroundingsCsvFom = None
roads_class_47_waterside: KoswatSurroundingsCsvFom = None
roads_class_unknown_waterside: KoswatSurroundingsCsvFom = None

def is_valid(self) -> bool:
_surroundings = [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ class KoswatSurroundingsCsvReader(KoswatReaderProtocol):
def read(self, file_path: Path) -> KoswatSurroundingsCsvFom:
_csv_fom = KoswatCsvReader().read(file_path)

# First three columns are section x and y coordinate.
# First three columns are section, x and y coordinate.
_koswat_fom = KoswatSurroundingsCsvFom()
_koswat_fom.distances_list = self._get_surroundings_distances(
_csv_fom.headers[3:]
Expand Down
Loading

0 comments on commit bf93f81

Please sign in to comment.