added 2 more inputs
This commit is contained in:
parent
fb373b7539
commit
f230bd0022
BIN
FarmmapsZonering/Data/data_lowres_9001.tiff
Normal file
BIN
FarmmapsZonering/Data/data_lowres_9001.tiff
Normal file
Binary file not shown.
BIN
FarmmapsZonering/Data/data_times_two_4326.tiff
Normal file
BIN
FarmmapsZonering/Data/data_times_two_4326.tiff
Normal file
Binary file not shown.
@ -74,25 +74,34 @@ namespace FarmmapsZonering
|
||||
cropfieldItem = await _farmmapsApiService.GetItemAsync(_settings.CropfieldItemCode);
|
||||
}
|
||||
|
||||
var inputFileName = "neo_ndvi-reglone-low-weed.tif";
|
||||
var dataPath = Path.Combine("Data", inputFileName);
|
||||
var geotiffItem = await _generalService.UploadDataAsync(uploadedRoot, GEOTIFF_PROCESSED_ITEMTYPE, dataPath,
|
||||
Path.GetFileNameWithoutExtension(inputFileName));
|
||||
|
||||
if (geotiffItem == null) {
|
||||
var inputOneItem = await _generalService.UploadDataAsync(uploadedRoot, GEOTIFF_PROCESSED_ITEMTYPE,
|
||||
Path.Combine("Data", "data_9001.tif"),"data_9001");
|
||||
if (inputOneItem == null) {
|
||||
_logger.LogError("Could not find item for uploaded data");
|
||||
return;
|
||||
}
|
||||
|
||||
var outputItem = await _zoneringService.CreateApplicationMapAsync(cropfieldItem, "[0] * 2", new Output()
|
||||
var inputTwoItem = await _generalService.UploadDataAsync(uploadedRoot, GEOTIFF_PROCESSED_ITEMTYPE,
|
||||
Path.Combine("Data", "data_times_two_4326.tiff"), "data_times_two_4326");
|
||||
if (inputTwoItem == null) {
|
||||
_logger.LogError("Could not find item for uploaded data");
|
||||
return;
|
||||
}
|
||||
|
||||
var outputItem = await _zoneringService.CreateApplicationMapAsync(cropfieldItem, "[0] + [1]", new Output()
|
||||
{
|
||||
Name = "times_2_zonering",
|
||||
Name = "add",
|
||||
Unit = "n/kg",
|
||||
Quantity = "Nitrogen"
|
||||
}, new InputParameter()
|
||||
{
|
||||
ItemCode = geotiffItem.Code,
|
||||
LayerName = geotiffItem.Data["layers"][0]["name"].ToString()
|
||||
ItemCode = inputOneItem.Code,
|
||||
LayerName = inputOneItem.Data["layers"][0]["name"].ToString()
|
||||
},
|
||||
new InputParameter()
|
||||
{
|
||||
ItemCode = inputTwoItem.Code,
|
||||
LayerName = inputTwoItem.Data["layers"][0]["name"].ToString()
|
||||
});
|
||||
|
||||
_logger.LogInformation("Downloading output");
|
||||
|
Loading…
Reference in New Issue
Block a user