测绘学报

• 学术论文 • 上一篇    下一篇

一种基于梯形剖分的多边形布尔运算方法

崔璨1,王结臣   

  • 收稿日期:2009-09-25 修回日期:2010-08-06 出版日期:2011-02-25 发布日期:2011-02-25
  • 通讯作者: 崔璨

Boolean Operations on Polygons by Using Trapezoidal Decomposition

  • Received:2009-09-25 Revised:2010-08-06 Online:2011-02-25 Published:2011-02-25

摘要: 平面多边形的布尔运算在GIS中有较广泛的应用,本文借鉴计算几何学的理论方法,提出一种基于多边形梯形剖分思想的实现方法。由于梯形等相对简单、规则的形状比不规则多边形易于处理,在计算机图形学等领域将多边形划分为梯形集合的方法已经有了较多的研究,然而其在GIS中的应用较为鲜见。本文创新性地将梯形剖分应用于GIS布尔运算的实现。该方法首先利用扫描线技术将多边形分解为梯形面片集,以便将多边形的布尔运算转化为梯形面片间的布尔运算;这些梯形面片以扫描行为单元进行组织,梯形之间的布尔运算被限定在相同的扫描行内,这可有效简化核心计算过程;在完成梯形单元布尔运算并得到结果梯形集后,通过边界追踪完成多边形重构。该方法可规避多数矢量算法中多边形各边之间复杂的空间关系判断,实现过程相对简单,具有较高的计算效率且易于理解。同时,借助简单的多属性条件提取,即可方便、统一地实现GIS中的Union、Erase、Clip、Intersect等多种类型的空间操作,具有较好的拓展性。

Abstract: Boolean operations on planar polygons, including “Union”, ”Erase”, “Identity”, “Intersect”, etc., are fundemental operations in GIS to extract new information which may contribute to resolve geological application problems. In this paper, a new algorithm for Boolean operations is presented, which incorporates trapezoidal decomposition. The decomposition of polygons into trapezoids has been studied in the area of computer graphics. It is comparatively easier to process a simple shape like a trapezoid than a polygon. However, so far it has seldom been used into GIS applications. In the proposed method, the involved polygons are decomposed into two sets of trapezoids by the sweep-line, therefore Boolean operations on polygons are transformed into the Boolean operations on the decomposed trapezoids. Since these trapezoids are organized and stored by row, thus the Boolean operations between them are confined within one row; in consequence, the computation efficiency could be improved effectively. Once the resulting set of trapezoids is obtained by implementing Boolean operations on the two original sets of trapezoids, the resulting polygons need to be constructed by means of boundary tracing. The proposed method avoids the complex computation of spatial relationship between polygons’ edges in most vector algorithms for Boolean operation, thus making the whole procedures more efficient and understandable. In addition, by adopting multi-attribute condition extraction, this method could realize various Boolean operations in a unified way, without the necessity of designing respective methods targeting at each operation.