首页 > 解决方案 > 在 SQLite 中使用相同的表组合 ST_CONTAINS 和 ST_BUFFER

问题描述

我希望从同一张表中的其他点中选择创建的缓冲区中的一些点。我想要这样的东西:

Select a.geom , a.type
from a
where st_contains( (st_buffer( (a.geom where a.type = 'b'), 50), (a.geom where a.type = 'c))

我不知道如何解决这个问题,而且我似乎没有找到不包括为 ex 创建新表的合理解决方案。

 a.geom where a.type = 'b 

这并不是我真正想要的。

标签: sqlsqlitegeopackage

解决方案


您可以只引用该表两次:

Select distinct c.geom , c.type
from a b,a c
where st_contains( (st_buffer( b.geom, 50), c.geom) = 1
and b.type = 'b'
and c.type = 'c'

推荐阅读