changed nitrogen operation name to application.
This commit is contained in:
parent
81218ec0d0
commit
b6e65d2881
@ -52,6 +52,7 @@ namespace FarmmapsApi.Services
|
|||||||
Item shapeItem = null;
|
Item shapeItem = null;
|
||||||
await PollTask(TimeSpan.FromSeconds(3), async source =>
|
await PollTask(TimeSpan.FromSeconds(3), async source =>
|
||||||
{
|
{
|
||||||
|
_logger.LogInformation($"Searching for {itemName} item");
|
||||||
var uploadedFilesChildren = await _farmmapsApiService.GetItemChildrenAsync(root.Code);
|
var uploadedFilesChildren = await _farmmapsApiService.GetItemChildrenAsync(root.Code);
|
||||||
var zipItems = uploadedFilesChildren.Where(i => i.Name.Contains(zipName));
|
var zipItems = uploadedFilesChildren.Where(i => i.Name.Contains(zipName));
|
||||||
|
|
||||||
|
@ -80,7 +80,7 @@ namespace FarmmapsApiSamples
|
|||||||
|
|
||||||
_logger.LogInformation("Calculating appliance map");
|
_logger.LogInformation("Calculating appliance map");
|
||||||
var applianceMapItem =
|
var applianceMapItem =
|
||||||
await CalculateApplianceMap(cropfieldItem, isariaGeotiffItem, plantingDate, measurementDate, targetN);
|
await CalculateApplicationMap(cropfieldItem, isariaGeotiffItem, plantingDate, measurementDate, targetN);
|
||||||
|
|
||||||
_logger.LogInformation("Downloading appliance map");
|
_logger.LogInformation("Downloading appliance map");
|
||||||
await _farmmapsApiService.DownloadItemAsync(applianceMapItem.Code, Path.Combine(downloadFolder, $"{applianceMapItem.Name}.zip"));
|
await _farmmapsApiService.DownloadItemAsync(applianceMapItem.Code, Path.Combine(downloadFolder, $"{applianceMapItem.Name}.zip"));
|
||||||
@ -227,11 +227,11 @@ namespace FarmmapsApiSamples
|
|||||||
/// <param name="measurementDate">The date the measurements are taken</param>
|
/// <param name="measurementDate">The date the measurements are taken</param>
|
||||||
/// <param name="targetN">The target nitrogen to use for the calculations</param>
|
/// <param name="targetN">The target nitrogen to use for the calculations</param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public async Task<Item> CalculateApplianceMap(Item cropfieldItem, Item inputItem, DateTime plantingDate,
|
public async Task<Item> CalculateApplicationMap(Item cropfieldItem, Item inputItem, DateTime plantingDate,
|
||||||
DateTime measurementDate, double targetN)
|
DateTime measurementDate, double targetN)
|
||||||
{
|
{
|
||||||
var nbsApplianceMapRequest = new TaskRequest {TaskType = VRANBS_TASK};
|
var nbsApplianceMapRequest = new TaskRequest {TaskType = VRANBS_TASK};
|
||||||
nbsApplianceMapRequest.attributes["operation"] = "nitrogen";
|
nbsApplianceMapRequest.attributes["operation"] = "application";
|
||||||
nbsApplianceMapRequest.attributes["inputCode"] = inputItem.Code;
|
nbsApplianceMapRequest.attributes["inputCode"] = inputItem.Code;
|
||||||
nbsApplianceMapRequest.attributes["plantingDate"] = plantingDate.ToString();
|
nbsApplianceMapRequest.attributes["plantingDate"] = plantingDate.ToString();
|
||||||
nbsApplianceMapRequest.attributes["measurementDate"] = measurementDate.ToString();
|
nbsApplianceMapRequest.attributes["measurementDate"] = measurementDate.ToString();
|
||||||
@ -264,7 +264,7 @@ namespace FarmmapsApiSamples
|
|||||||
var applianceMapItem = geotiffItems.SingleOrDefault(i => i.Name.Contains("nitrogen") && i.Updated >= itemTask.Finished);
|
var applianceMapItem = geotiffItems.SingleOrDefault(i => i.Name.Contains("nitrogen") && i.Updated >= itemTask.Finished);
|
||||||
if (applianceMapItem == null)
|
if (applianceMapItem == null)
|
||||||
{
|
{
|
||||||
_logger.LogError("Could not find the nitrogen geotiff child item under cropfield");
|
_logger.LogError("Could not find the application map geotiff child item under cropfield");
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user