Hi Martin,
 
I hope you will find some time to do the improvements. :)
My wishlist would be:
- set the tolerance fixed or in relation to the scale so it can update while zooming
- ability to calculate sum(), min(), max(), avg() of numerical values of group members, at least the count of points in each group
- using the same renderer (single symbol, categorized, graduated, rule based) for the cluster point
 
Gesendet: Dienstag, 24. Juni 2014 um 19:00 Uhr
Von: "Martin Dobias" <[email protected]>
An: "Matthias Ludwig" <[email protected]>
Cc: qgis-dev <[email protected]>
Betreff: Re: [Qgis-developer] Access count and center point from QgsPointDisplacementRenderer
Hi Matthias

On Tue, Jun 24, 2014 at 10:07 PM, Matthias Ludwig <[email protected]> wrote:
> Hi,
>
> for a project (python standalone) I try to display points in "clusters"
> (like the Leaflet-marker-Cluster
> http://leaflet.github.io/Leaflet.markercluster/example/marker-clustering-realworld.388.html,
> or Openlayers, etc. just a simple distance based solution). As far as I
> understand the PointDisplacementRenderer more or less it does the same:
> group all points in a radius into a cluster and show the center point. If
> the tolerance is set depending on the scale the center points are displayed
> properly.
> I looked into the docs and the source code and didn't found a way to access
> the list of displacementGroups (to get the count and the center point) or
> just the count of points in each group. After that I tried to modify the
> source code of the renderer. I made the mDisplacementGroups publicly
> accessable (or i tried to do so) and moved the:
> typedef QMap<QgsFeatureId, QgsFeature> DisplacementGroup;
> /**Groups of features that have the same position*/
> QList<DisplacementGroup> mDisplacementGroups;
> /**Mapping from feature ID to its group index*/
> above the private section but it didn't worked. Is this completly wrong or
> do I have to change something else to get access with the python bindings?
> Is there any way to get the center point of each group and the count from
> the current implementation?

Those members variables are just temporary and not meant to be used
publicly. I don't think there is a way to retrieve these groupings.

> I didn't found something in the mailing list or somewhere else: is someone
> working on a "visual clustering" solution?

If the time will allow, I would like to do few improvements to the
point displacement renderer. It would probably make sense to actually
take the clustering out of the renderer and have a class just for the
clustering algorithm that will return the groups.

Regards
Martin
_______________________________________________
Qgis-developer mailing list
[email protected]
http://lists.osgeo.org/mailman/listinfo/qgis-developer

Reply via email to