2

How can I find if a point lays inside a polygon on a sphere using python?

I know that unlike a planar polygon, a spherical polygon doesn't have a natural "inside" because both the inside and the outside have finite areas. So most codes ask that the user also define a point inside the polygon. I would like to find a way to do this without asking my users for a point inside the polygon.

Thanks

Shek
  • 21
  • 2
  • Related: [How do I check if a longitude/latitude point is within a range of coordinates?](https://stackoverflow.com/q/11510326/953482). The answer is in C#(?) but doesn't use any fancy techniques specific to the language. Doesn't really touch on determining which region is the "inside", however. – Kevin Feb 09 '18 at 16:15
  • [Calculating area enclosed by arbitrary polygon on Earth's surface](https://stackoverflow.com/q/1340223/953482) might be useful for determining which of the two regions is the smaller one. – Kevin Feb 09 '18 at 16:18
  • There is a python package which does exactly that- [pySphericalPolygon](https://github.com/omrivolk/pySphericalPolygon). I don't think this is a duplicate. OP did not ask for a way to calculate area, just suggested it is a way to achieve a goal. – OMRY VOLK Feb 09 '18 at 19:09

0 Answers0