雅典娜中的st_contains [英] st_contains in athena

查看:123
本文介绍了雅典娜中的st_contains的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

以下代码应返回true,但返回false.我在谷歌地图上测试过,点位于多边形中.我不确定这里是什么问题.我在雅典娜上运行这段代码

the below code should return true but returns false. I tested in google maps and point lies in the polygon. I am not sure what is the issue here. I am running this code in Athena

select 
st_contains (st_polygon( 'POLYGON((54.8163815 24.9474831),
(54.9310513 24.8914383),
(55.0514856 24.8349286),
(55.1170345 24.9527804),
(55.1686306 25.0937019),
(55.3738202 25.1844963),
(55.3676957 25.3050482),
(55.2592057 25.3944044),
(54.8163815 24.9474831))'),st_point(55.163485,25.092776))  

推荐答案

以下是我从雅典娜团队获得的回复:

Here is the response I obtained from the Athena team:

根本原因是用于创建多边形的字符串格式为错误的格式.如果您运行此查询:

The root cause is the string to create the polygon is in wrong format. If you run this query:

select st_geometry_to_text(st_polygon('POLYGON((54.8163815 24.9474831),
(54.9310513 24.8914383),
(55.0514856 24.8349286),
(55.1170345 24.9527804),
(55.1686306 25.0937019),
(55.3738202 25.1844963),
(55.3676957 25.3050482),
(55.2592057 25.3944044),
(54.8163815 24.9474831))'));

然后错误消息指出:corrupted geometry

根据知名文本(WKT)应为:

select st_contains('POLYGON(
(54.8163815 24.9474831,
54.9310513 24.8914383,
55.0514856 24.8349286,
55.1170345 24.9527804,
55.1686306 25.0937019,
55.3738202 25.1844963,
55.3676957 25.3050482,
55.2592057 25.3944044,
54.8163815 24.9474831))',
st_point(55.163485,25.092776));

,它将返回true.

这篇关于雅典娜中的st_contains的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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