createFunctionsForFertilizerApplicationFilling
@svenvw/fdm-source / fdm-calculator/src / createFunctionsForFertilizerApplicationFilling
Function: createFunctionsForFertilizerApplicationFilling()
createFunctionsForFertilizerApplicationFilling(
b_region,year):object
Defined in: fdm-calculator/src/norms/index.ts:31
Parameters
b_region
"NL"
year
"2025"
Returns
aggregateNormFillingsToFarmLevel()
aggregateNormFillingsToFarmLevel: (
input) =>AggregatedNormFillingsToFarmLevel
Aggregates the norm filling values from individual fields to the farm level. This function takes the output per field of the norm filling calculation, multiplies each norm filling by the field's area, and sums these values across all fields to provide total norm fillings for the farm.
The result are three objects (manure, nitrogen, phosphate) each containing the total normFilling and combined applicationFillings, expressed as totals, not per hectare.
Parameters
input
InputAggregateNormFillingsToFarmLevel
An array of field data, each containing field ID, area, and calculated norm fillings.
Returns
AggregatedNormFillingsToFarmLevel
An object containing the total aggregated norm fillings for manure, nitrogen, and phosphate for the farm.
calculateFertilizerApplicationFillingForManure
calculateFertilizerApplicationFillingForManure:
any=getNL2025FertilizerApplicationFillingForDierlijkeMestGebruiksNorm
calculateFertilizerApplicationFillingForNitrogen
calculateFertilizerApplicationFillingForNitrogen:
any=getNL2025FertilizerApplicationFillingForStikstofGebruiksNorm
calculateFertilizerApplicationFillingForPhosphate
calculateFertilizerApplicationFillingForPhosphate:
any=getNL2025FertilizerApplicationFillingForFosfaatGebruiksNorm
collectInputForFertilizerApplicationFilling()
collectInputForFertilizerApplicationFilling: (
fdm,principal_id,b_id,fosfaatgebruiksnorm) =>Promise<NL2025NormsFillingInput>
Collects all necessary input data from fdm-core functions for the NL 2025 norms filling calculations. This function standardizes the data collection process, ensuring all calculation functions receive a unified input object (NL2025NormsFillingInput).
Parameters
fdm
FdmType
The FdmType instance for interacting with the Farm Data Model.
principal_id
PrincipalId
The ID of the principal (user or organization) performing the calculation.
b_id
string
The ID of the field for which the norms are being calculated.
fosfaatgebruiksnorm
number
The phosphate usage norm in kg/ha for the current calculation.
Returns
Promise<NL2025NormsFillingInput>
A promise that resolves to a standardized input object containing cultivations, fertilizer applications, fertilizers, organic certification status, grazing intention status, the phosphate usage norm, and the field's centroid.
Throws
Throws an error if the specified field cannot be found.