1. A method for automatically extracting a 3D terrain model for identifying at least buildings and terrain from light detection and ranging (LIDAR) data, comprising the steps of: generating a point cloud representing terrain and buildings mapped by LIDAR; classifying points in the point cloud, the point cloud having ground and non-ground points, the non-ground points representing buildings and clutter; segmenting the non-ground points into buildings and clutter; calculating a fit between at least one building segment and at least one rectilinear structure by rotating the at least one building segment incrementally, wherein the calculating is performed repeatedly until the fit yields the rectilinear structure with the fewest number of vertices.