An almost linear-time algorithm for trapezoidation of GIS polygons

  • Authors:
  • Gian Paolo Lorenzetto;Amitava Datta

  • Affiliations:
  • School of Computer Science and Software Engineering, The University of Western Australia, Perth, WA 6009, Australia;School of Computer Science and Software Engineering, The University of Western Australia, Perth, WA 6009, Australia

  • Venue:
  • Future Generation Computer Systems - Special issue: Geocomputation
  • Year:
  • 2004

Quantified Score

Hi-index 0.00

Visualization

Abstract

The decomposition of planar polygons into triangles is a well studied area of computer graphics with particular relevance to geographic information systems (GIS). Trapezoidation is often performed as a first step to triangulation. There is a complex linear-time algorithm [Discrete Comput. Geom. 6 (1991) 485] for the decomposition of a simple polygon into triangles. However, it is extremely complicated and in practice O(n log n) algorithms are used. Our motivation in trapezoidation of large GIS polygons is the fast display of such polygons. It is much faster to display simple shapes like triangles or trapezoids on raster graphics devices, compared to complex polygons. Hence, quite often complex polygons are decomposed into triangles or trapezoids for displaying. Since triangulation is usually more difficult compared to trapezoidation, we are interested in trapezoidation of GIS polygons for faster display. We present a very simple algorithm for the trapezoidation of simple polygons without holes. Our algorithm runs in O(n) time in practice with a very small hidden constant. We have extensively tested our algorithm for polygons in a GIS database. Our algorithm is easy to implement compared to existing algorithms and runs extremely fast even for polygons with thousands of vertices.