MySQL5.6中查询多边形包含点情况(ST_Contains、ST_Within)

SET @x = 121;
SET @y = 30;  
-- SET @point = CONCAT('POINT(',@x,' ',@y,')'); 
set @point= Point(@x,@y);
set @geometry=ST_GeomFromText('POLYGON((121 30, 121 30, ..., 121 30, 121 30))');
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

posted @ 2020-04-20 14:54  TTonlyV5  阅读(4097)  评论(0)    收藏  举报