Koswat dike surroundings

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

KoswatSurroundingsProtocol

Bases: Protocol

Empty interface to represent the Koswat surroundings and easily identify them throughout the solution.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

SurroundingsInfrastructure dataclass

Bases: KoswatSurroundingsProtocol

Defines surroundings point collections that can be repaired or replaced.

The PointSurroundings contain a matrix (dictionary) where the keys represent the distances to an obstacle, and the values a float representing how long that infrastructure is.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

SurroundingsObstacle dataclass

Bases: KoswatSurroundingsProtocol

Defines surroundings point collections that cannot be repaired or replaced. The PointObstacleSurroundings contain the closest distance to an obstacle both inside and outside the polder.

Point

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

PointSurroundings dataclass

Object representing a meter with x, y coordinates in a polder (or else).

__eq__(__value: object) -> bool

Overriding of the "magic" equality operator required so that PointSurroundings can be used as a key in a python dict.

__hash__() -> int

Overriding of the "magic" hash operator required so that PointSurroundings can be used as a key in a python dict.

get_total_infrastructure_per_zone(*zone_limit_collection: tuple[float, float]) -> list[float]

Gets the total infrastructure width at each of the provided zones zone_limit_collection (tuple[float, float]). The zone limits are matched by rounding up their upper limit to the surroundings_matrix keys (distances to the location in the real world). When two zones have overlapping limits (as expected) the lower one will "claim" the corresponding surrounding distance.

Example
  • zone_limit_collection = (0, 4), (4, 11)
  • surroundings_matrix = {5: 1.5, 10: 3, 15: 6}
  • "Taken" distances per zone:
    • (0, 4) takes key 5.
    • (4, 11) takes key(s) 10 and 15 because 5 was already taken.
  • Total infrastructure width at zones = (1.5, 9)
Returns:
  • list[float]

    list[float]: list with total width corresponding to each provided zone.

merge(other: PointSurroundings) -> None

Merges another PointSurroundings into this one by updating the surroundings_matrix with the values from the other one.

Parameters:
            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

PointSurroundingsListBuilder dataclass

Bases: BuilderProtocol

Builds a collection of points (list[PointSurroundings]) given the dike locations (KoswatDikeLocationsShpFom) and the surroundings around it (KoswatSurroundingsCsvFom).

Wrapper

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

SurroundingsWrapper dataclass

get_locations_at_safe_distance(distance: float) -> list[PointSurroundings]

Gets all locations which are safe from obstacle surroundings in a radius of distance.

Parameters:
  • distance (float) –

    Radius from each point that should be free of surroundings.

Returns:
  • list[PointSurroundings]

    List[PointSurroundings]: List of safe locations (points with surroundings).

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

            GNU GENERAL PUBLIC LICENSE
              Version 3, 29 June 2007

KOSWAT, from the dutch combination of words Kosts-Wat (what are the costs) Copyright (C) 2025 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/.

ObstacleSurroundingsWrapper dataclass

Bases: BaseSurroundingsWrapper

get_locations_at_safe_distance(distance: float) -> list[PointSurroundings]

Gets all locations which are safe from obstacle surroundings in a radius of distance.

Parameters:
  • distance (float) –

    Radius from each point that should be free of surroundings.

Returns:
  • list[PointSurroundings]

    list[PointSurroundings]: List of safe locations (points with surroundings).

obstacle_locations: list[PointObstacleSurroundings] property

Overlay of locations of the different ObstacleSurroundings that are present. Buildings need to be present as input (leading for location coordinates). Each location represents 1 meter in a real scale map.

Returns:
  • list[PointObstacleSurroundings]

    list[PointSurroundings]: List of locations with only the closest distance to obstacle(s).