在postgis中有效查询定位簇的质心?
我有一个实体 E 的空间分布式集合,在 PostGis 数据库中存储并进行空间索引。
每个实体都有许多索引的非空间属性,例如 TYPE、VALUE 等。
是否有针对以下类型的查询的计算高效的查询模板:
"find the centroid of the circular region with radius X which includes the most E such that (some condition based on attribue values)"
例如
"find the centroid of the circular region with radius 1Km which contains the most E with TYPE == 'PIZZA-RESTAURANT'"
谢谢!
I have a spatially-distributed collection of entities E stored and spatially indexed in a PostGis database.
Each entity has a number of indexed non-spatial attributes, such as TYPE, VALUE etc.
Is there a computationally-efficient query template for the following type of query:
"find the centroid of the circular region with radius X which includes the most E such that (some condition based on attribue values)"
eg
"find the centroid of the circular region with radius 1Km which contains the most E with TYPE == 'PIZZA-RESTAURANT'"
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
要利用空间索引,您可以使用 ST_DWithin。
你的搜索空间是什么?质心可以在太空中的任何地方吗?
To take advantage of the spatial index you could use ST_DWithin.
What is you search space? Can the centroid be anywhere in space?