diff --git a/FarmmapsApi/Services/GeneralService.cs b/FarmmapsApi/Services/GeneralService.cs index 98199a4..435e247 100644 --- a/FarmmapsApi/Services/GeneralService.cs +++ b/FarmmapsApi/Services/GeneralService.cs @@ -66,10 +66,15 @@ namespace FarmmapsApi.Services i.Name.ToLower().Contains(itemName.ToLower())); ; } - public async Task ShapeToGeotiff(Item shapeItem) + public async Task ShapeToGeotiff(Item shapeItem, int resolution = 1, params string[] inputLayerNames) { var startUpload = DateTime.UtcNow.AddSeconds(-3); - await RunAndWaitForTask(shapeItem, "vnd.farmmaps.task.shapetogeotiff"); + await RunAndWaitForTask(shapeItem, "vnd.farmmaps.task.shapetogeotiff", request => + { + request.attributes["resolution"] = resolution.ToString(); + if(inputLayerNames.Length > 0) + request.attributes["inputLayers"] = $"[{string.Join(",", inputLayerNames)}]"; + }); return await FindChildItemAsync(shapeItem.ParentCode, GEOTIFF_PROCESSED_ITEMTYPE, shapeItem.Name, i => i.Created >= startUpload && diff --git a/FarmmapsNbs/NbsApplication.cs b/FarmmapsNbs/NbsApplication.cs index c98cec6..fb75644 100644 --- a/FarmmapsNbs/NbsApplication.cs +++ b/FarmmapsNbs/NbsApplication.cs @@ -200,7 +200,7 @@ namespace FarmmapsNbs } _logger.LogInformation($"Converting shape to geotiff"); - geotiffItem = await _generalService.ShapeToGeotiff(shapeItem); + geotiffItem = await _generalService.ShapeToGeotiff(shapeItem, 1, input.InputLayerName); if (geotiffItem == null) { _logger.LogError("Something went wrong with shape to geotiff transformation");