开发者

Efficient query to locate centroid of clusters in postgis?

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 cent开发者_开发知识库roid 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!


To take advantage of the spatial index you could use ST_DWithin. What is you search space? Can the centroid be anywhere in space?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜