pub fn spatial_join_points(
left_points: &[Point],
right_points: &[Point],
options: &SpatialJoinOptions,
) -> Result<SpatialJoinResult>Expand description
Perform spatial join between two point sets
§Arguments
left_points- First set of pointsright_points- Second set of pointsoptions- Spatial join options
§Returns
Join result with matching pairs
§Examples
use oxigdal_algorithms::vector::spatial_join::{spatial_join_points, SpatialJoinOptions, SpatialJoinPredicate};
use oxigdal_algorithms::Point;
let left = vec![
Point::new(0.0, 0.0),
Point::new(1.0, 1.0),
];
let right = vec![
Point::new(0.1, 0.1),
Point::new(10.0, 10.0),
];
let options = SpatialJoinOptions {
predicate: SpatialJoinPredicate::WithinDistance,
distance: 0.5,
use_index: true,
};
let result = spatial_join_points(&left, &right, &options)?;
assert!(result.num_matches >= 1);