Added project FarmmapsBulkSatDownload

This commit is contained in:
2021-05-18 18:19:28 +02:00
parent 245e82adbc
commit 250020be78
14 changed files with 918 additions and 1 deletions

View File

@@ -388,6 +388,29 @@ namespace FarmmapsApi.Services
return selectedSatelliteItem;
}
public async Task<List<Item>> FindSatelliteItemsAll(Item cropfieldItem, string satelliteTaskCode)
{
var taskStatus = await _farmmapsApiService.GetTaskStatusAsync(cropfieldItem.Code, satelliteTaskCode);
// find ndvi or wdvi satellite data geotiffs
var temporalItem = await FindChildItemAsync(cropfieldItem.Code, TEMPORAL_ITEMTYPE,
"Cropfield Satellite items", item => item.SourceTask == SATELLITE_TASK &&
taskStatus.Finished >= item.Created &&
taskStatus.Finished <= item.Created.Value.AddHours(1));
if (temporalItem == null)
{
_logger.LogError("Temporal item not found");
}
var satelliteTiffs = await _farmmapsApiService.GetItemChildrenAsync(temporalItem.Code);
return satelliteTiffs;
}
//VanDerSat
public async Task<string> RunVanDerSatTask(Item cropfieldItem) {