17 lines
527 B
Python
17 lines
527 B
Python
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from app.services.raster_base import RasterService
|
|
|
|
|
|
class TerrainService(RasterService):
|
|
def __init__(self, data_dir: str | Path, cache_size: int = 16) -> None:
|
|
super().__init__(data_dir, cache_size=cache_size)
|
|
|
|
def get_elevation(self, lat: float, lng: float) -> float:
|
|
return self.get_value(lat, lng, default=0.0)
|
|
|
|
def get_elevations(self, coordinates: list[tuple[float, float]]) -> list[float]:
|
|
return self.get_values(coordinates, default=0.0)
|