MySQL 5.7.19提供给函数st_geometryfromtext的GIS数据无效 [英] MySQL 5.7.19 Invalid GIS data provided to function st_geometryfromtext

查看:461
本文介绍了MySQL 5.7.19提供给函数st_geometryfromtext的GIS数据无效的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我是MySql中ST_函数的新手,我认为我缺少了一些东西.我正在尝试在MySql中保存POLYGON,问题是当使用函数ST_GEOMFROMTEXT并给出从Google Maps Javascript API获取的POLYGON的坐标时,它返回错误:Invalid GIS data provided to function st_geometryfromtext.

So I am new at ST_ functions in MySql and I think that I am missing something. I am trying to save a POLYGON in MySql, the problem is that when using the function ST_GEOMFROMTEXT and giving the coordinates of the POLYGON taken from Google Maps Javascript API it returns the error: Invalid GIS data provided to function st_geometryfromtext.

我在Internet上读了很多书,但是到处都在说这是一个版本问题,这是我目前拥有最新的(5.7.19)

I've read a lot in Internet but everywhere it mostly says that it's a version problem, the thing here is the I have the most recent one right now (5.7.19)

这些是我尝试过的以下查询

These are the following queries I've tried

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

# ALL BELLOW RETURN ERROR
SELECT ST_GEOMFROMTEXT('POLYGON((19.4254572621497 -99.17182445526123, 19.42574056861496 -99.16570901870728, 19.421551629818985 -99.16558027267456, 19.421288552764135 -99.17210340499878))');
SELECT ST_GEOMFROMTEXT('POLYGON((-99.17182445526123 19.4254572621497, -99.16570901870728 19.42574056861496, -99.16558027267456 19.421551629818985, -99.17210340499878 19.421288552764135 ))');
SELECT ST_GEOMFROMTEXT('POLYGON((19.4249108840002 -99.17023658752441, 19.424951356518726 -99.16802644729614, 19.423393157277722 -99.16796207427979, 19.423393157277722 -99.17019367218018))')

有人知道为什么以上这些查询失败吗?非常感谢大家

Does anyone knows why these queries above are failing? Thank you a lot everyone

推荐答案

请尝试以下查询-

SELECT ST_GEOMFROMTEXT('POLYGON((19.4254572621497 -99.17182445526123, 19.42574056861496 -99.16570901870728, 19.421551629818985 -99.16558027267456, 19.421288552764135 -99.17210340499878, 19.4254572621497 -99.17182445526123))');
SELECT ST_GEOMFROMTEXT('POLYGON((-99.17182445526123 19.4254572621497, -99.16570901870728 19.42574056861496, -99.16558027267456 19.421551629818985, -99.17210340499878 19.421288552764135, -99.17182445526123 19.4254572621497 ))');
SELECT ST_GEOMFROMTEXT('POLYGON((19.4249108840002 -99.17023658752441, 19.424951356518726 -99.16802644729614, 19.423393157277722 -99.16796207427979, 19.423393157277722 -99.17019367218018, 19.4249108840002 -99.17023658752441))')

这篇关于MySQL 5.7.19提供给函数st_geometryfromtext的GIS数据无效的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆