title: Check if geo-point is inside or outside of polygon
body: <p>I am using python and I have defined the latitudes and longitudes (in degrees) of a polygon on the map.
  My goal is to check if a generic point <code>P</code> of coordinates <code>x,y</code> falls within such polygon. I would like therefore to have a function that allows me to check such condition and return <code>True</code> or <code>False</code> if the point is inside or outside the polygon.</p>
  
  <p><a href="https://i.stack.imgur.com/4mjz7.png" rel="noreferrer"><img src="https://i.stack.imgur.com/4mjz7.png" alt="enter image description here"></a></p>
  
  <p>In this example the point is outside so the result would be <code>False</code></p>
  
  <p><strong>Question</strong>: Is there a library/package that allows to reach my goal? if yes which one do you recommend? would you be able to give a small example on how to use it?</p>
  
  <p>Here is the code I have written so far:</p>
  
  <pre><code>import numpy as np
  
  # Define vertices of polygon (lat/lon)
  v0 = [7.5, -2.5] 
  v1 = [2, 3.5]
  v2 = [-2, 4]
  v3 = [-5.5, -4]
  v4 = [0, -10]
  lats_vect = np.array([v0[0],v1[0],v2[0],v3[0],v4[0]])
  lons_vect = np.array([v0[1],v1[1],v2[1],v3[1],v4[1]])
  
  # Point of interest P
  x, y = -6, 5 # x = Lat, y = Lon
  
  ## START MODIFYING FROM HERE; DO NOT MODIFY POLYGON VERTICES AND DATA TYPE
  # Check if point of interest falls within polygon boundaries
  # If yes, return True
  # If no, return False
  </code></pre>
  
  <p>In order to plot the polygon and the point of interest I used cartopy and I wrote the following lines of code:</p>
  
  <pre><code>import cartopy.crs as ccrs
  import matplotlib.pyplot as plt
  ax = plt.axes(projection=ccrs.PlateCarree())
  ax.stock_img() 
  
  # Append first vertex to end of vector to close polygon when plotting
  lats_vect = np.append(lats_vect, lats_vect[0])
  lons_vect = np.append(lons_vect, lons_vect[0])
  plt.plot([lons_vect[0:-1], lons_vect[1:]], [lats_vect[0:-1], lats_vect[1:]],
           color='black', linewidth=1, 
           transform=ccrs.Geodetic(),
           )   
  
  plt.plot(y, x, 
          '*',          # marker shape
          color='blue',  # marker colour
          markersize=8  # marker size
          )  
  
  plt.show()  
  </code></pre>
  
  <p><strong>Note</strong>: </p>
  
  <ul>
  <li>points are connected to each other by Great Circles!</li>
  <li>I have researched in the internt and I ended up finding some similar questions <a href="https://gis.stackexchange.com/questions/208546/check-if-a-point-falls-within-a-multipolygon-with-python">like this one</a> but I had no success since they all use of <code>.shp</code> files which I do not have.</li>
  </ul>