title: How to resolve spherical geometry failures when joining spatial data
body: <p>I have a shapefile (with several polygons) and a dataframe with coordinates. I want to assign each coordinate in a dataframe to a polygon in a shapefile. So to add a column in a data frame with a polygon name or id
  Here is the <a href="https://docs.google.com/spreadsheets/d/14xJ_GRC8ogwrTQwqSlaDQvLtj_dnHOTWDihSJejINSQ/edit?usp=sharing" rel="noreferrer">link to the data </a></p>
  <pre><code>library(sf)
  library(readr)
  shape &lt;- read_sf(&quot;data/mesopelagic_regions/GlasgowMesopelagicProvinces_v1_2017.shp&quot;)
  data&lt;- read_csv(&quot;data/data.csv&quot;)
  </code></pre>
  <p>But when I try to join them, I always get the error</p>
  <pre><code>pts = st_as_sf(data, coords = c(&quot;dec_lon&quot;, &quot;dec_lat&quot;), crs= 4326)
  
  st_join(pts, shape)
  </code></pre>
  <p>i tried <code>over()</code> functions, and other tricks like <code>st_make_valid()</code> but I always get this error:
  <code>Error in s2_geography_from_wkb(x, oriented = oriented, check = check) : Evaluation error: Found 30 features with invalid spherical geometry.</code></p>
  <p>It is a recent issue  (before my code worked), but now I am unable to use sf package to do this task, I always end up with this error. I updated the libraries to see whether it would help, but I could not make it work.</p>
  <p>I would really appreciate your help on this matter</p>