diff --git a/FarmmapsZonering/Models/InputParameter.cs b/FarmmapsZonering/Models/InputParameter.cs index 165b085..35f25d2 100644 --- a/FarmmapsZonering/Models/InputParameter.cs +++ b/FarmmapsZonering/Models/InputParameter.cs @@ -3,6 +3,6 @@ namespace FarmmapsHaulmkilling.Models public class InputParameter { public string ItemCode { get; set; } - public string ItemLayer { get; set; } + public string LayerName { get; set; } } } \ No newline at end of file diff --git a/FarmmapsZonering/Services/ZoneringService.cs b/FarmmapsZonering/Services/ZoneringService.cs index 5acafe7..dbb18c4 100644 --- a/FarmmapsZonering/Services/ZoneringService.cs +++ b/FarmmapsZonering/Services/ZoneringService.cs @@ -5,6 +5,7 @@ using FarmmapsApi.Services; using FarmmapsHaulmkilling.Models; using FarmmapsZonering.Models; using Microsoft.Extensions.Logging; +using Newtonsoft.Json; using static FarmmapsApi.Extensions; using static FarmmapsApiSamples.Constants; @@ -27,6 +28,11 @@ namespace FarmmapsZonering.Services public async Task CreateApplicationMapAsync(Item cropfieldItem, string formula, Output output, params InputParameter[] inputItemCodes) { var zoneringTaskRequest = new TaskRequest() {TaskType = VRAZONERING_TASK}; + zoneringTaskRequest.attributes["formula"] = formula; + zoneringTaskRequest.attributes["inputCode"] = cropfieldItem.Code; + zoneringTaskRequest.attributes["output"] = JsonConvert.SerializeObject(output); + zoneringTaskRequest.attributes["inputs"] = JsonConvert.SerializeObject(inputItemCodes); + var taskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, zoneringTaskRequest); await PollTask(TimeSpan.FromSeconds(5), async (tokenSource) => diff --git a/FarmmapsZonering/ZoneringApplication.cs b/FarmmapsZonering/ZoneringApplication.cs index 81c5f90..18ba353 100644 --- a/FarmmapsZonering/ZoneringApplication.cs +++ b/FarmmapsZonering/ZoneringApplication.cs @@ -92,7 +92,7 @@ namespace FarmmapsZonering }, new InputParameter() { ItemCode = geotiffItem.Code, - ItemLayer = geotiffItem.Data["layers"][0]["name"].ToString() + LayerName = geotiffItem.Data["layers"][0]["name"].ToString() }); _logger.LogInformation("Downloading output");