Skip to main content

getRegion

@svenvw/fdm-source


@svenvw/fdm-source / fdm-calculator/src / getRegion

Function: getRegion()

getRegion(b_centroid): Promise<RegionKey>

Defined in: fdm-calculator/src/norms/nl/2025/stikstofgebruiksnorm.ts:69

Determines the soil region for a given field based on its geographical coordinates.

This function queries a GeoTIFF file representing the official "grondsoortenkaart" from the Dutch Meststoffenwet (Manure Law). It identifies whether the field's centroid falls within one of the predefined soil regions: "klei", "loess", "veen", "zand_nwc", or "zand_zuid".

The soil region is a critical factor in determining the applicable nitrogen usage norms, as these standards vary significantly between different soil types.

Parameters

b_centroid

Field

A tuple containing the longitude and latitude of the field's centroid. This coordinate is used to look up the corresponding value in the GeoTIFF file.

Returns

Promise<RegionKey>

A promise that resolves to a RegionKey, which is a string literal representing the soil region (e.g., "zand_nwc", "klei").

Throws

If the GeoTIFF file cannot be fetched, if the coordinates fall outside the bounds of the map, or if the returned region code is unknown.