Tested and fixed some things

This commit is contained in:
Mark van der Wal 2020-07-07 21:45:39 +02:00
parent 65a0398444
commit bbf2db0040

View File

@ -118,6 +118,11 @@ namespace FarmmapsNbs
var uptakeMapItem = var uptakeMapItem =
await _nitrogenService.CalculateUptakeMap(cropfieldItem, geotiffItem, plantingDate, await _nitrogenService.CalculateUptakeMap(cropfieldItem, geotiffItem, plantingDate,
measurementDate, input.InputVariable); measurementDate, input.InputVariable);
if (uptakeMapItem == null)
{
_logger.LogError("Something went wrong with creating the uptakeMap");
return;
}
_logger.LogInformation("Downloading uptake map"); _logger.LogInformation("Downloading uptake map");
await _farmmapsApiService.DownloadItemAsync(uptakeMapItem.Code, await _farmmapsApiService.DownloadItemAsync(uptakeMapItem.Code,
@ -129,6 +134,11 @@ namespace FarmmapsNbs
measurementDate, measurementDate,
input.InputVariable, targetNData.TargetN); input.InputVariable, targetNData.TargetN);
if (applicationMapItem == null)
{
_logger.LogError("Something went wrong with creating the applicationMap");
return;
}
_logger.LogInformation("Downloading application map"); _logger.LogInformation("Downloading application map");
await _farmmapsApiService.DownloadItemAsync(applicationMapItem.Code, await _farmmapsApiService.DownloadItemAsync(applicationMapItem.Code,
Path.Combine(DownloadFolder, $"{input.OutputFileName}.application.zip")); Path.Combine(DownloadFolder, $"{input.OutputFileName}.application.zip"));