Opened 12 years ago

Closed 12 years ago

#430 closed task (fixed)

New sample featuring MapServer Cluster

Reported by: adube Owned by: adube
Priority: major Milestone: 1.4.0
Component: samples Version: trunk
Keywords: bis-1.4.0 cluster mapserver Cc:

Description

MapServer has the ability to combine multiple features from a point layer into single aggregated features based on their relative position. This is called "Cluster".

It would be nice to have a sample featuring this in GeoPrisma.

See the MapServer documentation : http://mapserver.org/mapfile/cluster.html

Change History (2)

comment:1 by adube, 12 years ago

Here's a summary of the current situation for the Cluster in MapServer :

Cluster in MapServer

With MapServer 6.0

Features

  • The Cluster object was introduced in 6.0.
  • Should only be used for display purpose
  • Query doesn't support getting the clustered features info

Styling

The size of clustered points can be proportional to the "Cluster:FeatureCount" setting it to the SIZE parameter and setting MINSIZE and MAXSIZE, however the WMS GetLegendGraphic only shows the MINSIZE version of the style rendered. Labeling becomes complicated too if you want them dynamic. If you want to use this, set a big minsize and a maxsize equal to your MAXDISTANCE defined in your cluster.

An other way to do so is to manually define styling ranges by manually setting one CLASS object per classification wanted. This is longer to set, but it ensures that the classification is correctly returned in the GetLegendGraphic, you can more easilly manage your LABEL, etc.

TOLERANCE

When querying, the TOLERANCE is used as usual. The size of the feature doesn't matter.


With MapServer 6.1-dev (tested with trunk at revision 13157)

Features

Bugs and issues

  • In MapServer ticket 3873, in revision 12688, it is mentionned that you can use CLUSTER_GET_ALL_SHAPES_ON_QUERY process to get all shapes on query but a single shape on draw. I tried it and it doesn't seem to work.
  • TOLERANCE when querying. It would be nice to be able to query on the feature containing the cluster by its SIZE or it could also be by its MAXDISTANCE and REGION too. Currently, it's done using the TOLERANCE parameter at the LAYER level, which means if the feature size should by dynamically proportional to the number of clusters, the size wouldn't matter.

Tip and tricks

  • Make sure the SIZE of a feature containing clusters is never bigger than your MAXDISTANCE set inside your CLUSTER.

References

comment:2 by adube, 12 years ago

Resolution: fixed
Status: newclosed

Sample added in r1348, which uses MapServer 6.0.1 and Cluster used for drawing operations only (no query).

Task done.

Note: See TracTickets for help on using tickets.