Although determining the type of building can be useful for 3D reconstruction, image retrieval, and other applications, it is often difficult to do so automatically. A building classification algorithm using a geographic information system (GIS) is proposed in this paper. The typical adjustment of building polygon, local convex-concave simplification of large-area polygon contour, and local exaggeration of competing polygon groups merging in small-area polygon is the main topics of this paper. The preliminary outline area is obtained by analyzing the corner characteristics of two basic types of buildings in urban buildings using a large-scale morphological screen. The classification statistics of all kinds of corners are carried out using the improved Hough transform and the proposed line segment and corner optimization algorithm, and the automatic classification of flat-roofed and nonflat-roofed buildings photographed by digital cameras is realized. The experimental results show that the algorithm simplifies the polygons in a reasonable way while maintaining the block shape. Furthermore, the optimization algorithm proposed in this paper effectively eliminates the influence of false contours, allowing for high-accuracy building type judgment.