MySQL: Invalid GIS data provided to function st_geometryfromtext

余生颓废 提交于 2019-12-01 09:41:43

You need to specify the first and last point as same.

Try this.

SET @poly =
    'Polygon((-98.07697478272888 30.123832577126326,
              -98.07697478272888 30.535734310413392,
              -97.48302581787107 30.535734310413392,
              -97.48302581787107 30.123832577126326,
              -98.07697478272888 30.123832577126326,))';

SELECT name
FROM county_shapes
WHERE MBRContains(ST_GeomFromText(@poly), SHAPE);

AND

SELECT name
FROM county_shapes
WHERE MBRContains(ST_GeomFromText('Polygon((
              -98.07697478272888 30.123832577126326,
              -98.07697478272888 30.535734310413392,
              -97.48302581787107 30.535734310413392,
              -97.48302581787107 30.123832577126326,
              -98.07697478272888 30.123832577126326))'), SHAPE);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!