def density_track_distance(nn, interpolated_track, n_neighbors=30):
    """Compute distance to n'th nearest neighbor"""
    dist, _ = nn.kneighbors(X=interpolated_track, n_neighbors=n_neighbors, return_distance=True)
    return dist[:,-1]