Tim Alder wrote:
Clustering seem difficult (http://docs.scipy.org/doc/scipy/reference/cluster.hierarchy.html#references) and I found no PostGIS function for it. So it seem necessary to work with random and a limit.
After a bit of research and thinking I'm now able to cluster POIs together using Postgres. This will save server CPU and bandwidth as it's no longer needed to transfer all features to the client. Even worse for POIs that are in numbers of 10k or more it would be simply too much for a client to do the clustering in Javascript. Openlayers recommends not more than 2.500 [1]
I think this mechanism could be used for other Vector layers as well. Maybe visualize the amenity=post_box? In germany there is a law requiring a post_box in maximum 1000 meter distance to houses.
An open issue is that I need some way to tell the server the current zoom level of the map. In case someone knows a way to do so in Openlayers it would be great.
Stephan
[1] http://trac.openlayers.org/wiki/FrequentlyAskedQuestions#Whatisthemaximumnum...