sql - 在 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
这并不是我真正想要的。
解决方案
您可以只引用该表两次:
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'
推荐阅读
- mongodb - 在 docker 容器中恢复 mongo 转储返回“失败:EOF”
- python - 如果满足条件,则在数据框中返回索引(日期)和列标题的方法
- discord.js - 在 nodejs [discord.js] 中从 args 运行 python
- arrays - 如何将 2 组数据合并到一个 UITableview 中
- c# - 我可以将泛型类与泛型方法一起使用吗?
- excel - 将 XLSM 文件导出为 PDF 而不切断的宏
- c# - textchanged 的应用程序页面文本框事件
- python - 如何按标点符号拆分 CSV 内容
- r - 使用嵌套信息在 R 中抓取 PDF
- java - 一些关键字在 VS Code for JAVA 中有下划线