Проверка, что точек при построении траектории должно быть минимум 2

This commit is contained in:
Olga Nemt 2023-05-11 17:58:26 +05:00
parent a1b4b1b9bb
commit b659cbc934

View File

@ -3,6 +3,7 @@ using AsbCloudApp.Repositories;
using AsbCloudApp.Services; using AsbCloudApp.Services;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.Linq;
using System.Threading; using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
@ -46,6 +47,9 @@ namespace AsbCloudInfrastructure.Services.Trajectory
/// <returns></returns> /// <returns></returns>
private List<TrajectoryVisualizationDto> GetTrajectoryVisualisation(TrajectoryDto[] geoCoordinates) private List<TrajectoryVisualizationDto> GetTrajectoryVisualisation(TrajectoryDto[] geoCoordinates)
{ {
if(geoCoordinates.Length < 2)
return new List<TrajectoryVisualizationDto>();
var cartesianCoordinates = new List<TrajectoryVisualizationDto>(geoCoordinates.Length) { var cartesianCoordinates = new List<TrajectoryVisualizationDto>(geoCoordinates.Length) {
new (), new (),
}; };