简体   繁体   English

反转ST_Within查询

[英]Inverting the ST_Within query

I'm using ST_Within, which works fine, but I want to select all points which are not within the convex hull, how do I invert the selection in sql? 我正在使用ST_Within,它工作正常,但是我想选择不在凸包内的所有点,如何在sql中反转选择?

SELECT geom FROM pc_processing.pc_201406151141_top top

WHERE st_within(top.geom, (
SELECT st_convexhull(st_collect(geom)) as geom
FROM pc_processing.pc_201407060711_base))

ST_Within returns a boolean, so you can check that the result is false ST_Within返回一个布尔值,因此您可以检查结果是否为false

SELECT geom FROM pc_processing.pc_201406151141_top top
WHERE st_within(top.geom, 
           (SELECT st_convexhull(st_collect(geom)) as geom
            FROM pc_processing.pc_201407060711_base
            )
      ) = false;

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

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