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?
精彩评论