fixed geotiftoshape to work with new taskmap task.

This commit is contained in:
Mark van der Wal 2021-02-11 14:51:27 +01:00
parent 2acd4930b1
commit 1c04dfe1af

View File

@ -43,7 +43,7 @@ namespace FarmmapsApi.Services
public async Task<Item> UploadDataAsync(UserRoot root, string itemType, string filePath, string itemName) public async Task<Item> UploadDataAsync(UserRoot root, string itemType, string filePath, string itemName)
{ {
var startUpload = DateTime.UtcNow; var startUpload = DateTime.UtcNow.AddSeconds(-3);
var result = await _farmmapsApiService.UploadFile(filePath, root.Code, var result = await _farmmapsApiService.UploadFile(filePath, root.Code,
progress => _logger.LogInformation($"Status: {progress.Status} - BytesSent: {progress.BytesSent}")); progress => _logger.LogInformation($"Status: {progress.Status} - BytesSent: {progress.BytesSent}"));
@ -82,6 +82,9 @@ namespace FarmmapsApi.Services
public async Task<Item> GeotiffToShape(Item tiffItem) public async Task<Item> GeotiffToShape(Item tiffItem)
{ {
var taskmapRequest = new TaskRequest {TaskType = TASKMAP_TASK}; var taskmapRequest = new TaskRequest {TaskType = TASKMAP_TASK};
taskmapRequest.attributes["cellWidth"] = "3";
taskmapRequest.attributes["cellHeight"] = "1";
taskmapRequest.attributes["angle"] = "0";
string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(tiffItem.Code, taskmapRequest); string itemTaskCode = await _farmmapsApiService.QueueTaskAsync(tiffItem.Code, taskmapRequest);
@ -102,7 +105,7 @@ namespace FarmmapsApi.Services
//the taskmap is a child of the input tiff //the taskmap is a child of the input tiff
var itemName = "Taskmap"; var itemName = "Taskmap";
var taskMapItem = await FindChildItemAsync(tiffItem.Code, var taskMapItem = await FindChildItemAsync(tiffItem.ParentCode,
SHAPE_PROCESSED_ITEMTYPE, itemName); SHAPE_PROCESSED_ITEMTYPE, itemName);
if (taskMapItem == null) if (taskMapItem == null)
{ {