Select to view content in your preferred language

What does the weighted cluster really do?

672
1
06-15-2012 11:53 AM
TracySchloss
Honored Contributor
I have a project that uses clustering and I find the documentation very sparse.  I have a sample that draws OK, but there are very few clusters and they have quite a few points in them.  What parameters do I need to set to have the clusters be more spread out with fewer points in them.  This map covers the whole state and tehre is plenty of space.

<esri:FlareSymbol id="flareSymbol"
        
        flareMaxCount="30"
        flareSizeIncOnRollOver="2"
        sizes="[20,30]"
        textFormat="{tf}"
        weights="[30,60]"/>
  <esri:WeightedClusterer id="clusterer" symbol="{flareSymbol}">
   <esri:center>
    <!--
    x/y values are from the below extent x/y min/max values, these are the center of the extent.
    To make sure that you have the same clusters every time and independently of the map size and extent, these values have to set explicity,
    or you can let the cluster pick the map center at runtime.
    -->
    
    <esri:MapPoint x="{(-14477000-6677000)*0.5}" y="{(2273000+8399000)*0.5}"/>
   </esri:center>
  </esri:WeightedClusterer>


This is from an online sample and I'm pretty sure I need to change the mapPoint to fall in the middle of the state.  Does someone have some links a little more detailed explanation on using clustering?  It looks really interesting; I can't believe I haven't found more when I've searched on the forums.
Tags (2)
0 Kudos
1 Reply
MehulChoksey
Esri Contributor
Here is some explanation on Clustering:


  1. Clustering of Point features is done client side.(Other geometry types are not supported.)

  2. When you set clustering on FeatureLayer or Graphics Layer, Map is divided into invisible grid.Features contained  in a cell of this invisible grid are grouped together to form a ClusterGraphic.

  3. The position of ClusterGraphic within this cell is determined by type of cluster.

        a. In case of Grid cluster, the ClusterGraphic is placed at the center of the cell.
        b.For Weighted cluster, the cluster is placed at weighted center within cell  By default the weighted center is computed based on density/concentration of the points within  that cell) You can also provide your own funtion to compute weighted center for the cluster which could be based on other attributes of the graphic.

4. The ClusterGraphic is rendered/displayed on the map by cluster symbols
     a, CellSymbol - draws rounded rectangle with graphics contained in that ClusterGraphic. These are generally associated with grid clusterer
b.  SimpleClusterSymbol default symbol for clusters draws circle with graphic count
b. FlareSymbol - These draw circel with graphic count and flares out on mouse hover and shows actual symbol of the original graphic.

To control the size of the invisible grid's cell use sizeInPixel property (inherited) of the GridClusterer or WeightedClusterer
see:
http://resources.arcgis.com/en/help/flex-api/apiref/com/esri/ags/clusterers/WeightedClusterer.html

hope this helps,

Mehul
0 Kudos