mirror of
https://github.com/azaion/satellite-provider.git
synced 2026-04-22 22:16:38 +00:00
a7a645c7ab
add tests
32 lines
797 B
C#
32 lines
797 B
C#
using SatelliteProvider.Common.Utils;
|
|
|
|
namespace SatelliteProvider.Common.DTO;
|
|
|
|
public class SatTile
|
|
{
|
|
public int X { get; }
|
|
public int Y { get; }
|
|
public int Zoom { 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;
|
|
Zoom = zoom;
|
|
Url = url;
|
|
|
|
LeftTop = GeoUtils.TileToWorldPos(x, y, zoom);
|
|
BottomRight = GeoUtils.TileToWorldPos(x + 1, y + 1, zoom);
|
|
}
|
|
|
|
public string FileName => $"{X}.{Y}.{Zoom}.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})]";
|
|
}
|
|
} |