geo fences - wip

This commit is contained in:
Anton Martynenko
2025-11-19 17:26:23 +01:00
parent 5974b0c589
commit d122497b50
22 changed files with 766 additions and 114 deletions
@@ -1,3 +1,5 @@
using System.Text.Json.Serialization;
namespace SatelliteProvider.Common.DTO;
public class CreateRouteRequest
@@ -7,7 +9,12 @@ public class CreateRouteRequest
public string? Description { get; set; }
public double RegionSizeMeters { get; set; }
public int ZoomLevel { get; set; }
public List<RoutePoint> Points { get; set; } = new();
[JsonPropertyName("geofences")]
public Geofences? Geofences { get; set; }
public bool RequestMaps { get; set; } = false;
}
+8 -2
View File
@@ -1,10 +1,16 @@
using System.Text.Json.Serialization;
namespace SatelliteProvider.Common.DTO;
public class GeoPoint
{
const double PRECISION_TOLERANCE = 0.00005;
public double Lat { get; }
public double Lon { get; }
[JsonPropertyName("lat")]
public double Lat { get; set; }
[JsonPropertyName("lon")]
public double Lon { get; set; }
public GeoPoint() { }
@@ -0,0 +1,19 @@
using System.Text.Json.Serialization;
namespace SatelliteProvider.Common.DTO;
public class GeofencePolygon
{
[JsonPropertyName("northWest")]
public GeoPoint? NorthWest { get; set; }
[JsonPropertyName("southEast")]
public GeoPoint? SouthEast { get; set; }
}
public class Geofences
{
[JsonPropertyName("polygons")]
public List<GeofencePolygon> Polygons { get; set; } = new();
}
@@ -1,8 +1,13 @@
using System.Text.Json.Serialization;
namespace SatelliteProvider.Common.DTO;
public class RoutePoint
{
[JsonPropertyName("lat")]
public double Latitude { get; set; }
[JsonPropertyName("lon")]
public double Longitude { get; set; }
}