@@ -40,9 +40,6 @@ def _rss_mb() -> float:
4040 return float ("nan" )
4141
4242
43- def _mem (label : str ) -> None :
44- _log .debug ("[camera_path mem] %s — RSS %.0f MB" , label , _rss_mb ())
45-
4643# Douglas-Peucker tolerance (metres). Points closer than this to the
4744# straight line between their neighbours are removed.
4845_DP_EPSILON_M = 20.0
@@ -471,25 +468,6 @@ def _douglas_peucker(pts: np.ndarray, epsilon: float) -> np.ndarray:
471468# ------------------------------------------------------------------
472469
473470
474- def _height_at (
475- x : float ,
476- y : float ,
477- grid : ElevationGrid ,
478- bbox : BoundingBox ,
479- lat_m : float ,
480- lon_m : float ,
481- height_mode : str ,
482- height_offset : float ,
483- ) -> float :
484- lat = bbox .min_lat + y / lat_m * (bbox .max_lat - bbox .min_lat )
485- lon = bbox .min_lon + x / lon_m * (bbox .max_lon - bbox .min_lon )
486- if height_mode == "dem_smooth" :
487- elev = _smooth_elevation (grid , lat , lon )
488- else :
489- elev = grid .elevation_at (lat , lon )
490- return elev + height_offset
491-
492-
493471def _height_at_batch (
494472 xs : np .ndarray ,
495473 ys : np .ndarray ,
@@ -515,18 +493,6 @@ def _height_at_batch(
515493 return grid .elevation_at_batch (lats , lons )
516494
517495
518- def _smooth_elevation (grid : ElevationGrid , lat : float , lon : float ) -> float :
519- """Mean elevation over a 3×3 neighbourhood (1.5× grid spacing)."""
520- dlat = (grid .max_lat - grid .min_lat ) / (grid .rows - 1 ) * 1.5
521- dlon = (grid .max_lon - grid .min_lon ) / (grid .cols - 1 ) * 1.5
522- samples = [
523- grid .elevation_at (lat + r * dlat , lon + c * dlon )
524- for r in (- 1 , 0 , 1 )
525- for c in (- 1 , 0 , 1 )
526- ]
527- return sum (samples ) / len (samples )
528-
529-
530496# ------------------------------------------------------------------
531497# Orientation helpers
532498# ------------------------------------------------------------------
0 commit comments