[Qgis-user] Labeled grouping by geometry

Emilio Abad Vidal eav at cesga.es
Mon Jun 25 03:28:33 PDT 2018


Thank you very much Stefan,

but that solution means having one more layer. But my intention was to apply it in the labeling layer itself, if possible, of course.

Anyway, thanks for the reply

Emilio

----- Mensaje original -----
De: "Stefan Giese" <Stefan.Giese at wheregroup.com>
Para: "Emilio Abad Vidal" <eav at cesga.gal>, Qgis-user at lists.osgeo.org
Enviados: Lunes, 25 de Junio 2018 11:58:03
Asunto: Re: [Qgis-user] Labeled grouping by geometry


Hola Emilio, 

you can try do generate a new virtual Layer with a union of the geometry grouped by the geometry itself and use this one for labeling. The following statement will define your new virtual layer: 

select mylayer.labelfield, st_union( mylayer .geometry) from mylayer group by mylayer .geometry 


The result will be a new layer with no double geometries. 

Hope this helps 

Best regards 

Stefan 
Mit freundlichen Grüßen
Stefan Giese
Projektleiter/Consultant
-----------------------------------
Aufwind durch Wissen!
Qualifizierte Open-Source-Schulungen
bei der www.foss-academy.com ----------------------------------- 
WhereGroup GmbH & Co. KG
Schwimmbadstr. 2
79100 Freiburg
Germany

Fon: +49 (0)761 / 519 102 - 61
Fax: +49 (0)761 / 519 102 - 11 stefan.giese at wheregroup.com www.wheregroup.com Amtsgericht Bonn, HRA 6788
-------------------------------
Komplementärin:
WhereGroup Verwaltungs GmbH
vertreten durch:
Olaf Knopp, Peter Stamm
------------------------------- 
Am 25.06.2018 um 10:32 schrieb Emilio Abad Vidal: 


Hello everyone,

I have a problem and I can not find the solution. I would appreciate any help.

I have a layer of lines that represent stretches of electrical conductors. These sections have a point of origin and an end point. One of its attributes is the length of each of the sections.

Some of these sections have the same point of origin and the same ending point, so when I label these lines by their length, this repeated data appears for each of the lines and the data is repeated.

I need that when labeling the layer, only the label of one of the lines appears, that is, that the distance between each of the points is represented. I have tried to do it by means of a labeling based on rules, and some function of aggregation by geometry, so that only one label is shown for each space between points.

I do not get it, so I would appreciate any help to solve this problem.

Thank you very much in advance and greetings 



More information about the Qgis-user mailing list