MySQL5.6中查询多边形包含点情况(ST_ContainsST_Within)
Posted TTonlyV5
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了MySQL5.6中查询多边形包含点情况(ST_ContainsST_Within)相关的知识,希望对你有一定的参考价值。
SET @x = 121;
SET @y = 30;
-- SET @point = CONCAT(‘POINT(‘,@x,‘ ‘,@y,‘)‘);
set @point= Point(@x,@y);
set @geometry=ST_GeomFromText(‘POLYGON((121.044 30.594, 121.046 30.59, ..., 121.046 30.5948, 121.044 30.594))‘);
SELECT ST_Contains(@geometry,@point);//面包含点
SELECT ST_Within(@point, @geometry);//点在面
https://blog.csdn.net/zshtiger2414/article/details/77975958
https://dev.mysql.com/doc/refman/5.6/en/spatial-relation-functions-object-shapes.html#function_st-overlaps
以上是关于MySQL5.6中查询多边形包含点情况(ST_ContainsST_Within)的主要内容,如果未能解决你的问题,请参考以下文章