简体   繁体   English

在postgis中搜索多边形内的点

[英]search for points within a polygon, postgis

I'm trying to find a coordinate in a polygon coordinate, but can not get it to work. 我正在尝试在多边形坐标中找到坐标,但无法使其工作。 How should I? 我该怎么办?

Points coordinate in table "location" column "latlon": 表“位置”栏“latlon”中的点坐标:

A: 60.2653608 -3.6923519 答:60.2653608 -3.6923519

B: 60.241668 -3.652401 B:60.241668 -3.652401

SELECT latlon, st_contains(latlon, ST_GeomFromText('MULTIPOLYGON(((60.237949  -3.654019,
60.240247 -3.661016,
60.243500 -3.658463,
60.240127 -3.642761,
60.240127 -3.642761)))', 4326))  FROM location

The documentation says: 文件说:

boolean ST_Contains(geometry geomA, geometry geomB); boolean ST_Contains(geometry geomA,geometry geomB);

St_Contains Returns TRUE if geometry B is completely inside geometry A St_Contains如果几何体B完全位于几何体A内,则返回TRUE

Also, you must reverse the order of the arguments: FIRST the polygon, THEN the point 此外,您必须颠倒参数的顺序:首先是多边形,然后是点

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM