1

我有两张桌子。首先是点,其次是多边形。我需要根据属性 gid 找出所需多边形中的哪些点。

使用查询: SELECT table1.* FROM table1, table2 WHERE table2.gid=1 AND ST_Contains(table2.geom2, table1.geom1);

我得到的是空表(只有没有数据的列)......

肿瘤坏死因子

4

1 回答 1

1

Are you sure there are any intersecting points? Try

 SELECT COUNT(*) FROM table2 WHERE table2.gid=1 

It should return 1.

Another thing you could try is using ST_Intersects instead of ST_Contains.

Otherwise, you might need to post some data dumps of data you think should match.

于 2010-06-04T09:02:08.320 回答