Auto-snapping and identification of intersections