1. A set of instructions stored on at least one computer readable medium for running on a computer system, comprising: instructions for identifying line segments of a roof; instructions for determining three-dimensional information of the line segments including position, orientation and length of the line segments; and instructions for classifying, automatically, at least one of the line segments as one of a plurality of predefined roof elements utilizing at least one of the relative position and orientation of the line segments.