Files
satellite-provider/SatelliteProvider/DTO/SatTile.cs
T
Oleksandr Bezdieniezhnykh e71b806e04 add SatelliteDownloader
2025-10-25 23:13:06 +03:00

28 lines
773 B
C#

namespace SatelliteProvider.DTO;
public class SatTile
{
public int X { get; }
public int Y { get; }
public GeoPoint LeftTop { get; }
public GeoPoint BottomRight { get; }
public string Url { get; set; }
public SatTile(int x, int y, int zoom, string url)
{
X = x;
Y = y;
Url = url;
LeftTop = GeoUtils.TileToWorldPos(x, y, zoom);
BottomRight = GeoUtils.TileToWorldPos(x + 1, y + 1, zoom);
}
public string FileName => $"tile_lt_{LeftTop.Lat:F6}_{LeftTop.Lon:F6}_br_{BottomRight.Lat:F6}_{BottomRight.Lon:F6}.jpg";
public override string ToString()
{
return $"Tile[X={X}, Y={Y}, TL=({LeftTop.Lat:F6}, {LeftTop.Lon:F6}), BR=({BottomRight.Lat:F6}, {BottomRight.Lon:F6})]";
}
}