Detection of intersections and turns