The point in spherical polygon problem addresses the task of classifying an arbitrary query point as inside, outside, or on the boundary of a polygon drawn using great circle segments on the spherical surface. Point in spherical polygon has numerous applications in the geosciences and remote-sensing, where the problem of sorting point position data onto geographic regions on the surface of the earth or sensor field-of-view often arises. By resorting to a direct solution on the spherical surface, distortions arising from projection can be avoided. We examine the problem, with and without preprocessing, where preprocessing is a step applied when a large number of classifications are evaluated against the same spherical polygon. Several improvements are introduced to the existing point in spherical polygon algorithm (which does not include preprocessing), resulting in significantly faster inclusion queries and better handling of edge cases. Furthermore, we introduce a preprocessing algorithm by means of recursive, nonuniform spatial subdivision of longitudinal regions (“lunes”) on the sphere. With an O(nlogn) preprocessing step and O(n) space requirement, the algorithm decreases query time from O(n) to O(logn) for most “realistic” polygons found in geoscience and remote sensing applications. Several empirical tests demonstrate that the algorithm performs to theoretical expectations.
Read full abstract