Method for obtaining elevation information of main building body

The invention discloses a method for obtaining elevation information of a main building body. The method comprises the following steps: S1 obtaining an outline range Q0 of an initial building by using digital topographic map data, registering Q0 with DSM data, and obtaining an effective outline range Q1 of the building according to D indentation pixels in various directions of the Q0; S2 calculating a first elevation information set X of all DSM data within the effective outline range Q1 of the building, and calculating an elevation confidence interval [theta1 and theta2] of the main building body; S3 obtaining a second elevation information set X' meeting the confidence interval [theta1 and theta2] in the first elevation information set X of the building, and obtaining a reliable elevation information set X'' according to the geometric position relationship between point coordinates of an elevation value in the second elevation information set X', the effective outline range Q1 of the building and the DSM data range; and S4 calculating the elevation value of the main building body according to the reliable elevation information set X'' of the main building body. The method plays an important role in three-dimensional simulation and construction of digital cities and smart cities.