Implemented, tested geojson as 'input'

This commit is contained in:
2020-07-06 13:12:44 +02:00
parent 10b6cc8cd1
commit 65a0398444
3 changed files with 117 additions and 2 deletions

View File

@@ -9,13 +9,13 @@ using FarmmapsApi.Services;
using FarmmapsNbs.Models;
using Microsoft.Extensions.Logging;
using Newtonsoft.Json;
using static FarmmapsApiSamples.Constants;
namespace FarmmapsNbs
{
public class NbsApplication : IApplication
{
private const string DownloadFolder = "Downloads";
private const string GEOJSON_ITEMTYPE = "vnd.farmmaps.itemtype.geojson";
private readonly ILogger<NbsApplication> _logger;
private readonly FarmmapsApiService _farmmapsApiService;
@@ -81,7 +81,7 @@ namespace FarmmapsNbs
var isGeoJson = input.File.Contains("json");
var dataPath = Path.Combine("Data", input.File);
var shapeItem = isGeoJson ?
await _generalService.UploadDataAsync(uploadedRoot, GEOJSON_ITEMTYPE, dataPath, Path.GetFileNameWithoutExtension(input.File)):
await _generalService.UploadDataAsync(uploadedRoot, SHAPE_PROCESSED_ITEMTYPE, dataPath, Path.GetFileNameWithoutExtension(input.File)):
await _generalService.UploadZipWithShapeAsync(uploadedRoot, dataPath, Path.GetFileNameWithoutExtension(input.File));
if (shapeItem == null)