Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个带有多边形的 postgis 空间表,有一个 id ( gid) 和一个名为的几何列way(它实际上存储了多边形边界)。表头如下所示:
gid
way
|| gid (integer) | way (geometry) ||
此表中的每一列都代表一个多边形。现在我想从这个表中取出两个特定的多边形(通过 gid 选择它们)并ST_Contains()用来测试一个是否被另一个包含。
ST_Contains()
什么是 SQL 语法?
尝试以下操作:
SELECT st_contains(a.way, b.way) FROM yourtable AS a, yourtable AS b WHERE a.gid = yourfirstid AND b.gid = yoursecondid
这就是你想知道的,还是我误解了这个问题?