Point in polygon calculation using vector geometric methods with application to geospatial data
Eyram Schwinger, Ralph Twum, Thomas Katsekpor, Gladys, Schwinger

TL;DR
This paper presents a new vector geometry-based algorithm for the point in polygon problem, implemented in Python, which outperforms existing solutions like shapely and OpenCV in speed, especially with Numba optimization.
Contribution
The authors developed and tested a novel point in polygon algorithm based on vector geometry, demonstrating superior performance over existing methods.
Findings
Algorithm outperforms shapely in pure Python.
Algorithm outperforms OpenCV with Numba optimization.
Performance scales linearly with number of points, O(n).
Abstract
In this work, we designed algorithms for the point in polygon problem based on the ray casting algorithm using equations from vector geometry. The algorithms were implemented using the python programming language. We tested the algorithm against the point in polygon algorithms used by the shapely (and by extension geopandas) library and the OpenCV library using points from the google Open Buildings project. Our algorithm in pure python performed much better than the shapely implementation. It also performed better than the OpenCV implementation when combined with the Numba optimization library. We also performed simulations to verify that our algorithm performance was of the order O(n).
Peer Reviews
No public reviews on file for this paper yet. If you reviewed it on a platform where reviews are public (OpenReview, ICLR, NeurIPS, ICML), you can paste yours below so the community can read it here.
Videos
No videos yet. Explain this paper in a talk, walkthrough, or lecture? Add one.
Taxonomy
Topics3D Modeling in Geospatial Applications · Computational Geometry and Mesh Generation · Data Management and Algorithms
