title: What is wrong in this Polygon in MYSQL 5.7.19?
body: <p>So, I am trying to save a POLYGON in MYSQL using Geospatial functions... I found several examples online like the following:</p>
  
  <pre><code>SELECT ST_GEOMFROMTEXT('POLYGON((
  13.517837674890684 76.453857421875,
  13.838079936422464 77.750244140625,
  14.517837674890684 79.453857421875,
  13.517837674890684 76.453857421875,
  13.517837674890684 76.453857421875
  ))');
  
  SELECT  ST_GeomFromText('Polygon((
  -98.07697478272888 30.123832577126326,
  -98.07697478272888 30.535734310413392,
  -97.48302581787107 30.535734310413392,
  -97.48302581787107 30.123832577126326,
  -98.07697478272888 30.123832577126326
  ))')
  </code></pre>
  
  <p>The problem is when I tried to make my own, it returns the following error:
  Error Code: 3037. Invalid GIS data provided to function st_geometryfromtext.</p>
  
  <p>This is the code I used...</p>
  
  <pre><code>SELECT ST_GEOMFROMTEXT('Polygon((
  -99.16939973831177 19.42468828496807,
  -99.16710376739502 19.424607339789876,
  -99.16712522506714 19.422907481732416,
  -99.168541431427 19.421996836172347,
  -99.16989326477051 19.422947954749972
  ))');
  </code></pre>
  
  <p>These are all longitude-latitude pairs, I think it has to do something with the order but the current order is already consecutive.</p>
  
  <p>Can somebody give me a hint, please?</p>
  
  <p>Thank you</p>
  
  <p>EDIT: As they mention in the comments section, by definition a Polygon must be closed.</p>
  
  <p>I am using Google Maps Javascript API v3 to draw a Polygon and then using the "overlaycomplete" event listener which fires a function when the Polygon closes. The function that fires basically print the coordinates given by the API.</p>
  
  <p>If a Polygon must close exactly, why is the API not giving the exact coordinates? Is there a work around?</p>