mirror of
https://github.com/azaion/gps-denied-desktop.git
synced 2026-04-22 22:46:36 +00:00
initial structure implemented
docs -> _docs
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
from .base import SatelliteDataManagerBase
|
||||
from .satellite_data_manager import SatelliteDataManager
|
||||
|
||||
__all__ = ["SatelliteDataManagerBase", "SatelliteDataManager"]
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
from abc import ABC, abstractmethod
|
||||
from typing import Optional
|
||||
import numpy as np
|
||||
|
||||
from models.core import GPSPoint
|
||||
from models.satellite import TileCoords, TileBounds
|
||||
|
||||
|
||||
class SatelliteDataManagerBase(ABC):
|
||||
@abstractmethod
|
||||
async def get_tile(
|
||||
self, gps: GPSPoint, zoom: int
|
||||
) -> Optional[tuple[np.ndarray, TileBounds]]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_tile_by_coords(
|
||||
self, coords: TileCoords
|
||||
) -> Optional[tuple[np.ndarray, TileBounds]]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_tiles_in_radius(
|
||||
self, center: GPSPoint, radius_meters: float, zoom: int
|
||||
) -> list[tuple[np.ndarray, TileBounds]]:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def get_tile_bounds(self, coords: TileCoords) -> TileBounds:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
async def prefetch_area(
|
||||
self, nw: GPSPoint, se: GPSPoint, zoom: int
|
||||
) -> int:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def gps_to_tile_coords(self, gps: GPSPoint, zoom: int) -> TileCoords:
|
||||
pass
|
||||
|
||||
@abstractmethod
|
||||
def tile_coords_to_gps(self, coords: TileCoords) -> GPSPoint:
|
||||
pass
|
||||
|
||||
@@ -0,0 +1,38 @@
|
||||
from typing import Optional
|
||||
import numpy as np
|
||||
|
||||
from .base import SatelliteDataManagerBase
|
||||
from models.core import GPSPoint
|
||||
from models.satellite import TileCoords, TileBounds
|
||||
|
||||
|
||||
class SatelliteDataManager(SatelliteDataManagerBase):
|
||||
async def get_tile(
|
||||
self, gps: GPSPoint, zoom: int
|
||||
) -> Optional[tuple[np.ndarray, TileBounds]]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_tile_by_coords(
|
||||
self, coords: TileCoords
|
||||
) -> Optional[tuple[np.ndarray, TileBounds]]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_tiles_in_radius(
|
||||
self, center: GPSPoint, radius_meters: float, zoom: int
|
||||
) -> list[tuple[np.ndarray, TileBounds]]:
|
||||
raise NotImplementedError
|
||||
|
||||
async def get_tile_bounds(self, coords: TileCoords) -> TileBounds:
|
||||
raise NotImplementedError
|
||||
|
||||
async def prefetch_area(
|
||||
self, nw: GPSPoint, se: GPSPoint, zoom: int
|
||||
) -> int:
|
||||
raise NotImplementedError
|
||||
|
||||
def gps_to_tile_coords(self, gps: GPSPoint, zoom: int) -> TileCoords:
|
||||
raise NotImplementedError
|
||||
|
||||
def tile_coords_to_gps(self, coords: TileCoords) -> GPSPoint:
|
||||
raise NotImplementedError
|
||||
|
||||
Reference in New Issue
Block a user