简体   繁体   English

提供无效的GIS数据给MySQL中的st_geometryfromtext函数

[英]Invalid GIS data provided to function st_geometryfromtext in MySQL

Here is my error: 这是我的错误:

Error Number: 3037 错误号:3037

Invalid GIS data provided to function st_geometryfromtext. 提供给功能st_geometryfromtext的GIS数据无效。

Here is my code: 这是我的代码:

SELECT ST_Within(ST_GEOMFROMTEXT('POINT(12.971201 077.652038)'), 
  ST_GEOMFROMTEXT('POLYGON((13.517837674890684 76.453857421875),(13.838079936422464 77.750244140625),(14.517837674890684 79.453857421875),(13.517837674890684 76.453857421875))')) As geoFenceStatus

Note that if you want to wrap each set of coordinates with their own () like you have done in your query, you need to be using mysql 5.7.9+ the earlier versions do not support it. 请注意,如果要像在查询中一样用自己的()包装每组坐标,则需要使用mysql 5.7.9+,较早的版本不支持。 But that is not all, there is another error. 但这还不是全部,还有另一个错误。 mysql polygons have to be closed mysql多边形必须关闭

SELECT ST_GEOMFROMTEXT('POLYGON((13.517837674890684 76.453857421875,13.838079936422464 77.750244140625,14.517837674890684 79.453857421875,13.517837674890684 76.453857421875,13.517837674890684 76.453857421875))')

And also note that (( and )) is the correct syntax 还要注意(())是正确的语法

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM