Function h3ron::iter::neighbors_within_distance_window_or_default
source · pub fn neighbors_within_distance_window_or_default<'a, I, F, T>(
cell_iter: I,
get_cell_value_fn: F,
k_min: u32,
k_max: u32,
neighbor_default_value: Option<&'a T>
) -> Result<CellNeighborsIterator<'a, I, F, T>, Error>
Expand description
Returns an iterator to visit all neighbors of the cells of cell_iter
by accessing the values
using the get_cell_value_fn
function. Neighbors of cells which do not have a
value returned by that function will not be visited.
The neighbor_default_value
will be returned for neighbor cells which are not found by
get_cell_value_fn
. In case neighbor_default_value
is None
, that neighbor will be skipped.
k_min
and k_max
control the radius in which the neighbors will be iterated. Also
see H3Cell::grid_disk
.
This implementation trys to avoid memory allocations during iteration.