<html><head></head><body><div style="font-family: Verdana;font-size: 12.0px;"><div>Hi Martin,</div>

<div> </div>

<div>I hope you will find some time to do the improvements. :)</div>

<div>My wishlist would be:</div>

<div>- set the tolerance fixed or in relation to the scale so it can update while zooming</div>

<div>- ability to calculate sum(), min(), max(), avg() of numerical values of group members, at least the count of points in each group</div>

<div>- using the same renderer (single symbol, categorized, graduated, rule based) for the cluster point</div>

<div> </div>

<div>
<div name="quote" style="margin:10px 5px 5px 10px; padding: 10px 0 10px 10px; border-left:2px solid #C3D9E5; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;">
<div style="margin:0 0 10px 0;"><b>Gesendet:</b> Dienstag, 24. Juni 2014 um 19:00 Uhr<br/>
<b>Von:</b> "Martin Dobias" <wonder.sk@gmail.com><br/>
<b>An:</b> "Matthias Ludwig" <kaotika@gmx.de><br/>
<b>Cc:</b> qgis-dev <qgis-developer@lists.osgeo.org><br/>
<b>Betreff:</b> Re: [Qgis-developer] Access count and center point from QgsPointDisplacementRenderer</div>

<div name="quoted-content">Hi Matthias<br/>
<br/>
On Tue, Jun 24, 2014 at 10:07 PM, Matthias Ludwig <kaotika@gmx.de> wrote:<br/>
> Hi,<br/>
><br/>
> for a project (python standalone) I try to display points in "clusters"<br/>
> (like the Leaflet-marker-Cluster<br/>
> <a href="http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html" target="_blank">http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html</a>,<br/>
> or Openlayers, etc. just a simple distance based solution). As far as I<br/>
> understand the PointDisplacementRenderer more or less it does the same:<br/>
> group all points in a radius into a cluster and show the center point. If<br/>
> the tolerance is set depending on the scale the center points are displayed<br/>
> properly.<br/>
> I looked into the docs and the source code and didn't found a way to access<br/>
> the list of displacementGroups (to get the count and the center point) or<br/>
> just the count of points in each group. After that I tried to modify the<br/>
> source code of the renderer. I made the mDisplacementGroups publicly<br/>
> accessable (or i tried to do so) and moved the:<br/>
> typedef QMap<QgsFeatureId, QgsFeature> DisplacementGroup;<br/>
> /**Groups of features that have the same position*/<br/>
> QList<DisplacementGroup> mDisplacementGroups;<br/>
> /**Mapping from feature ID to its group index*/<br/>
> above the private section but it didn't worked. Is this completly wrong or<br/>
> do I have to change something else to get access with the python bindings?<br/>
> Is there any way to get the center point of each group and the count from<br/>
> the current implementation?<br/>
<br/>
Those members variables are just temporary and not meant to be used<br/>
publicly. I don't think there is a way to retrieve these groupings.<br/>
<br/>
> I didn't found something in the mailing list or somewhere else: is someone<br/>
> working on a "visual clustering" solution?<br/>
<br/>
If the time will allow, I would like to do few improvements to the<br/>
point displacement renderer. It would probably make sense to actually<br/>
take the clustering out of the renderer and have a class just for the<br/>
clustering algorithm that will return the groups.<br/>
<br/>
Regards<br/>
Martin</div>
</div>
</div></div></body></html>