Acta Geodaetica et Cartographica Sinica ›› 2015, Vol. 44 ›› Issue (3): 338-345.doi: 10.11947/j.AGCS.2015.20140017

Previous Articles     Next Articles

RaPC:A Rasterization-based Polygon Clipping Algorithm and Its Error Analysis

FAN Junfu1,2, KONG Weihua1, MA Ting2, ZHOU Chenghu2, JI Min3, ZHOU Yuke2   

  1. 1. School of Civil and Architectural Engineering, Shandong University of Technology, Zibo 255049, China;
    2. State Key Laboratory of Resources and Environmental Information System, Institute of Geographic and Nature Resources Research, Chinese Academy of Sciences, Beijing 100101, China;
    3. College of Geomatics, Shandong University of Science and Technology, Qingdao 266590, China
  • Received:2014-01-10 Revised:2014-10-11 Online:2015-03-20 Published:2015-04-01
  • Supported by:
    The National Natural Science Foundation of China (No.41471330);The National Key Technology Research and Development Program of the Ministry of Science and Technology of China (No.2012BAH27B04);Key Research Program of the Chinese Academy of Sciences (No.KZZD-EW-07);Shandong Provincial Natural Science Foundation, China (No.ZR2012DL06);Doctoral Research Foundation of Shandong University of Technology (No.4041-414039)

Abstract: Computational efficiencies of traditional vector computing-based polygon clipping algorithms will decrease rapidly when handling polygons contain large amount of vertices. The computing flows of traditional polygon clipping algorithms are tightly coupled with special data structures, which difficult to be optimized in the underlying of them. Under the premise of meeting a certain degree of area errors, the polygon clipping problem can be solved by introducing the idea of rasterization processing. In this research, we proposed a new rasterization processing-based polygon clipping algorithm: the RaPC algorithm, on the basis of analyzing the characteristics of existing algorithms. The area errors of results of the new algorithm are also analyzed and discussed. Experimental results show that the efficiencies of the RaPC algorithm can be enhanced significantly when using large grid cells, and it shows a linear trend growth with the increase of amount of polygon vertices. Compared with the Vatti algorithm, the RaPC algorithm represents more efficiencies on dealing clipping issues between polygons with large amount of vertices, the former shows lower time costs when handling polygons with less vertices. The area error of computing results of the RaPC algorithm is closely related with the grid size, and errors can be reduced using smaller grid sizes. Therefore the RaPC algorithm showed higher efficiencies on processing polygons with large amount of vertices than the Vatti algorithm and presented practical values to some degree.

Key words: rasterization, polygon clipping, point in polygon, winding and tracing, area error

CLC Number: