Files
gps-denied-desktop/helpers/web_mercator_utils.py
T
Oleksandr Bezdieniezhnykh abc26d5c20 initial structure implemented
docs -> _docs
2025-12-01 14:20:56 +02:00

45 lines
1.1 KiB
Python

import math
from models.core import GPSPoint
from models.satellite import TileCoords, TileBounds
class WebMercatorUtils:
EARTH_RADIUS = 6378137.0
TILE_SIZE = 256
@classmethod
def gps_to_tile(cls, gps: GPSPoint, zoom: int) -> TileCoords:
raise NotImplementedError
@classmethod
def tile_to_gps(cls, coords: TileCoords) -> GPSPoint:
raise NotImplementedError
@classmethod
def get_tile_bounds(cls, coords: TileCoords) -> TileBounds:
raise NotImplementedError
@classmethod
def gps_to_pixel(
cls, gps: GPSPoint, zoom: int
) -> tuple[float, float]:
raise NotImplementedError
@classmethod
def pixel_to_gps(
cls, pixel: tuple[float, float], zoom: int
) -> GPSPoint:
raise NotImplementedError
@classmethod
def meters_per_pixel(cls, lat: float, zoom: int) -> float:
raise NotImplementedError
@classmethod
def get_tiles_in_bounds(
cls, nw: GPSPoint, se: GPSPoint, zoom: int
) -> list[TileCoords]:
raise NotImplementedError