Skip to content

Commit f801c5e

Browse files
authored
Fixes #878: extend KDTree path to allocation/direction to prevent OOM (#893)
The memory-safe KDTree path was previously gated to PROXIMITY mode only. This extends it to handle ALLOCATION and DIRECTION modes, since cKDTree.query() returns both distances and nearest-target indices — enough to derive allocation values and direction angles. Changes: - Add _vectorized_calc_direction() for array-based compass directions - Extend _stream_target_counts() to cache target pixel values - Extend _collect_region_targets() to return target values alongside coords - Extend _kdtree_chunk_fn() and _tiled_chunk_query() for all three modes - Thread process_mode and values_cache through the full call chain - Remove process_mode == PROXIMITY restriction from KDTree gate - Add memory guard for non-KDTree fallback (GREAT_CIRCLE, no scipy) - Update memory estimate from 48 to 52 bytes per target
1 parent 5b9c830 commit f801c5e

File tree

2 files changed

+411
-65
lines changed

2 files changed

+411
-65
lines changed

0 commit comments

Comments
 (0)