Skip to main content

Module grid

Module grid 

Source
Expand description

Sample a bounding box into an elevation grid — the Rust twin of SRTM.py’s get_image(..., mode='array') as used by ridge_map.

Functions§

sample
Sample num_lines x elevation_pts elevations over bbox.
sample_disc
Sample a square, disc-masked region: n x n points over a square of side span_deg centered at (center_lat, center_lon), with samples outside the inscribed circle (radius span_deg / 2) set to NaN.
sample_window
Sample an ANISOTROPIC display window from a preprocessed square data grid. The window covers lat0..lat1 x lon0..lon1 at num_lines x elevation_pts samples (cells of (lat1-lat0)/num_lines x (lon1-lon0)/elevation_pts degrees), reading the data grid at nearest nodes; positions outside the data grid become NaN.
swap_for_angle
Upstream get_elevation_data swaps the sampling resolution when the viewpoint angle is within the (45..135 | 225..315) degree bands.