Update source_to_target_distances()

    Compute the Euclidean distance from each source point to
    its nearest target point, optionally within each segment.