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

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

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

SELECT  *
FROM    areas
WHERE   MBRContains(LineFromText(CONCAT(
    '('
    , 72.836898 + 10 / ( 111.1 / cos(RADIANS(72.836898)))
    , ' '
    , 18.935255 + 10 / 111.1
    , ','
    , 72.836898 - 10 / ( 111.1 / cos(RADIANS(18.935255)))
    , ' '
    , 18.935255 - 10 / 111.1 
    , ')' ))
    ,position);

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

qxgroojn

qxgroojn1#

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

SELECT  *
FROM    areas
WHERE   MBRContains
        (
        LineString
                (
                Point (
                        18.935255 + 10 / ( 111.320 / COS(RADIANS(72.836898))),
                        72.836898 + 10 / 111.133
                ),
                Point (
                        18.935255 - 10 / ( 111.320 / COS(RADIANS(72.836898))),
                        72.836898 - 10 / 111.133
                ) 
        ),
    ,position);

相关问题