Winding-based Point-Inclusion Tests for Spherical Polygons
摘要
A winding-orientation algorithm framework with linear temporal complexity is described that determines whether a given point on a sphere is a boundary, interior, or exterior point of a loop-bounded spherical polygon. The interior side of the spherical polygon must be uniquely determinable from its oriented boundary, which is specified as a cyclic array of the Cartesian coordinates of its vertices. The two-step framework, consisting of the winding test and the orientation test, exploits key connections between the point-inclusion tests on the sphere and on the Euclidean plane as well as critical differences between the orthographic projection and the stereographic projection. The winding test converts the original problem into a point-in-polygon problem, correctly ignoring distortion associated with map projections and benefiting from the efficiency of winding-based point-in-polygon algorithms. The correctness and robustness of the framework are verified using carefully designed examples that address representative concerns and applications to real scenarios that match many test points to many spherical polygons. Noting that the rotation-based and shearing-based winding tests are performed without the use of trigonometric functions, inverse trigonometric functions, and cross products and are thus significantly faster than the orientation test, this work finally analyzes subclasses of spherical polygons that completely optimize away the orientation test due to having predetermined outcomes. These subclasses are large enough to cover practical use cases in geographic information systems and numerical modeling. Based on the two-step framework, this work provides a general algorithm for all spherical polygons and a specialized algorithm for spherical polygons with antipode-excluding boundaries.
Graphical abstract