first commit
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
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}")
|
||||
Reference in New Issue
Block a user