Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ test = [

[tool.hatch.envs.default]
installer = "uv"
python = "3.11"
python = "3.13"

[tool.hatch.envs.lintformat]
detached = true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,25 @@
from pathlib import Path
"""Convert Koster drilling interpretation shapefiles (DAW) to GeoJSON.

Reads the Dawaco-exported shapefile archive containing top (TS) and thickness
(DS) interpretations per aquitard layer from Koster (1997), and converts them
to GeoJSON format with coordinate precision of 0.01 m.

This is a one-time conversion script. The source shapefiles are archived in
koster_drilling_interpretations/daw_data_TS_DS.zip within the data directory.
"""

from nhflotools.geoconverter.geoconverter import GeoConverter, print_results

from nhflodata.get_paths import get_abs_data_path

converter = GeoConverter()

# Convert folder with all files
input_folder = Path("/Users/bdestombe/Downloads/daw_data_TS_DS")
output_folder = Path(
"/Users/bdestombe/Projects/NHFLO/data/src/nhflodata/data/mockup/bodemlagen_pwn_2024/v2.0.0/Koster_drilling_interpretations_geojson"
)
data_path = get_abs_data_path("bodemlagen_pwn_2024", "2.0.0")

# Convert folder with all files.
# Source shapefiles are archived in koster_drilling_interpretations/daw_data_TS_DS.zip.
input_folder = data_path / "koster_drilling_interpretations" / "daw_data_TS_DS.zip"
output_folder = data_path / "koster_drilling_interpretations" / "geojson"
results = converter.convert_folder(
input_folder=input_folder, output_folder=output_folder, coordinate_precision=0.01, overwrite_with_target_crs=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,7 @@

# --- Merge and save as a single GeoJSON ---
gdf_all = gpd.GeoDataFrame(
{
layer: gdfi["value"] for layer, gdfi in zip(layer_order, gdfs, strict=True)
}, # TODO: This creates separate columns per layer, but we want a single "value" column and a "layer" column to identify the layer. This is needed for the inversion step later.
{layer: gdfi["value"] for layer, gdfi in zip(layer_order, gdfs, strict=True)},
geometry=gdfs[0].geometry.copy(),
crs=crs,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@
-77.50: [-80.00],
-82.50: [-85.00, -80.00],
-87.50: [-90.00, -85.00],
-92.50: [-95.00 - 90.00],
-92.50: [-95.00, -90.00],
-97.50: [-100.0, -95.00],
-102.5: [-105.0, -100.00],
-107.5: [-110.0, -105.00],
Expand Down
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
"""
Boundaries geven aan waar geldige data voor bodemlage_pwn_2024 aanwezig is.
"""Convert boundary shapefiles and produce per-layer boundary GeoJSON files.

Binnen de boundaries zou je geldige waarden moeten vinden voor de top en dikte van de aquitards.
Aan cell nodes buiten de boundaries moeten nan waarden worden toegekend.
Boundaries indicate where valid data for bodemlagen_pwn_2024 is available.
Within the boundaries, valid values for the top and thickness of the aquitards
should be found. Grid cells outside the boundaries are assigned NaN values.

De samenvoeging is gedaan voor de slechtdoorlatende lagen S2.1, S1.3, S1.2 en S1.1. Voor de dieper
gelegen lagen (S3.2, S3.1 en S2.2) bevatten de shapefiles van het Bergen model geen informatie (zie
paragraaf 3.3.6 van report).
"""
The merge was done for the aquitard layers S2.1, S1.3, S1.2, and S1.1. For the
deeper layers (S3.2, S3.1, and S2.2), the Bergen model shapefiles contain no
information (see report section 3.3.6).

from pathlib import Path
This is a one-time conversion script. The source shapefiles are archived in
boundaries.zip within the boundaries/ data directory.
"""

import geopandas as gpd
import pandas as pd
from nhflotools.geoconverter.geoconverter import GeoConverter, print_results

from nhflodata.get_paths import get_abs_data_path

converter = GeoConverter()

# Convert folder with all files
input_folder = Path("/Users/bdestombe/Downloads/boundaries")
output_folder = Path(
"/Users/bdestombe/Projects/NHFLO/data/src/nhflodata/data/mockup/bodemlagen_pwn_2024/v2.0.0/boundaries"
)
data_path = get_abs_data_path("bodemlagen_pwn_2024", "2.0.0")

# Convert folder with all files.
# Source shapefiles are archived in boundaries/boundaries.zip.
input_folder = data_path / "boundaries" / "boundaries.zip"
output_folder = data_path / "boundaries"
results = converter.convert_folder(
input_folder=input_folder, output_folder=output_folder, coordinate_precision=2, overwrite_with_target_crs=True
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
absence according to Koster (1997).
"""

from pathlib import Path

import geopandas as gpd
import pandas as pd

data_dir = Path("/Users/bdestombe/Projects/NHFLO/data/src/nhflodata/data/mockup/bodemlagen_pwn_2024/v1.0.0")
from nhflodata.get_paths import get_abs_data_path

data_dir = get_abs_data_path("bodemlagen_pwn_2024", "1.0.0")
layer_names = ["S11", "S12", "S13", "S21", "S22", "S31", "S32"]

# Load the masks
Expand Down
Loading