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


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM