mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-06-21 14:01:14 +00:00
534ab41b8e
Pure whitespace-only cleanup uncovered by the new format gate from the previous commit. Verified via `git diff -w --stat`: only 4 files differ when whitespace is ignored, and those differ only by the BOM byte. Cleanup kinds applied across 22 source files: - BOM removal (MapConfig.cs, SatTile.cs, GeoUtils.cs, IntegrationTests/Program.cs) - CRLF -> LF (IntegrationTests/Program.cs) - Trailing whitespace on blank lines (Common, Api, DataAccess, IntegrationTests, Services.RegionProcessing, Services.TileDownloader) - Final newline added (RoutePoint.cs, GeoPoint.cs, others) After this commit `dotnet format whitespace SatelliteProvider.sln --verify-no-changes` exits 0; AC-1 is enforceable from `scripts/ run-tests.sh` going forward. Also lands the batch 22 report, code-review report (PASS_WITH_WARNINGS, 2 Low findings — both deferred per spec), dependency-table status update (AZ-372 -> Done (In Testing)), task archive (todo/ -> done/), and autodev state update. Co-authored-by: Cursor <cursoragent@cursor.com>
39 lines
1.0 KiB
C#
39 lines
1.0 KiB
C#
using System.Text.Json.Serialization;
|
|
|
|
namespace SatelliteProvider.Common.DTO;
|
|
|
|
public class GeoPoint
|
|
{
|
|
const double PRECISION_TOLERANCE = 0.00005;
|
|
|
|
[JsonPropertyName("lat")]
|
|
public double Lat { get; set; }
|
|
|
|
[JsonPropertyName("lon")]
|
|
public double Lon { get; set; }
|
|
|
|
public GeoPoint() { }
|
|
|
|
public GeoPoint(double lat, double lon)
|
|
{
|
|
Lat = lat;
|
|
Lon = lon;
|
|
}
|
|
|
|
public override string ToString() => $"{Lat:F4}, {Lon:F4}";
|
|
|
|
public override bool Equals(object? obj)
|
|
{
|
|
if (obj is not GeoPoint point) return false;
|
|
return ReferenceEquals(this, obj) || Equals(point);
|
|
}
|
|
|
|
private bool Equals(GeoPoint point) =>
|
|
Math.Abs(Lat - point.Lat) < PRECISION_TOLERANCE && Math.Abs(Lon - point.Lon) < PRECISION_TOLERANCE;
|
|
|
|
public override int GetHashCode() => HashCode.Combine(Lat, Lon);
|
|
|
|
public static bool operator ==(GeoPoint left, GeoPoint right) => Equals(left, right);
|
|
public static bool operator !=(GeoPoint left, GeoPoint right) => !Equals(left, right);
|
|
}
|