Constructing polygonal maps for navigating agents using extracted line segments