A cell-based point-in-polygon algorithm suitable for large sets of points

被引:45
作者
Zalik, B [1 ]
Kolingerova, I [1 ]
机构
[1] Univ Maribor, Fac Elect Engn & Comp Sci, Dept Comp Sci, SLO-2000 Maribor, Slovenia
关键词
computational geometry; GIS; point-in-polygon; uniform subdivision; polygon;
D O I
10.1016/S0098-3004(01)00037-1
中图分类号
TP39 [计算机的应用];
学科分类号
081203 ; 0835 ;
摘要
The paper describes a new algorithm for solving the point-in-polygon problem. It is especially suitable when it is necessary to check whether many points are placed inside or outside a polygon. The algorithm works in two steps. First, a grid of cells equal in size is generated, and the polygon is laid on that grid. A heuristic approach is proposed for cell dimensioning. The cells of the grid are marked as being inside, outside, or on the polygon border. A modified flood-fill algorithm is applied for cell classification. In the second step. points are tested individually. If the tested point falls into an inner or an outer cell, the result is returned without any additional calculations. If the cell contains the polygon border, it is possible to determine the local point position. The analysis of tithe complexity shows that the initialization is finished in O(n rootn) time, while the expected time complexity for checking an individual point is O(rootn), where n represents the number of polygon edges. The algorithm works with O(n) space complexity. The paper also gives practical results using artificial and real polygons from a GIS environment. (C) 2001 Elsevier Science Ltd. All rights reserved.
引用
收藏
页码:1135 / 1145
页数:11
相关论文
共 27 条
[1]  
[Anonymous], 1994, COMPUTATIONAL GEOMET
[2]  
[Anonymous], 1989, The Design and Analysis of Spatial Data Structures
[3]   ALGORITHM FOR COMPUTER CONTROL OF A DIGITAL PLOTTER [J].
BRESENHAM, JE .
IBM SYSTEMS JOURNAL, 1965, 4 (01) :25-30
[4]  
BROBST S, 1999, ORACLE MAGAZINE, V13, P123
[5]  
CHEN M, 1987, P EUR 87, P423
[6]  
Cleary J. G., 1988, Visual Computer, V4, P65, DOI 10.1007/BF01905559
[7]   DELAUNAY TRIANGULATION USING A UNIFORM GRID [J].
FANG, TP ;
PIEGL, LA .
IEEE COMPUTER GRAPHICS AND APPLICATIONS, 1993, 13 (03) :36-47
[8]   ORIENTATION, SIMPLICITY, AND INCLUSION TEST FOR PLANAR POLYGONS [J].
FEITO, F ;
TORRES, JC ;
URENA, A .
COMPUTERS & GRAPHICS, 1995, 19 (04) :595-600
[9]  
Foley J. D., 1990, Computer Graphics, Principles and Practice, V2nd
[10]  
Fujita D, 1986, MAR FOULING, V6, P1