Take the 2-minute tour ×
Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. It's 100% free, no registration required.

I need to make a webapp that will show over 40K Points on a map. These points are all across the globe. Using WFS Service and OpenLayers, it is possible to do clustering on small set of points, but it is not really useful to do this clustering on the client side for my case.

How can I do server side clustering, in a WMS or tiled WMS service? There are several such options for Google maps. What are the corresponding tools in the OSGeo field?

share|improve this question
add comment

2 Answers 2

up vote 3 down vote accepted

The latest versions of MapServer (6.0+) support server-side clustering - http://mapserver.org/mapfile/cluster.html

Since version 6.0, MapServer has the ability to combine multiple features from a point layer into single (aggregated) features based on their relative positions. Only POINT layers are supported. This feature was added through MS RFC 69: Support for clustering of features in point layers.

The proposal for this functionality is detailed further at: http://mapserver.org/development/rfc/ms-rfc-69.html

A sample configuration below:

LAYER
  NAME "my-cluster"
  TYPE POINT
  ...
  CLUSTER
     MAXDISTANCE 20  # in pixels
     REGION "ellipse"  # can be rectangle or ellipse
     GROUP (expression)  # an expression to create separate groups for each value
     FILTER (expression) # a logical expression to specify the grouping condition
  END

This layer can then be served out like any other as a WMS (MapServer also supports tiling).

I have not tried this, and the docs are unclear but it may also support a clustered WFS service.

An alternative is to do clustering at the database level rather than at the web server level, then you are free to use any WMS Server see - Spatial clustering with PostGIS.

share|improve this answer
add comment

There are a couple of options. Either you can implement a WMS layer. This will essentially turn your individual features into image files. This improves performance for large datasets but at the expense of client side functionality (e.g. not being able to select individual features on the map).

A nicer alternative (dependent on performance) is probably to implement clustering on the server side for your WFS layer in OpenLayers.

share|improve this answer
    
Could you please clarify what you mean by implementing a WMS layer? Are you talking about using WMS Services? –  Devdatta Tengshe Nov 22 '12 at 15:26
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.