24 lines
697 B
Python
24 lines
697 B
Python
from __future__ import annotations
|
|
|
|
from collections.abc import Sequence
|
|
|
|
import numpy as np
|
|
|
|
from app.core.geo import PathPoint
|
|
|
|
|
|
class DemNotConfiguredError(RuntimeError):
|
|
"""Raised when DEM access is requested before COG data is configured."""
|
|
|
|
|
|
def elevation_at(lat: float, lon: float, surface: str = "dtm") -> float:
|
|
raise DemNotConfiguredError(
|
|
f"DEM sampling is not configured yet for lat={lat}, lon={lon}, surface={surface}"
|
|
)
|
|
|
|
|
|
def elevations_along(points: Sequence[PathPoint], surface: str = "dtm") -> np.ndarray:
|
|
if not points:
|
|
return np.array([], dtype=float)
|
|
raise DemNotConfiguredError(f"DEM sampling is not configured yet for surface={surface}")
|