postgresql中ST_Intersects用法

ST_Intersects(A,B)经过验证发现,该函数所检索出的对象不仅包括A与B相交,而且包含A存在于B中的情况。因此也可以将其结合ST_Buffer()进行缓冲区内对象检测。

先通过ST_Buffer()函数生成缓冲区对象如存储到onegradebuffe字段中,然后再利用ST_Intersects()函数在表中搜索geom字段表示的对象与onegradebuffe字段表示的缓冲区对象相交的多有对象,即是检索出的缓冲区对象,如:

select objectid from poly where ST_Intersects(ST_Transform(geom,3857),ST_Transform((select onegradebuffer from polytest where objectid=20589),3857))=true

其他缓冲区内对象检测方法可以参考之前的文章。

转载自:https://blog.csdn.net/xianyucishi/article/details/73441115

You may also like...