Ga naar inhoud

Administratieve gebieden

bestuurlijke_gebieden_path(year, download_dir=datastore.administratieve_gebieden_dir)

Return the datastore path for one bestuurlijke gebieden year.

download_bestuurlijke_gebieden(year, download_dir=datastore.administratieve_gebieden_dir, *, target_path=None, overwrite=True, progress=True, chunk_size=1024 * 1024, timeout=30)

Download a selected yearly PDOK bestuurlijke gebieden GeoPackage.

The year is part of both the URL and output filename, so multiple annual releases can coexist in the datastore. The download is streamed to a temporary file and validated before it atomically replaces the target.

Parameters:

Name Type Description Default
year int

Explicit PDOK release year. The standard tile workflow uses 2026.

required
download_dir Path

Directory for yearly source GeoPackages, by default datastore.administratieve_gebieden_dir.

administratieve_gebieden_dir
target_path Path

Override for the output GeoPackage path.

None
overwrite bool

Whether to replace an existing target. When False, the existing file is reused without a network request.

True
progress bool

Whether to write named download progress to stdout.

True
chunk_size int

HTTP download chunk size in bytes.

1024 * 1024
timeout int

HTTP timeout in seconds.

30

Returns:

Type Description
GeoPackageDownload

Download metadata and the validated output path.

download_waterschapsgrenzen(download_dir=datastore.administratieve_gebieden_dir, *, target_path=None, overwrite=True, progress=True, chunk_size=1024 * 1024, timeout=30)

Download the current HWH waterschapsgrenzen GeoPackage.

The HWH source is not distributed as yearly releases. The current IMWA GeoPackage is downloaded to the administrative-areas datastore directory, validated, and atomically replaces the target only after successful validation.

Parameters:

Name Type Description Default
download_dir Path

Directory for the waterschapsgrenzen source GeoPackage, by default datastore.administratieve_gebieden_dir.

administratieve_gebieden_dir
target_path Path

Override for the output GeoPackage path.

None
overwrite bool

Whether to replace an existing target. When False, the existing file is reused without a network request.

True
progress bool

Whether to write named download progress to stdout.

True
chunk_size int

HTTP download chunk size in bytes.

1024 * 1024
timeout int

HTTP timeout in seconds.

30

Returns:

Type Description
GeoPackageDownload

Download metadata and the validated output path.

download_wijk_buurtkaart_2025(download_dir=datastore.administratieve_gebieden_dir, *, target_path=None, overwrite=True, progress=True, chunk_size=1024 * 1024, timeout=30)

Download the original CBS Wijk- en Buurtkaart 2025 GeoPackage.

The official CBS ZIP file is downloaded directly. Its GeoPackage is extracted unchanged, validated for the buurten layer and atomically placed in the administrative-areas source directory. No geometries or source attributes are joined, filtered, or otherwise spatially processed.

Parameters:

Name Type Description Default
download_dir Path

Directory for the CBS source GeoPackage, by default datastore.administratieve_gebieden_dir.

administratieve_gebieden_dir
target_path Path

Override for the output GeoPackage path.

None
overwrite bool

Whether to replace an existing target. When False, the existing file is reused without a network request.

True
progress bool

Whether to write named download progress to stdout.

True
chunk_size int

HTTP download chunk size in bytes.

1024 * 1024
timeout int

HTTP timeout in seconds.

30

Returns:

Type Description
GeoPackageDownload

Metadata for the validated, unmodified CBS GeoPackage.

normaliseer_bestuurlijke_gebieden(gebieden, *, year)

Normalize bestuurlijke gebieden while retaining the original source fields.

The returned GeoDataFrame uses the uniform area model: naam, bgt_code, waterbeheercode, bron, versie, and geometry. Original PDOK fields, including identificatie and code, remain available for traceability.

normaliseer_waterschapsgrenzen(gebieden, *, version=None)

Normalize waterschapsgrenzen and recover missing waterbeheercodes.

The HWH source fields code, waterbeheerdercode, and nen3610id are retained. waterbeheerdercode is exposed as the meaningful uniform waterbeheercode. When that source value is missing, a code is parsed only from a NEN3610 ID in the form NL.WBHCODE.<code>.<type>.<id>.

read_bestuurlijke_gebieden_layer(layer, *, year=DEFAULT_BESTUURLIJKE_GEBIEDEN_YEAR, path=None)

Read one raw layer from a downloaded yearly bestuurlijke gebieden source.

Parameters:

Name Type Description Default
layer str

Source layer to read, such as landgebied or gemeentegebied.

required
year int

Downloaded annual release to read. Defaults to the 2026 tile-source release.

DEFAULT_BESTUURLIJKE_GEBIEDEN_YEAR
path Path

Override for the downloaded GeoPackage path.

None

Returns:

Type Description
GeoDataFrame

Raw source fields and geometry from the requested layer.

read_landsgrens(*, year=DEFAULT_BESTUURLIJKE_GEBIEDEN_YEAR, path=None)

Read the national boundary from the downloaded landgebied layer.

This function never downloads data. Use :func:download_bestuurlijke_gebieden before calling it when the source GeoPackage is not available locally.

read_waterschapsgrenzen_layer(*, path=None)

Read the raw waterschap layer from the downloaded HWH GeoPackage.

wijk_buurtkaart_2025_path(download_dir=datastore.administratieve_gebieden_dir)

Return the datastore path for the CBS Wijk- en Buurtkaart 2025.

Redactie: AI