Skip to content

Commit 39ee8f3

Browse files
committed
Enhance drains_pwn script by adding conductance properties and integrating open water drainage features
1 parent 0f0ccee commit 39ee8f3

2 files changed

Lines changed: 48 additions & 10 deletions

File tree

src/nhflodata/data/mockup/drains_pwn/v1.0.0/drains_pwn.geojson

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,10 @@
55
"xy_coordinate_resolution": 0.01,
66
"bbox": [ 107080.87, 521548.54, 107453.90, 521643.63 ],
77
"features": [
8-
{ "type": "Feature", "properties": { "name": "drain_dwk", "elevation": 0.73, "comment": "wordt met pomp bemalen" }, "bbox": [ 107080.87, 521548.54, 107253.51, 521590.54 ], "geometry": { "type": "LineString", "coordinates": [ [ 107080.87, 521548.54 ], [ 107253.51, 521590.54 ] ] } },
9-
{ "type": "Feature", "properties": { "name": "drain_pomgebouw_ZUID", "elevation": -0.62, "comment": "via put uitloop op -0.5mNAP" }, "bbox": [ 107341.82, 521617.28, 107406.43, 521639.18 ], "geometry": { "type": "LineString", "coordinates": [ [ 107342.3, 521639.18 ], [ 107341.82, 521617.28 ], [ 107394.21, 521617.91 ], [ 107406.43, 521627.28 ] ] } },
10-
{ "type": "Feature", "properties": { "name": "drain_pomgebouw_NRD", "elevation": -0.8, "comment": "via put uitloop op -0.5mNAP" }, "bbox": [ 107347.06, 521635.69, 107407.07, 521643.63 ], "geometry": { "type": "LineString", "coordinates": [ [ 107347.06, 521643.15 ], [ 107398.49, 521643.63 ], [ 107407.07, 521635.69 ] ] } },
11-
{ "type": "Feature", "properties": { "name": "drain_dienstgebouw", "elevation": -0.844, "comment": "uitloop onder water op -0.5mNAP" }, "bbox": [ 107422.94, 521619.66, 107453.9, 521636.01 ], "geometry": { "type": "LineString", "coordinates": [ [ 107453.9, 521636.01 ], [ 107453.74, 521620.29 ], [ 107436.12, 521619.66 ], [ 107422.94, 521629.18 ] ] } }
8+
{ "type": "Feature", "properties": { "name": "drain_dwk", "elevation": 0.73, "conductance_per_meter": 1.0, "conductance_per_squared_meter": null, "bgt-identificatie": "", "mover_lake_name": "", "comment": "wordt met pomp bemalen" }, "bbox": [ 107080.87, 521548.54, 107253.51, 521590.54 ], "geometry": { "type": "LineString", "coordinates": [ [ 107080.87, 521548.54 ], [ 107253.51, 521590.54 ] ] } },
9+
{ "type": "Feature", "properties": { "name": "drain_pomgebouw_ZUID", "elevation": -0.62, "conductance_per_meter": 1.0, "conductance_per_squared_meter": null, "bgt-identificatie": "", "mover_lake_name": "", "comment": "via put uitloop op -0.5mNAP" }, "bbox": [ 107341.82, 521617.28, 107406.43, 521639.18 ], "geometry": { "type": "LineString", "coordinates": [ [ 107342.3, 521639.18 ], [ 107341.82, 521617.28 ], [ 107394.21, 521617.91 ], [ 107406.43, 521627.28 ] ] } },
10+
{ "type": "Feature", "properties": { "name": "drain_pomgebouw_NRD", "elevation": -0.8, "conductance_per_meter": 1.0, "conductance_per_squared_meter": null, "bgt-identificatie": "", "mover_lake_name": "", "comment": "via put uitloop op -0.5mNAP" }, "bbox": [ 107347.06, 521635.69, 107407.07, 521643.63 ], "geometry": { "type": "LineString", "coordinates": [ [ 107347.06, 521643.15 ], [ 107398.49, 521643.63 ], [ 107407.07, 521635.69 ] ] } },
11+
{ "type": "Feature", "properties": { "name": "drain_dienstgebouw", "elevation": -0.844, "conductance_per_meter": 1.0, "conductance_per_squared_meter": null, "bgt-identificatie": "", "mover_lake_name": "", "comment": "uitloop onder water op -0.5mNAP" }, "bbox": [ 107422.94, 521619.66, 107453.9, 521636.01 ], "geometry": { "type": "LineString", "coordinates": [ [ 107453.9, 521636.01 ], [ 107453.74, 521620.29 ], [ 107436.12, 521619.66 ], [ 107422.94, 521629.18 ] ] } },
12+
{ "type": "Feature", "properties": { "name": "bassin", "elevation": -0.5, "conductance_per_meter": null, "conductance_per_squared_meter": 1.0, "bgt-identificatie": "", "mover_lake_name": "vijver 4", "comment": "" }, "bbox": [ 107403.66, 521624.72, 107425.88, 521641.05 ], "geometry": { "type": "Polygon", "coordinates": [ [ [ 107403.66, 521638.85 ], [ 107409.53, 521640.66 ], [ 107425.54, 521641.05 ], [ 107425.88, 521627.06 ], [ 107423.49, 521624.98 ], [ 107412.31, 521624.72 ], [ 107404.06, 521625.46 ], [ 107403.66, 521638.85 ] ] ] } }
1213
]
1314
}

src/nhflodata/data/mockup/drains_pwn/v1.0.0/drains_pwn.py

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,63 @@
11
from pathlib import Path
22

33
import geopandas as gpd
4+
import numpy as np
5+
import pandas as pd
46
from nhflotools.geoconverter.utils import round_bounds, validate_crs, validate_geometry
57

68
from nhflodata import get_abs_data_path
79

8-
gdf_dir = get_abs_data_path("drains_en_damwand_bergen")
9-
gdf = gpd.read_file(gdf_dir / "drains_en_damwand_bergen.geojson")
10-
gdf = gdf.loc[gdf.naam.str.startswith("drain")]
11-
gdf["elevation"] = gdf[["diepte_van", "diepte_tot"]].min(axis=1)
12-
gdf = gdf.rename(columns={"naam": "name", "opmerking": "comment"})
1310
columns_to_keep = [
1411
"name",
1512
"elevation", # Elevation of the bottom of the drain
13+
"conductance_per_meter",
14+
"conductance_per_squared_meter",
15+
"bgt-identificatie",
16+
"mover_lake_name",
1617
"comment",
1718
"geometry",
1819
]
19-
gdf = gdf[columns_to_keep]
20+
21+
# %% Create line drains input
22+
gdf_dir = get_abs_data_path("drains_en_damwand_bergen")
23+
gdf = gpd.read_file(gdf_dir / "drains_en_damwand_bergen.geojson")
24+
gdf = gdf.loc[gdf.naam.str.startswith("drain")]
25+
gdf["elevation"] = gdf[["diepte_van", "diepte_tot"]].min(axis=1)
26+
gdf = gdf.rename(columns={"naam": "name", "opmerking": "comment"})
2027

2128
# Add conductances
2229
# m3/day per meter head difference per meter drain length
2330
gdf["conductance_per_meter"] = 1.0 # Default conductance
31+
gdf["conductance_per_squared_meter"] = np.nan # Default conductance for open water
32+
gdf["bgt-identificatie"] = "" # Placeholder for BGT identification
33+
gdf["mover_lake_name"] = "" # Placeholder for mover lake boundary name, to move drained water to.
34+
gdf = gdf[columns_to_keep]
35+
36+
# %% Add open water drainage
37+
# m3/day per meter head difference per squaredd meter
38+
bergen_oppwater_path = get_abs_data_path("oppervlaktewater_bergen")
39+
oppwater = gpd.read_file(bergen_oppwater_path / "oppervlaktewater_bergen.geojson")
40+
41+
open_water_drainage = oppwater.loc[oppwater["naam"].eq("bassin")]
42+
gdf = pd.concat(
43+
(
44+
gdf,
45+
gpd.GeoDataFrame(
46+
data={
47+
"name": open_water_drainage["naam"],
48+
"elevation": open_water_drainage["peil_circa"],
49+
"comment": "",
50+
"geometry": open_water_drainage["geometry"],
51+
"conductance_per_meter": np.nan, # Default conductance for open water
52+
"conductance_per_squared_meter": 1.0, # Default conductance for open water
53+
"bgt-identificatie": "",
54+
"mover_lake_name": "vijver 4",
55+
}
56+
),
57+
),
58+
axis=0,
59+
ignore_index=True,
60+
)
2461

2562
# Checks
2663
validate_crs(gdf)

0 commit comments

Comments
 (0)