def point_in_lane()

in spark_scripts/detect_scenes.py [0:0]


def point_in_lane(x, y, closest_points):
    is_in_lane = False
    lane = None
    for lane_idx, closest_point in closest_points.items():
        # if last_lane, then end
        if lane_idx == len(closest_points) - 1:
            continue
        next_lane_closest_point = closest_points[lane_idx + 1]
        # TODO consider y coordinates as well
        if between_nums(x, next_lane_closest_point['x'], closest_point['x']):
            is_in_lane = True
            lane = f"between_{lane_idx}_and_{lane_idx + 1}"
            break
    return is_in_lane, lane