From 766674c731f1b0de1c1645e65340017f0ee88494 Mon Sep 17 00:00:00 2001 From: Riepma Date: Wed, 7 Apr 2021 10:38:42 +0200 Subject: [PATCH] ISOXML to taskmap --- FarmmapsApi/Services/GeneralService.cs | 18 +- FarmmapsNbs/FarmmapsNbs.csproj.user | 10 - FarmmapsNbs/InputData-NBS.json | 40 --- FarmmapsNbs/Models/NitrogenInput.cs | 29 -- FarmmapsNbs/Models/Settings.cs | 9 - FarmmapsNbs/Models/TargetNData.cs | 9 - FarmmapsNbs/NitrogenInput.json | 310 ------------------- FarmmapsNbs/NitrogenService.cs | 191 ------------ FarmmapsNbs/Program.cs | 23 -- FarmmapsNbs/appsettings.json | 10 - FarmmapsPoten/Data/PotenInput.json | 57 ++++ FarmmapsPoten/Models/PotenInput.cs | 2 + FarmmapsPoten/PotenApplication.cs | 37 ++- FarmmapsPoten/PotenInput.json | 413 ++++++++++++++++++++++--- 14 files changed, 463 insertions(+), 695 deletions(-) delete mode 100644 FarmmapsNbs/FarmmapsNbs.csproj.user delete mode 100644 FarmmapsNbs/InputData-NBS.json delete mode 100644 FarmmapsNbs/Models/NitrogenInput.cs delete mode 100644 FarmmapsNbs/Models/Settings.cs delete mode 100644 FarmmapsNbs/Models/TargetNData.cs delete mode 100644 FarmmapsNbs/NitrogenInput.json delete mode 100644 FarmmapsNbs/NitrogenService.cs delete mode 100644 FarmmapsNbs/Program.cs delete mode 100644 FarmmapsNbs/appsettings.json create mode 100644 FarmmapsPoten/Data/PotenInput.json diff --git a/FarmmapsApi/Services/GeneralService.cs b/FarmmapsApi/Services/GeneralService.cs index b494fce..64fad1d 100644 --- a/FarmmapsApi/Services/GeneralService.cs +++ b/FarmmapsApi/Services/GeneralService.cs @@ -108,18 +108,32 @@ namespace FarmmapsApi.Services } // Create taskmap based on width, height and direction - public async Task CreateTaskmap(Item cropfieldItem, Item tiffItem, string cellWidth, string cellHeight, string startPoint, string centered = "false", string endPoint = null, string angle = null) + public async Task CreateTaskmap(Item cropfieldItem, Item tiffItem, string outputType, string cellWidth, string cellHeight, + string startPoint, string ddiCode = "0001", string centered = "false", string endPoint = null, string angle = null, + string cropTypeName = null, string costumerName = null, string ProductGroupName = null, string productName = null, + string resolution = null, string unitScale = null, string maximumClasses = null) + { var taskmapRequest = new TaskRequest { TaskType = TASKMAP_TASK }; taskmapRequest.attributes["inputCode"] = tiffItem.Code; - taskmapRequest.attributes["operation"] = "shape"; // Currently onlye "shape" supported, if ISOXML is supported this should be an input + taskmapRequest.attributes["operation"] = outputType; // Currently onlye "shape" supported, if ISOXML is supported this should be an input taskmapRequest.attributes["cellWidth"] = cellWidth; //metres taskmapRequest.attributes["cellHeight"] = cellHeight; //metres taskmapRequest.attributes["startPoint"] = startPoint; // Coordinates WGS84 taskmapRequest.attributes["centered"] = centered; + if (outputType == "isoxml") taskmapRequest.attributes["ddiCode"] = ddiCode; // ddi is obligatory for isoxml, if not given set to 0001 if (angle == null) taskmapRequest.attributes["endPoint"] = endPoint; // Coordinates WGS84 if (endPoint == null) taskmapRequest.attributes["angle"] = angle; // degrees between 0.0 and 360.0 + // Optional attributes + if (cropTypeName != null) taskmapRequest.attributes["cropTypeName"] = cropTypeName; + if (costumerName != null) taskmapRequest.attributes["costumerName"] = costumerName; + if (ProductGroupName != null) taskmapRequest.attributes["ProductGroupName"] = ProductGroupName; + if (productName != null) taskmapRequest.attributes["productName"] = productName; + if (resolution != null) taskmapRequest.attributes["resolution"] = resolution; + if (unitScale != null) taskmapRequest.attributes["unitScale"] = unitScale; + if (maximumClasses != null) taskmapRequest.attributes["maximumClasses"] = maximumClasses; // Can be used for shapefile too + string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, taskmapRequest); await PollTask(TimeSpan.FromSeconds(5), async (tokenSource) => { diff --git a/FarmmapsNbs/FarmmapsNbs.csproj.user b/FarmmapsNbs/FarmmapsNbs.csproj.user deleted file mode 100644 index c41d825..0000000 --- a/FarmmapsNbs/FarmmapsNbs.csproj.user +++ /dev/null @@ -1,10 +0,0 @@ - - - - false - FarmmapsNbs - - - ProjectDebugger - - \ No newline at end of file diff --git a/FarmmapsNbs/InputData-NBS.json b/FarmmapsNbs/InputData-NBS.json deleted file mode 100644 index 3fdad59..0000000 --- a/FarmmapsNbs/InputData-NBS.json +++ /dev/null @@ -1,40 +0,0 @@ -[ - { - "UseCreatedCropfield": false, - "storeStatistics": false, - "file": "20210127_WDVI_plus03.tif", - "inputVariable": "wdvi", - //"InputLayerName": "Band 1", - "outputFileName": "2021.02.15.Hapreet_Singh_0127-wdvi03_2", - "plantingDate": "2020-04-15", - "measurementDate": "2020-06-27", - "potatoPurposeType": "consumption", - "targetYield": 27, - "fieldName": "Mahindra-Hapreet-Singh", - "geometryJson": { - "type": "Polygon", - "coordinates": [ - [ - [ 75.929090780177305, 31.639314978348551 ], - [ 75.931353489378182, 31.639409065494881 ], - [ 75.931432810729120, 31.638956841735819 ], - [ 75.929072617175663, 31.638879365370279 ], - [ 75.929090780177305, 31.639314978348551 ] - ] - ] - }, - "GenerateTaskmap": true, - "CellWidth": "3", - "CellHeight": "10", - "StartPoint": { - "type": "Point", - "coordinates": [ 75.931432810729120, 31.638956841735819 ] - }, - "EndPoint": { - "type": "Point", - "coordinates": [ 75.929072617175663, 31.638879365370279 ] - } // if no angle - - //"Angle": "317.0" // if no endpoint - } - ] \ No newline at end of file diff --git a/FarmmapsNbs/Models/NitrogenInput.cs b/FarmmapsNbs/Models/NitrogenInput.cs deleted file mode 100644 index 61326ea..0000000 --- a/FarmmapsNbs/Models/NitrogenInput.cs +++ /dev/null @@ -1,29 +0,0 @@ -using System; -using Newtonsoft.Json.Linq; - -namespace FarmmapsNbs.Models -{ - public class NitrogenInput - { - public bool UseCreatedCropfield { get; set; } - public string File { get; set; } - public string InputVariable { get; set; } - public string OutputFileName { get; set; } - public DateTime PlantingDate { get; set; } - public DateTime MeasurementDate { get; set; } - public string PotatoPurposeType { get; set; } - public int TargetYield { get; set; } - public JObject GeometryJson { get; set; } - public string InputLayerName { get; set; } - public string fieldName{ get; set; } - public bool storeSatelliteStatistics { get; set; } - public bool GenerateTaskmap { get; set; } - public string CellWidth { get; set; } - public string CellHeight { get; set; } - public JObject StartPoint { get; set; } - public JObject EndPoint { get; set; } - public string Angle { get; set; } - - - } -} \ No newline at end of file diff --git a/FarmmapsNbs/Models/Settings.cs b/FarmmapsNbs/Models/Settings.cs deleted file mode 100644 index 40cd25d..0000000 --- a/FarmmapsNbs/Models/Settings.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace FarmmapsNbs { - public class Settings { - public string CropfieldItemCode { get; set; } - public string SatelliteTaskCode { get; set; } - public string VanDerSatTaskCode { get; set; } - public string WatBalTaskCode { get; set; } - - } -} \ No newline at end of file diff --git a/FarmmapsNbs/Models/TargetNData.cs b/FarmmapsNbs/Models/TargetNData.cs deleted file mode 100644 index d4aaea9..0000000 --- a/FarmmapsNbs/Models/TargetNData.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace FarmmapsNbs.Models -{ - public class TargetNData - { - public double TSum { get; set; } - public int TargetYield { get; set; } - public double TargetN { get; set; } - } -} \ No newline at end of file diff --git a/FarmmapsNbs/NitrogenInput.json b/FarmmapsNbs/NitrogenInput.json deleted file mode 100644 index 6e2afe5..0000000 --- a/FarmmapsNbs/NitrogenInput.json +++ /dev/null @@ -1,310 +0,0 @@ -[ - { - "file": "Scan_1_20190605.json", - "inputVariable": "irmi", - "outputFileName": "vranbs1", - "plantingDate": "2019-04-18", - "measurementDate": "2019-06-05", - "potatoPurposeType": "consumption", - "targetYield": 45, - "geometryJson": { - "type": "Polygon", - "coordinates": [ - [ - [ 3.40843828875524, 50.638966444680605 ], - [ 3.408953272886064, 50.639197789621612 ], - [ 3.409242951459603, 50.639469958681836 ], - [ 3.409328782148028, 50.639612846807708 ], - [ 3.409457528180712, 50.639789755314411 ], - [ 3.409639918393741, 50.640014292074966 ], - [ 3.409833037442765, 50.640211611372706 ], - [ 3.410069071836049, 50.640395321698435 ], - [ 3.410380208081761, 50.640572227259661 ], - [ 3.410605513638958, 50.640715112034222 ], - [ 3.411925160474145, 50.641177783561204 ], - [ 3.411935889310142, 50.640728720085136 ], - [ 3.412590348309737, 50.63948356709389 ], - [ 3.413244807309242, 50.638224772339846 ], - [ 3.413400375432099, 50.637901562841307 ], - [ 3.413539850300779, 50.637449065809889 ], - [ 3.413475477284437, 50.637418445552932 ], - [ 3.40999396998362, 50.637449065810451 ], - [ 3.409940325803365, 50.638102293212661 ], - [ 3.409575545377398, 50.638483338338325 ], - [ 3.409060561246574, 50.638707881340494 ], - [ 3.40843828875524, 50.638966444680605 ] - ] - ] - }, - //{ - //"file": "[...].json", - //"inputVariable": "wdvi", - //"outputFileName": "20201211_Mahindra", - //"plantingDate": "2020-11-25", - //"measurementDate": "2020-12-08", - //"potatoPurposeType": "consumption", - //"targetYield": 45, - //"geometryJson": { - // "type": "Polygon", - // "coordinates": [ - // [ - // [ 75.4652734163369, 31.26328617861426 ], - // [ 75.46527659380338, 31.26437743805827 ], - // [ 75.46494267602188, 31.26438166160194 ], - // [ 75.46493257618651, 31.26462192072676 ], - // [ 75.46438242791261, 31.26462132638865 ], - // [ 75.46438225728252, 31.26334267015003 ], - // [ 75.46448543502072, 31.26333463263533 ], - // [ 75.46448842093658, 31.26302891147988 ], - // [ 75.46507631089699, 31.26299589154944 ], - // [ 75.46509039016291, 31.26329023051392 ], - // [ 75.4652734163369, 31.26328617861426 ] - // ] - // ] - //} - //} - - //}, - //{ - // "file": "Scan_1_20190605.zip", - // "inputVariable": "irmi", - // "outputFileName": "vranbs2", - // "plantingDate": "2019-04-18", - // "measurementDate": "2019-06-05", - // "potatoPurposeType": "starch", - // "targetYield": 45, - // "geometryJson": { - // "type": "Polygon", - // "coordinates": [ - // [ - // [ 3.40843828875524, 50.638966444680605 ], - // [ 3.408953272886064, 50.639197789621612 ], - // [ 3.409242951459603, 50.639469958681836 ], - // [ 3.409328782148028, 50.639612846807708 ], - // [ 3.409457528180712, 50.639789755314411 ], - // [ 3.409639918393741, 50.640014292074966 ], - // [ 3.409833037442765, 50.640211611372706 ], - // [ 3.410069071836049, 50.640395321698435 ], - // [ 3.410380208081761, 50.640572227259661 ], - // [ 3.410605513638958, 50.640715112034222 ], - // [ 3.411925160474145, 50.641177783561204 ], - // [ 3.411935889310142, 50.640728720085136 ], - // [ 3.412590348309737, 50.63948356709389 ], - // [ 3.413244807309242, 50.638224772339846 ], - // [ 3.413400375432099, 50.637901562841307 ], - // [ 3.413539850300779, 50.637449065809889 ], - // [ 3.413475477284437, 50.637418445552932 ], - // [ 3.40999396998362, 50.637449065810451 ], - // [ 3.409940325803365, 50.638102293212661 ], - // [ 3.409575545377398, 50.638483338338325 ], - // [ 3.409060561246574, 50.638707881340494 ], - // [ 3.40843828875524, 50.638966444680605 ] - // ] - // ] - // } - //}, - //{ - // "file": "Scan_1_20190605.zip", - // "inputVariable": "irmi", - { - "file": "", // keep emptpy to use satellite image - "inputVariable": "wdvi", - "InputLayerName": "wdvi", - "outputFileName": "rtest1", - "plantingDate": "2020-05-01", - "measurementDate": "2020-06-14", - "potatoPurposeType": "consumption", - "targetYield": 60, - "geometryJson": { - "type": "Polygon", - "coordinates": [ - [ - [ 4.960707146896585, 52.800583669708487 ], - [ 4.960645975538824, 52.800470217610922 ], - [ 4.962140695752897, 52.799177147194797 ], - [ 4.967523821195745, 52.801502400041208 ], - [ 4.966336768950911, 52.802543735879809 ], - [ 4.961711880764330, 52.801009996856429 ], - [ 4.960707146896585, 52.800583669708487 ] - ] - ] - } - } - //, - //{ - // "file": "", // keep emptpy to use satellite image - // "inputVariable": "wdvi", - // "InputLayerName": "wdvi", - // "outputFileName": "mtest1", - // "plantingDate": "2020-04-01", - // "measurementDate": "2020-06-24", - // "potatoPurposeType": "consumption", - // "targetYield": 60, - // "geometryJson": { - // "type": "Polygon", - // "coordinates": [ - // [ - // [ 3.575458869234128, 51.308707885669762 ], - // [ 3.575508957999423, 51.30878478562019 ], - // [ 3.576188404403633, 51.309372997559777 ], - // [ 3.576188872410267, 51.309374219701091 ], - // [ 3.576210290749152, 51.309430091473608 ], - // [ 3.57621266537704, 51.309483685674898 ], - // [ 3.576213477455834, 51.309502027981374 ], - // [ 3.577543136860447, 51.310682367527122 ], - // [ 3.57796629328866, 51.31104321405175 ], - // [ 3.578442479292087, 51.311449273042747 ], - // [ 3.57866702353106, 51.311636072786726 ], - // [ 3.57880446997978, 51.31157117599529 ], - // [ 3.579155910205885, 51.311863542729718 ], - // [ 3.579175814007489, 51.311875435159394 ], - // [ 3.579293885246395, 51.311936532835396 ], - // [ 3.579413896180069, 51.311998649478575 ], - // [ 3.579514543462617, 51.312041110734917 ], - // [ 3.579611760655688, 51.312082118352606 ], - // [ 3.579635115371588, 51.312093949652223 ], - // [ 3.579793143414486, 51.312189437140432 ], - // [ 3.579966991648108, 51.312286148850511 ], - // [ 3.580079704980967, 51.312332458349751 ], - // [ 3.580203717638148, 51.312336471368539 ], - // [ 3.580307101018293, 51.312330239539847 ], - // [ 3.580383836270609, 51.312317097185243 ], - // [ 3.580505207977176, 51.312279163554869 ], - // [ 3.580610387713855, 51.312233723091026 ], - // [ 3.5806309754483, 51.312226093729677 ], - // [ 3.580638516049738, 51.312223727082049 ], - // [ 3.58075536599681, 51.312186990706344 ], - // [ 3.580787745633303, 51.312176820129551 ], - // [ 3.580829682241423, 51.312167665428959 ], - // [ 3.58086828456562, 51.312162614898625 ], - // [ 3.580980493636721, 51.312147935609723 ], - // [ 3.581014352632766, 51.312145662592656 ], - // [ 3.581028980583245, 51.312145592849248 ], - // [ 3.581119189823368, 51.312145103215911 ], - // [ 3.581195330198145, 51.312144693075908 ], - // [ 3.581243537809229, 51.312148741603245 ], - // [ 3.58132480221972, 51.312163110548383 ], - // [ 3.581426517039001, 51.312181089466016 ], - // [ 3.581448095953263, 51.312184910295024 ], - // [ 3.581474337475052, 51.312191038736145 ], - // [ 3.581709405982819, 51.312260068944951 ], - // [ 3.581727319558337, 51.312266163697757 ], - // [ 3.581753583356718, 51.312276407881612 ], - // [ 3.581841655772683, 51.312310743468075 ], - // [ 3.581878851795624, 51.312325234405343 ], - // [ 3.581905889860924, 51.312338260798654 ], - // [ 3.581906254501594, 51.312338472113815 ], - // [ 3.582048236499295, 51.312422439022804 ], - // [ 3.58189849928915, 51.312481944577037 ], - // [ 3.583044298383354, 51.312095780444281 ], - // [ 3.582984006671231, 51.312017283925279 ], - // [ 3.582743535862999, 51.311699343434064 ], - // [ 3.582628599916243, 51.311582190756774 ], - // [ 3.581446834435509, 51.310511259982569 ], - // [ 3.580621864908701, 51.309767270412806 ], - // [ 3.579610575760466, 51.308860440593946 ], - // [ 3.579112608916012, 51.308394999612226 ], - // [ 3.578688808506157, 51.307968441218165 ], - // [ 3.578394256007207, 51.307644098092617 ], - // [ 3.578355980318371, 51.307607614964702 ], - // [ 3.578217977585775, 51.307654179547846 ], - // [ 3.577480636332469, 51.307921035607997 ], - // [ 3.575695560441006, 51.308577167973212 ], - // [ 3.575668643609169, 51.30855384769157 ], - // [ 3.575666204524265, 51.308551734020703 ], - // [ 3.575506397192348, 51.308609906947261 ], - // [ 3.575459139533024, 51.308653178431456 ], - // [ 3.575458869234128, 51.308707885669762 ] - // ] - // ] - // } - //} - //, - //{ - // "file": "Scan_1_20190605.zip", - // "inputVariable": "irmi", - // "InputLayerName": "IRMI", - // "outputFileName": "vranbs3", - // "plantingDate": "2019-04-18", - // "measurementDate": "2019-06-20", - // "potatoPurposeType": "starch", - // "targetYield": 45, - // "geometryJson": { - // "type": "Polygon", - // "coordinates": [ - // [ - // [ 3.40843828875524, 50.638966444680605 ], - // [ 3.408953272886064, 50.639197789621612 ], - // [ 3.409242951459603, 50.639469958681836 ], - // [ 3.409328782148028, 50.639612846807708 ], - // [ 3.409457528180712, 50.639789755314411 ], - // [ 3.409639918393741, 50.640014292074966 ], - // [ 3.409833037442765, 50.640211611372706 ], - // [ 3.410069071836049, 50.640395321698435 ], - // [ 3.410380208081761, 50.640572227259661 ], - // [ 3.410605513638958, 50.640715112034222 ], - // [ 3.411925160474145, 50.641177783561204 ], - // [ 3.411935889310142, 50.640728720085136 ], - // [ 3.412590348309737, 50.63948356709389 ], - // [ 3.413244807309242, 50.638224772339846 ], - // [ 3.413400375432099, 50.637901562841307 ], - // [ 3.413539850300779, 50.637449065809889 ], - // [ 3.413475477284437, 50.637418445552932 ], - // [ 3.40999396998362, 50.637449065810451 ], - // [ 3.409940325803365, 50.638102293212661 ], - // [ 3.409575545377398, 50.638483338338325 ], - // [ 3.409060561246574, 50.638707881340494 ], - // [ 3.40843828875524, 50.638966444680605 ] - // ] - // ] - // } - //}, - //{ - // "file": "Scan_1_20190605.zip", - // "inputVariable": "irmi", - //} - //, - //{ - // "file": "Scan_1_20190605.zip", - // "inputVariable": "irmi", - // "InputLayerName": "", - // "outputFileName": "vranbs4", - // "plantingDate": "2019-04-18", - // "measurementDate": "2019-07-03", - // "potatoPurposeType": "starch", - // "targetYield": 45, - // "geometryJson": { - // "type": "Polygon", - // "coordinates": [ - // [ - // [ 3.40843828875524, 50.638966444680605 ], - // [ 3.408953272886064, 50.639197789621612 ], - // [ 3.409242951459603, 50.639469958681836 ], - // [ 3.409328782148028, 50.639612846807708 ], - // [ 3.409457528180712, 50.639789755314411 ], - // [ 3.409639918393741, 50.640014292074966 ], - // [ 3.409833037442765, 50.640211611372706 ], - // [ 3.410069071836049, 50.640395321698435 ], - // [ 3.410380208081761, 50.640572227259661 ], - // [ 3.410605513638958, 50.640715112034222 ], - // [ 3.411925160474145, 50.641177783561204 ], - // [ 3.411935889310142, 50.640728720085136 ], - // [ 3.412590348309737, 50.63948356709389 ], - // [ 3.413244807309242, 50.638224772339846 ], - // [ 3.413400375432099, 50.637901562841307 ], - // [ 3.413539850300779, 50.637449065809889 ], - // [ 3.413475477284437, 50.637418445552932 ], - // [ 3.40999396998362, 50.637449065810451 ], - // [ 3.409940325803365, 50.638102293212661 ], - // [ 3.409575545377398, 50.638483338338325 ], - // [ 3.409060561246574, 50.638707881340494 ], - // [ 3.40843828875524, 50.638966444680605 ] - // ] - // ] - // } - - } - - //} - -] \ No newline at end of file diff --git a/FarmmapsNbs/NitrogenService.cs b/FarmmapsNbs/NitrogenService.cs deleted file mode 100644 index 96416ef..0000000 --- a/FarmmapsNbs/NitrogenService.cs +++ /dev/null @@ -1,191 +0,0 @@ -using System; -using System.Globalization; -using System.Threading.Tasks; -using FarmmapsApi.Models; -using FarmmapsApi.Services; -using FarmmapsNbs.Models; -using Microsoft.Extensions.Logging; -using static FarmmapsApi.Extensions; -using static FarmmapsApiSamples.Constants; - -namespace FarmmapsNbs -{ - public class NitrogenService - { - private readonly ILogger _logger; - private readonly FarmmapsApiService _farmmapsApiService; - private readonly GeneralService _generalService; - - public NitrogenService(ILogger logger, FarmmapsApiService farmmapsApiService, - GeneralService generalService) - { - _logger = logger; - _farmmapsApiService = farmmapsApiService; - _generalService = generalService; - } - - public async Task CreateTargetNItem(Item cropfieldItem) - { - var itemRequest = new ItemRequest() - { - ParentCode = cropfieldItem.ParentCode, - ItemType = USERINPUT_ITEMTYPE, - Name = "TargetN" - }; - return await _farmmapsApiService.CreateItemAsync(itemRequest); - } - - /// - /// Calculates TargetN, makes the assumption the cropfield and user.input(targetn) item have the same parent - /// - /// The cropfield to base the calculations on - /// The targetN item to save calculations in - /// The date the crop is planted - /// The date the measurements are taken - /// The crop purpose - /// The target yield input for the TargetN calculation - /// The TargetN - public async Task CalculateTargetN(Item cropfieldItem, Item targetNItem, DateTime plantingDate, - DateTime measurementDate, string purposeType, int targetYield) - { - var nbsTargetNRequest = new TaskRequest {TaskType = VRANBS_TASK}; - nbsTargetNRequest.attributes["operation"] = "targetn"; - nbsTargetNRequest.attributes["inputCode"] = targetNItem.Code; - nbsTargetNRequest.attributes["plantingDate"] = plantingDate.ToString("o"); - nbsTargetNRequest.attributes["measurementDate"] = measurementDate.ToString("o"); - nbsTargetNRequest.attributes["purposeType"] = purposeType.ToLower(); - nbsTargetNRequest.attributes["targetYield"] = targetYield.ToString(); - string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, nbsTargetNRequest); - - await PollTask(TimeSpan.FromSeconds(3), async (tokenSource) => - { - var itemTaskStatus = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - if (itemTaskStatus.IsFinished) - tokenSource.Cancel(); - }); - - var itemTask = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - if(itemTask.State == ItemTaskState.Error) - { - _logger.LogError($"Something went wrong with task execution: {itemTask.Message}"); - return null; - } - - var item = await _farmmapsApiService.GetItemAsync(targetNItem.Code); - return item.Data.ToObject(); - } - - /// - /// Calculates the uptake map based on the given inputs - /// - /// The cropfield to base the calculations on - /// - /// The date the crop is planted - /// The date the measurements are taken - /// Data type, could be yara, ci, irmi or wdvi - /// Column name in which the sensor value is stored - /// - public async Task CalculateUptakeMap(Item cropfieldItem, Item inputItem, DateTime plantingDate, - DateTime measurementDate, string inputType, string inputLayerName) - { - var nbsUptakeMapRequest = new TaskRequest {TaskType = VRANBS_TASK}; - nbsUptakeMapRequest.attributes["operation"] = "uptake"; - nbsUptakeMapRequest.attributes["inputCode"] = inputItem.Code; - nbsUptakeMapRequest.attributes["plantingDate"] = plantingDate.ToString("o"); - nbsUptakeMapRequest.attributes["measurementDate"] = measurementDate.ToString("o"); - nbsUptakeMapRequest.attributes["inputType"] = inputType.ToLower(); - if (!(string.IsNullOrEmpty(inputLayerName))) nbsUptakeMapRequest.attributes["inputLayerName"] = inputLayerName; - //toevoeging FS. Kolom IRMI hernoemd als IMI. Deze wordt niet automatisch herkend. En moet dus gespecificeerd worden. - - - - string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, nbsUptakeMapRequest); - - await PollTask(TimeSpan.FromSeconds(5), async (tokenSource) => - { - var itemTaskStatus = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - _logger.LogInformation($"Calculating uptake map; status: {itemTaskStatus.State}"); - if (itemTaskStatus.IsFinished) - tokenSource.Cancel(); - }); - - var itemTask = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - if (itemTask.State == ItemTaskState.Error) - { - _logger.LogError($"Something went wrong with task execution: {itemTask.Message}"); - return null; - } - - var itemName = "VRANbs uptake"; - var uptakeMapItem = await _generalService.FindChildItemAsync(cropfieldItem.Code, - GEOTIFF_PROCESSED_ITEMTYPE, itemName, - i => i.Updated >= itemTask.Finished.GetValueOrDefault(DateTime.UtcNow) && - i.Name.ToLower().Contains(itemName.ToLower())); - - if (uptakeMapItem == null) - { - _logger.LogError("Could not find the uptake geotiff child item under cropfield"); - return null; - } - - return uptakeMapItem; - } - - - /// - /// Creates the nitrogen application map based on given input data - /// - /// The cropfield to base the calculations on - /// The farmmaps item containing the geotiff data - /// The date the crop is planted - /// The date the measurements are taken - /// The inputtype to use, could be yara, ci, irmi or wdvi - /// The target nitrogen to use for the calculations - /// - public async Task CalculateApplicationMap(Item cropfieldItem, Item inputItem, DateTime plantingDate, - DateTime measurementDate, string inputType, double targetN, string inputLayerName) - { - var nbsApplicationMapRequest = new TaskRequest {TaskType = VRANBS_TASK}; - nbsApplicationMapRequest.attributes["operation"] = "application"; - nbsApplicationMapRequest.attributes["inputCode"] = inputItem.Code; - nbsApplicationMapRequest.attributes["plantingDate"] = plantingDate.ToString("o"); - nbsApplicationMapRequest.attributes["measurementDate"] = measurementDate.ToString("o"); - nbsApplicationMapRequest.attributes["inputCode"] = inputItem.Code; - nbsApplicationMapRequest.attributes["inputType"] = inputType.ToLower(); - nbsApplicationMapRequest.attributes["targetN"] = targetN.ToString(CultureInfo.InvariantCulture); - if (!(string.IsNullOrEmpty(inputLayerName))) nbsApplicationMapRequest.attributes["inputLayerName"] = inputLayerName; - - string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(cropfieldItem.Code, nbsApplicationMapRequest); - - await PollTask(TimeSpan.FromSeconds(5), async (tokenSource) => - { - var itemTaskStatus = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - _logger.LogInformation($"Calculating application map; status: {itemTaskStatus.State}"); - if (itemTaskStatus.IsFinished) - tokenSource.Cancel(); - }); - - - - var itemTask = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, itemTaskCode); - if(itemTask.State == ItemTaskState.Error) - { - _logger.LogError($"Something went wrong with task execution: {itemTask.Message}"); - return null; - } - - var itemName = $"VRANbs application"; - var applicationMapItem = await _generalService.FindChildItemAsync(cropfieldItem.Code, - GEOTIFF_PROCESSED_ITEMTYPE, itemName, - i => i.Updated >= itemTask.Finished.GetValueOrDefault(DateTime.UtcNow) && - i.Name.ToLower().Contains(itemName.ToLower())); - if (applicationMapItem == null) - { - _logger.LogError("Could not find the application map geotiff child item under cropfield"); - return null; - } - - return applicationMapItem; - } - } -} \ No newline at end of file diff --git a/FarmmapsNbs/Program.cs b/FarmmapsNbs/Program.cs deleted file mode 100644 index 596637a..0000000 --- a/FarmmapsNbs/Program.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System.Threading.Tasks; -using FarmmapsApi; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Logging; - -namespace FarmmapsNbs -{ - class Program : FarmmapsProgram - { - private static async Task Main(string[] args) - { - await new Program().Start(args); - } - - protected override void Configure(IServiceCollection serviceCollection) - { - serviceCollection.AddLogging(opts => opts - .AddConsole() - .AddFilter("System.Net.Http", LogLevel.Warning)) - .AddTransient(); - } - } -} \ No newline at end of file diff --git a/FarmmapsNbs/appsettings.json b/FarmmapsNbs/appsettings.json deleted file mode 100644 index c5d440a..0000000 --- a/FarmmapsNbs/appsettings.json +++ /dev/null @@ -1,10 +0,0 @@ -{ - "Authority": "https://accounts.test.farmmaps.eu/", - "Endpoint": "https://test.farmmaps.eu/", - "BasePath": "api/v1", - "DiscoveryEndpointUrl": "https://accounts.test.farmmaps.eu/.well-known/openid-configuration", - "RedirectUri": "http://example.nl/api", - "ClientId": "", - "ClientSecret": "", - "Scopes": [ "api" ] -} \ No newline at end of file diff --git a/FarmmapsPoten/Data/PotenInput.json b/FarmmapsPoten/Data/PotenInput.json new file mode 100644 index 0000000..cc195c0 --- /dev/null +++ b/FarmmapsPoten/Data/PotenInput.json @@ -0,0 +1,57 @@ +[ + { + + "File": "BBL-lutum.tif", + "OutputFileName": "BBL-poten_30_10_Shadow-True_TifInput", + "FieldName": "lutum", + "PlantingYear": 2020, + "MeanDensity": "30", + "Variation": "20", + "UseShadow": true, + "CountPerArea": false, + "geometryJson": { + "type": "Polygon", + "coordinates": [ + [ + [ 4.61098862747705418, 52.22974843124053734 ], + [ 4.61338362824790682, 52.22993593073885421 ], + [ 4.61949010053501397, 52.22667042162688489 ], + [ 4.61954106663577324, 52.22670579437124871 ], + [ 4.61953075937382085, 52.22671128094363269 ], + [ 4.61954202811175296, 52.22670563321562298 ], + [ 4.61901745087585081, 52.22634382962637289 ], + [ 4.61812211075603685, 52.22571430401869463 ], + [ 4.61736058962494678, 52.22611942369080396 ], + [ 4.61464150409827134, 52.2275669988328346 ], + [ 4.61407137489250019, 52.22787370291415243 ], + [ 4.61242270952427802, 52.2287649864655279 ], + [ 4.61261020576063618, 52.22887063061121182 ], + [ 4.61256645484349015, 52.22889713517798072 ], + [ 4.61229657126373027, 52.22904994233584119 ], + [ 4.61207777596369262, 52.2291602791168188 ], + [ 4.61174554282434013, 52.22933965721241378 ], + [ 4.61169310584479941, 52.22934596082312453 ], + [ 4.61143525446537428, 52.22949107699816551 ], + [ 4.61100843013417183, 52.22973689585098356 ], + [ 4.61098862747705418, 52.22974843124053734 ] + ] + ] + }, + + "GenerateTaskmap": true, + "CellWidth": "3", + "CellHeight": "10", + "Centered": "false", + "StartPoint": { + "type": "Point", + "coordinates": [ 4.61812211075603685, 52.22571430401869463 ] // BBL + }, + "EndPoint": { + "type": "Point", + "coordinates": [ 4.61242270952427802, 52.2287649864655279 ] // BBL + } // if no angle + + //"Angle": "317.0" // if no endpoint + } + +] diff --git a/FarmmapsPoten/Models/PotenInput.cs b/FarmmapsPoten/Models/PotenInput.cs index 46a7e11..57c71c4 100644 --- a/FarmmapsPoten/Models/PotenInput.cs +++ b/FarmmapsPoten/Models/PotenInput.cs @@ -17,6 +17,8 @@ namespace FarmmapsPoten.Models public JObject GeometryJson { get; set; } public bool GenerateTaskmap { get; set; } + public string OutputType { get; set; } + public string DdiCode { get; set; } public string CellWidth { get; set; } public string CellHeight { get; set; } public string Centered { get; set; } diff --git a/FarmmapsPoten/PotenApplication.cs b/FarmmapsPoten/PotenApplication.cs index 712dd9f..e6b24f5 100644 --- a/FarmmapsPoten/PotenApplication.cs +++ b/FarmmapsPoten/PotenApplication.cs @@ -78,6 +78,10 @@ namespace FarmmapsVRApoten $"VRA Poten cropfield {input.OutputFileName}", input.PlantingYear, input.GeometryJson.ToString(Formatting.None)); + //Item cropfieldItem; + // _logger.LogInformation("Cropfield already exists, trying to get it"); + //cropfieldItem = await _farmmapsApiService.GetItemAsync("2927b80f63b946afb36821470b9c5c23"); + //Calculating shadow map if (useShadow) { _logger.LogInformation("Calculate shadow map for field"); @@ -172,29 +176,40 @@ namespace FarmmapsVRApoten ? "Download application map completed." : "Something went wrong while downloading."); + ////GEOTIFF TO SHAPE + //_logger.LogInformation($"Converting geotiff to shape"); + //var geotiffToShapeItem= await _generalService.GeotiffToShape(applianceMapItem); + //if (taskmap == null) { + // _logger.LogError("Something went wrong with geotiff to shape transformation"); + // return; + //} + + if(input.GenerateTaskmap) { //GEOTIFF TO Taskmap _logger.LogInformation($"Converting geotiff to taskmap"); - var taskmap = await _generalService.CreateTaskmap(cropfieldItem, applianceMapItem, input.CellWidth, input.CellHeight, input.StartPoint.ToString(Formatting.None), - input.Centered, input.EndPoint.ToString(Formatting.None), input.Angle); + var taskmap = (Item)null; + if (input.OutputType == "isoxml") + { + taskmap = await _generalService.CreateTaskmap(cropfieldItem, applianceMapItem, input.OutputType, input.CellWidth, input.CellHeight, input.StartPoint.ToString(Formatting.None), + input.DdiCode, input.Centered, input.EndPoint.ToString(Formatting.None), input.Angle); + } else + { + taskmap = await _generalService.CreateTaskmap(cropfieldItem, applianceMapItem, input.OutputType, input.CellWidth, input.CellHeight, input.StartPoint.ToString(Formatting.None), + input.Centered, input.EndPoint.ToString(Formatting.None), input.Angle); + } + + if (taskmap == null) { _logger.LogError("Something went wrong with geotiff to taskmap transformation"); return; } - - ////GEOTIFF TO SHAPE - //_logger.LogInformation($"Converting geotiff to shape"); - //var geotiffToShapeItem= await _generalService.GeotiffToShape(applianceMapItem); - //if (taskmap == null) { - // _logger.LogError("Something went wrong with geotiff to shape transformation"); - // return; - //} - _logger.LogInformation("Downloading taskmap"); await _farmmapsApiService.DownloadItemAsync(taskmap.Code, Path.Combine(DownloadFolder, $"VRApoten_taskmap_{input.OutputFileName}.zip")); + } } } } \ No newline at end of file diff --git a/FarmmapsPoten/PotenInput.json b/FarmmapsPoten/PotenInput.json index d3e7ce7..4e68e22 100644 --- a/FarmmapsPoten/PotenInput.json +++ b/FarmmapsPoten/PotenInput.json @@ -1,57 +1,368 @@ [ - { + //{ - "File": "BBL-lutum.tif", - "OutputFileName": "BBL-poten_30_20_Shadow-True-v2_TifInput", - "FieldName": "lutum", - "PlantingYear": 2020, - "MeanDensity": "30", - "Variation": "20", - "UseShadow": true, - "CountPerArea": false, - "geometryJson": { - "type": "Polygon", - "coordinates": [ - [ - [ 4.61098862747705418, 52.22974843124053734 ], - [ 4.61338362824790682, 52.22993593073885421 ], - [ 4.61949010053501397, 52.22667042162688489 ], - [ 4.61954106663577324, 52.22670579437124871 ], - [ 4.61953075937382085, 52.22671128094363269 ], - [ 4.61954202811175296, 52.22670563321562298 ], - [ 4.61901745087585081, 52.22634382962637289 ], - [ 4.61812211075603685, 52.22571430401869463 ], - [ 4.61736058962494678, 52.22611942369080396 ], - [ 4.61464150409827134, 52.2275669988328346 ], - [ 4.61407137489250019, 52.22787370291415243 ], - [ 4.61242270952427802, 52.2287649864655279 ], - [ 4.61261020576063618, 52.22887063061121182 ], - [ 4.61256645484349015, 52.22889713517798072 ], - [ 4.61229657126373027, 52.22904994233584119 ], - [ 4.61207777596369262, 52.2291602791168188 ], - [ 4.61174554282434013, 52.22933965721241378 ], - [ 4.61169310584479941, 52.22934596082312453 ], - [ 4.61143525446537428, 52.22949107699816551 ], - [ 4.61100843013417183, 52.22973689585098356 ], - [ 4.61098862747705418, 52.22974843124053734 ] - ] - ] - }, + // "File": "ClaassenVRA_Kruising_LutEmptyPointsErased_largerExtent.zip", + // "OutputFileName": "2021.03.31.ClaassenVRA_Kruising_Lut_EmptyPointsErased_largeExtent", + // "FieldName": "Lutum", + // "PlantingYear": 2021, + // "MeanDensity": "15", + // "Variation": "20", + // "UseShadow": true, + // "CountPerArea": false, + // "geometryJson": { + // "type": "Polygon", + // "coordinates": [ + // [ + // [ 6.3070655, 53.3623397 ], + // [ 6.3070875, 53.3623898 ], + // [ 6.3071092, 53.3624398 ], + // [ 6.3071312, 53.3624898 ], + // [ 6.3071531, 53.3625399 ], + // [ 6.3071749, 53.3625899 ], + // [ 6.3071968, 53.36264 ], + // [ 6.3072186, 53.36269 ], + // [ 6.3072393, 53.3627389 ], + // [ 6.3072598, 53.3627879 ], + // [ 6.3072803, 53.3628367 ], + // [ 6.3073008, 53.3628856 ], + // [ 6.3073215, 53.3629345 ], + // [ 6.307342, 53.3629834 ], + // [ 6.3073625, 53.3630324 ], + // [ 6.3073832, 53.3630812 ], + // [ 6.3074037, 53.3631301 ], + // [ 6.3074242, 53.363179 ], + // [ 6.3074447, 53.3632279 ], + // [ 6.3074654, 53.3632768 ], + // [ 6.3074859, 53.3633257 ], + // [ 6.3075064, 53.3633746 ], + // [ 6.3075271, 53.3634235 ], + // [ 6.3075476, 53.3634724 ], + // [ 6.3075681, 53.3635213 ], + // [ 6.3075886, 53.3635702 ], + // [ 6.3076093, 53.3636191 ], + // [ 6.3076609, 53.3637669 ], + // [ 6.3076735, 53.3638141 ], + // [ 6.3076717, 53.3638452 ], + // [ 6.3076566, 53.3638765 ], + // [ 6.3076265, 53.3639037 ], + // [ 6.3075848, 53.3639245 ], + // [ 6.3075321, 53.3639382 ], + // [ 6.3074494, 53.3639508 ], + // [ 6.3073665, 53.3639632 ], + // [ 6.3072835, 53.3639758 ], + // [ 6.3072006, 53.3639884 ], + // [ 6.3071179, 53.3640008 ], + // [ 6.307035, 53.3640134 ], + // [ 6.306952, 53.3640258 ], + // [ 6.3068693, 53.3640384 ], + // [ 6.3067864, 53.3640509 ], + // [ 6.3067035, 53.3640634 ], + // [ 6.3066207, 53.3640759 ], + // [ 6.3065378, 53.3640884 ], + // [ 6.3064549, 53.364101 ], + // [ 6.306372, 53.3641135 ], + // [ 6.3062892, 53.364126 ], + // [ 6.3062063, 53.3641385 ], + // [ 6.3061234, 53.364151 ], + // [ 6.305889, 53.3641875 ], + // [ 6.3058018, 53.3642004 ], + // [ 6.3057146, 53.3642134 ], + // [ 6.3056273, 53.3642265 ], + // [ 6.3055401, 53.3642395 ], + // [ 6.3054529, 53.3642525 ], + // [ 6.3053655, 53.3642655 ], + // [ 6.3052782, 53.3642785 ], + // [ 6.3051975, 53.3642908 ], + // [ 6.3051167, 53.3643032 ], + // [ 6.3050358, 53.3643154 ], + // [ 6.304955, 53.3643277 ], + // [ 6.3048741, 53.3643401 ], + // [ 6.3047933, 53.3643523 ], + // [ 6.3047126, 53.3643647 ], + // [ 6.3046316, 53.364377 ], + // [ 6.3045509, 53.3643893 ], + // [ 6.3044701, 53.3644016 ], + // [ 6.3043892, 53.3644139 ], + // [ 6.3043086, 53.3644261 ], + // [ 6.304228, 53.3644382 ], + // [ 6.3041476, 53.3644503 ], + // [ 6.304067, 53.3644624 ], + // [ 6.3039864, 53.3644746 ], + // [ 6.3039059, 53.3644868 ], + // [ 6.3038253, 53.3644989 ], + // [ 6.3037447, 53.3645111 ], + // [ 6.3036641, 53.3645232 ], + // [ 6.3035835, 53.3645353 ], + // [ 6.303503, 53.3645474 ], + // [ 6.3034224, 53.3645596 ], + // [ 6.3033418, 53.3645717 ], + // [ 6.3032344, 53.3645896 ], + // [ 6.3029993, 53.364623 ], + // [ 6.3028959, 53.3646389 ], + // [ 6.3027925, 53.3646549 ], + // [ 6.3026889, 53.3646708 ], + // [ 6.3025855, 53.3646868 ], + // [ 6.3024821, 53.3647026 ], + // [ 6.3024042, 53.3647144 ], + // [ 6.3023261, 53.3647261 ], + // [ 6.3022482, 53.3647378 ], + // [ 6.3021702, 53.3647495 ], + // [ 6.3020923, 53.3647612 ], + // [ 6.3020142, 53.364773 ], + // [ 6.3019363, 53.3647847 ], + // [ 6.3018585, 53.3647964 ], + // [ 6.3017804, 53.3648081 ], + // [ 6.3017025, 53.3648198 ], + // [ 6.3016245, 53.3648315 ], + // [ 6.3015466, 53.3648433 ], + // [ 6.3014687, 53.364855 ], + // [ 6.3013906, 53.3648667 ], + // [ 6.3013128, 53.3648784 ], + // [ 6.3012347, 53.3648901 ], + // [ 6.3011568, 53.3649018 ], + // [ 6.3010788, 53.3649136 ], + // [ 6.3010009, 53.3649253 ], + // [ 6.300923, 53.364937 ], + // [ 6.3008449, 53.3649487 ], + // [ 6.300767, 53.3649604 ], + // [ 6.300689, 53.3649721 ], + // [ 6.3006111, 53.3649839 ], + // [ 6.300533, 53.3649956 ], + // [ 6.3004552, 53.3650073 ], + // [ 6.3003771, 53.365019 ], + // [ 6.3002992, 53.3650307 ], + // [ 6.3002213, 53.3650425 ], + // [ 6.3001433, 53.3650542 ], + // [ 6.3000654, 53.3650659 ], + // [ 6.2999843, 53.3650783 ], + // [ 6.2999033, 53.3650905 ], + // [ 6.2998224, 53.3651029 ], + // [ 6.2997415, 53.3651151 ], + // [ 6.2996603, 53.3651274 ], + // [ 6.2995794, 53.3651398 ], + // [ 6.2994985, 53.365152 ], + // [ 6.2994175, 53.3651644 ], + // [ 6.2993364, 53.3651767 ], + // [ 6.2992623, 53.3651849 ], + // [ 6.2992157, 53.3651857 ], + // [ 6.2991679, 53.365182 ], + // [ 6.2991157, 53.3651694 ], + // [ 6.2990734, 53.3651492 ], + // [ 6.2990423, 53.3651248 ], + // [ 6.299008, 53.3650764 ], + // [ 6.2989616, 53.3649669 ], + // [ 6.2989414, 53.3649136 ], + // [ 6.2989213, 53.3648604 ], + // [ 6.2989011, 53.3648072 ], + // [ 6.298881, 53.3647538 ], + // [ 6.2988608, 53.3647006 ], + // [ 6.2988407, 53.3646474 ], + // [ 6.2988206, 53.3645941 ], + // [ 6.2987995, 53.3645407 ], + // [ 6.2987785, 53.3644873 ], + // [ 6.2987574, 53.3644339 ], + // [ 6.2987364, 53.3643805 ], + // [ 6.2987153, 53.3643271 ], + // [ 6.2986943, 53.3642738 ], + // [ 6.2986731, 53.3642204 ], + // [ 6.298654, 53.364171 ], + // [ 6.2986349, 53.3641217 ], + // [ 6.2986159, 53.3640723 ], + // [ 6.2985968, 53.3640229 ], + // [ 6.2985777, 53.3639736 ], + // [ 6.2985587, 53.3639242 ], + // [ 6.2985396, 53.3638748 ], + // [ 6.2985205, 53.3638254 ], + // [ 6.2985015, 53.3637761 ], + // [ 6.2984826, 53.3637267 ], + // [ 6.2984571, 53.3636525 ], + // [ 6.2984554, 53.3636239 ], + // [ 6.2984678, 53.3635953 ], + // [ 6.2984948, 53.3635675 ], + // [ 6.2985616, 53.3635415 ], + // [ 6.2986411, 53.3635329 ], + // [ 6.2987148, 53.363522 ], + // [ 6.2987885, 53.3635112 ], + // [ 6.2988625, 53.3635003 ], + // [ 6.2989362, 53.3634895 ], + // [ 6.29901, 53.3634786 ], + // [ 6.2990837, 53.3634678 ], + // [ 6.2991574, 53.363457 ], + // [ 6.2992312, 53.3634461 ], + // [ 6.2993049, 53.3634353 ], + // [ 6.2993787, 53.3634244 ], + // [ 6.2994524, 53.3634136 ], + // [ 6.2995262, 53.3634028 ], + // [ 6.2995999, 53.3633919 ], + // [ 6.2996737, 53.3633811 ], + // [ 6.2997474, 53.3633702 ], + // [ 6.2998211, 53.3633594 ], + // [ 6.2998949, 53.3633486 ], + // [ 6.2999686, 53.3633376 ], + // [ 6.3000424, 53.3633268 ], + // [ 6.3001161, 53.3633159 ], + // [ 6.3001899, 53.3633051 ], + // [ 6.3002636, 53.3632943 ], + // [ 6.3003374, 53.3632834 ], + // [ 6.3004111, 53.3632726 ], + // [ 6.3004848, 53.3632617 ], + // [ 6.3005588, 53.3632509 ], + // [ 6.3006325, 53.36324 ], + // [ 6.3007063, 53.3632292 ], + // [ 6.30078, 53.3632184 ], + // [ 6.3008537, 53.3632075 ], + // [ 6.3009275, 53.3631967 ], + // [ 6.3010012, 53.3631858 ], + // [ 6.301075, 53.363175 ], + // [ 6.3011487, 53.3631642 ], + // [ 6.3012225, 53.3631533 ], + // [ 6.3012962, 53.3631425 ], + // [ 6.30137, 53.3631316 ], + // [ 6.3014437, 53.3631208 ], + // [ 6.3015174, 53.36311 ], + // [ 6.3015912, 53.3630991 ], + // [ 6.3016649, 53.3630883 ], + // [ 6.3017387, 53.3630774 ], + // [ 6.3018124, 53.3630666 ], + // [ 6.3018862, 53.3630558 ], + // [ 6.3019599, 53.3630449 ], + // [ 6.3020337, 53.3630341 ], + // [ 6.3021074, 53.3630232 ], + // [ 6.3021811, 53.3630124 ], + // [ 6.3022549, 53.3630016 ], + // [ 6.3023286, 53.3629907 ], + // [ 6.3024026, 53.3629799 ], + // [ 6.3024763, 53.362969 ], + // [ 6.30255, 53.3629582 ], + // [ 6.3026238, 53.3629474 ], + // [ 6.3026975, 53.3629365 ], + // [ 6.3027713, 53.3629256 ], + // [ 6.302845, 53.3629147 ], + // [ 6.3029188, 53.3629039 ], + // [ 6.3029925, 53.362893 ], + // [ 6.3030663, 53.3628822 ], + // [ 6.30314, 53.3628714 ], + // [ 6.3032137, 53.3628605 ], + // [ 6.3032875, 53.3628497 ], + // [ 6.3033612, 53.3628388 ], + // [ 6.303435, 53.362828 ], + // [ 6.3035087, 53.3628172 ], + // [ 6.3035825, 53.3628063 ], + // [ 6.3036562, 53.3627955 ], + // [ 6.30373, 53.3627846 ], + // [ 6.3038037, 53.3627738 ], + // [ 6.3038774, 53.362763 ], + // [ 6.3039512, 53.3627521 ], + // [ 6.3040249, 53.3627413 ], + // [ 6.3040987, 53.3627304 ], + // [ 6.3041724, 53.3627196 ], + // [ 6.3042462, 53.3627088 ], + // [ 6.3043199, 53.3626979 ], + // [ 6.3043937, 53.3626871 ], + // [ 6.3044674, 53.3626762 ], + // [ 6.3045413, 53.3626654 ], + // [ 6.3046151, 53.3626545 ], + // [ 6.3046888, 53.3626436 ], + // [ 6.3047626, 53.3626328 ], + // [ 6.3048363, 53.3626219 ], + // [ 6.30491, 53.3626111 ], + // [ 6.3049838, 53.3626002 ], + // [ 6.3050575, 53.3625894 ], + // [ 6.3051313, 53.3625786 ], + // [ 6.305205, 53.3625677 ], + // [ 6.3052788, 53.3625569 ], + // [ 6.3053525, 53.362546 ], + // [ 6.3054263, 53.3625352 ], + // [ 6.3055, 53.3625244 ], + // [ 6.3055737, 53.3625135 ], + // [ 6.3056475, 53.3625027 ], + // [ 6.3057212, 53.3624918 ], + // [ 6.305795, 53.362481 ], + // [ 6.3058687, 53.3624701 ], + // [ 6.3059425, 53.3624593 ], + // [ 6.3060162, 53.3624485 ], + // [ 6.30609, 53.3624376 ], + // [ 6.3061637, 53.3624268 ], + // [ 6.3062374, 53.3624158 ], + // [ 6.3063112, 53.362405 ], + // [ 6.3063849, 53.3623942 ], + // [ 6.3064587, 53.3623833 ], + // [ 6.3065324, 53.3623725 ], + // [ 6.3066062, 53.3623616 ], + // [ 6.3066799, 53.3623508 ], + // [ 6.3067537, 53.36234 ], + // [ 6.3068274, 53.3623291 ], + // [ 6.3069011, 53.3623183 ], + // [ 6.3069749, 53.3623074 ], + // [ 6.3070314, 53.3623125 ], + // [ 6.3070655, 53.3623397 ] + // ] + // ] + // }, - "GenerateTaskmap": true, - "CellWidth": "3", - "CellHeight": "10", - "Centered": "false", - "StartPoint": { - "type": "Point", - "coordinates": [ 4.61812211075603685, 52.22571430401869463 ] // BBL - }, - "EndPoint": { - "type": "Point", - "coordinates": [ 4.61242270952427802, 52.2287649864655279 ] // BBL - } // if no angle + // "GenerateTaskmap": true, + // "OutputType": "isoxml", // "shape" or "isoxml" if isoxml also add ddiCode + // "DdiCode": "0001", + // "CellWidth": "3", + // "CellHeight": "10", + // "Centered": "false", + // "StartPoint": { + // "type": "Point", + // "coordinates": [ 6.306901145501940, 53.362318269638386 ] + // }, + // "EndPoint": { + // "type": "Point", + // "coordinates": [ 6.298561552458957, 53.363541544243297 ] + // } // if no angle + + // // "Angle": "317.0" // if no endpoint + //} + + { + "File": "PlantingSampleDataLutum.zip", + "OutputFileName": "2021.03.15_vraPoten_SampleData", + "FieldName": "lutum", + "PlantingYear": 2020, + "MeanDensity": "30", + "Variation": "20", + "UseShadow": false, + "CountPerArea": true, + "geometryJson": { + "type": "Polygon", + "coordinates": [ + [ + [ 5.66886041703652044, 52.52929999060298627 ], + [ 5.6716230923214912, 52.52946316399909676 ], + [ 5.67185376229668581, 52.5280565894154563 ], + [ 5.66903207841337231, 52.52790646510525363 ], + [ 5.66886041703652044, 52.52929999060298627 ] + ] + ] + }, + + "GenerateTaskmap": true, + "OutputType": "isoxml", // "shape" or "isoxml" if isoxml also add ddiCode + "DdiCode": "0001", + "CellWidth": "3", + "CellHeight": "10", + "Centered": "true", + "StartPoint": { + "type": "Point", + //"coordinates": [ 5.669032078413372, 52.527906465105254 ] // 1 + //"coordinates": [ 5.668860417036520, 52.529299990602986 ] // 2 + //"coordinates": [ 5.671623092321491, 52.529463163999097 ] // 3 + "coordinates": [ 5.668375834141733, 52.527202407445586 ] // 4 + }, + "EndPoint": { + "type": "Point", + "coordinates": [ 5.668263398897563, 52.529744573890817 ] // 1 + //"coordinates": [ 5.668860417036520, 52.529299990602986 ] // 2 + //"coordinates": [ 5.671623092321491, 52.529463163999097 ] // 3 + //"coordinates": [ 5.671853762296686, 52.528056589415456 ] // 4 + } // if no angle + + //"Angle": "317.0" // if no endpoint + } - //"Angle": "317.0" // if no endpoint - } ]