为包含linefromtext中的函数st\u geometryfromtext提供的gis数据无效

qgzx9mmu  于 2021-06-24  发布在  Mysql
关注(0)|答案(1)|浏览(508)

我们有一个areas表,其列名为'position',存储该区域的经度和纬度。这里的“position”列是“point”类型。
我阅读了此处的说明并遵循了相同的说明,但在以下查询中出现错误:

  1. SELECT *
  2. FROM areas
  3. WHERE MBRContains(LineFromText(CONCAT(
  4. '('
  5. , 72.836898 + 10 / ( 111.1 / cos(RADIANS(72.836898)))
  6. , ' '
  7. , 18.935255 + 10 / 111.1
  8. , ','
  9. , 72.836898 - 10 / ( 111.1 / cos(RADIANS(18.935255)))
  10. , ' '
  11. , 18.935255 - 10 / 111.1
  12. , ')' ))
  13. ,position);

我得到错误代码:3037。为函数st\ U geometryfromtext提供的gis数据无效。

qxgroojn

qxgroojn1#

对于mysql版本,您需要使用以下命令:

  1. SELECT *
  2. FROM areas
  3. WHERE MBRContains
  4. (
  5. LineString
  6. (
  7. Point (
  8. 18.935255 + 10 / ( 111.320 / COS(RADIANS(72.836898))),
  9. 72.836898 + 10 / 111.133
  10. ),
  11. Point (
  12. 18.935255 - 10 / ( 111.320 / COS(RADIANS(72.836898))),
  13. 72.836898 - 10 / 111.133
  14. )
  15. ),
  16. ,position);
展开查看全部

相关问题