[Qgis-user] Multiple attribute labeling point layers
Andreas Neumann
a.neumann at carto.net
Thu Oct 3 01:15:59 PDT 2013
Hi,
Dealing with NULL values is better done with COALESCE() then with CASE
WHEN THEN ELSE END, as the COALESCE is shorter syntax and made for
dealing with NULL values.
But yes, you can concatenate any attributes.
The tricky part is getting different colors for parts of the label.
This is not yet possible. You may open a feature request for that.
Maybe we can introduce a markup language (HTML like syntax) for such
use-cases.
Can you open a feature request for this?
You can "sort of" simulate this by labeling the same layer twice, but
it may introduce additional complexity (overlap problems, etc.). So it
really would be better if we could have different colors within a single
label.
Andreas
On Wed, 2 Oct 2013 19:16:51 +0000, Lene Fischer wrote:
> It is also possible to use conditions. Right now a label is not shown
> if a single field is NULL.
> So I´m using this expression:
> Litra || 'n' || "Anvendelse" || 'n' || CASE WHEN "Anlaegaar" is NULL
> THEN '' ELSE "Anlaegaar" END
> (The '' after THEN is a double-ping)
>
> Regards
> Lene Fischer
>
> -------------------------
>
> FRA: qgis-user-bounces at lists.osgeo.org
> [qgis-user-bounces at lists.osgeo.org] på vegne af Carlos Cerdán
> [sig.upagu at gmail.com]
> SENDT: 2. oktober 2013 19:24
> TIL: Carlos López PSIG
> CC: qgis-user
> EMNE: Re: [Qgis-user] Multiple attribute labeling point layers
>
> Or.. you can do a expression based label:
>
> "Field 1" || 'n' || "Field_2"
>
> Result is label in two lines, with different fields. You can
> concatenate more text with ||
>
> ... but color is same
>
> Good luck
>
> Carlos Cerdán
>
> 2013/10/2 Carlos López PSIG
>
>> Hi Massimo,
>> Yes you can.
>> Only you need is you duplicate the layer and assign labels different
>> in each other.
>>
>> Is it ok?
>>
>> All the best,
>>
>> Carlos López Quintanilla
>> Consultor SIG
>> M. +34 699.680.261
>> carlos.lopez at psig.es [4]
>>
>> 2013/10/2 Ometto Massimo
>>
>>> Hi
>>>
>>> In QGIS 2.0.1 I need to label a point layer to display attributes
>>> stored in 2 different attribute fields.
>>> I need to show them in different colors, and in a specific
>>> position, such as one in the up right and one in the down right of
>>> the point.
>>>
>>> How is it possible to do this?
>>>
>>> Thanks
>>>
>>> MASSIMO
>>>
>>> Etra Spa - Energia Territorio Risorse Ambientali
>>> Sede legale: Largo Parolini, 82b
>>> 36061 Bassano del Grappa (VI)
>>> www.etraspa.it [1]
>>>
>>> Rispetta l’ambiente: se non ti è necessario non stampare questa
>>> mail
>>>
>>> Ai sensi del D. Lgs. 196/2003 le informazioni contenute in questo
>>> messaggio di posta elettronica sono di carattere riservato e ad
>>> uso esclusivo del destinatario sopra indicato. I dati personali
>>> vengono custoditi e controllati in modo da ridurne al minimo i
>>> rischi di distruzione, perdita, accesso non autorizzato o
>>> trattamento non consentito. Nell’ambito di tale finalità si
>>> informa che è vietato l'uso, la diffusione, distribuzione o
>>> riproduzione da parte di ogni altra persona. Nel caso aveste
>>> ricevuto questo messaggio di posta elettronica per errore, siete
>>> pregati di segnalarlo immediatamente al mittente e distruggere
>>> quanto ricevuto (compresi i file allegati) senza farne copia.
>>> Qualsivoglia utilizzo non autorizzato del contenuto di questo
>>> messaggio costituisce violazione dell'obbligo di non prendere
>>> cognizione della corrispondenza tra altri soggetti, salvo più
>>> grave illecito, ed espone il responsabile alle relative
>>> conseguenze, ai sensi del codice penale e del D.lgs 196/2003.
>>>
>>> Confidentially notice. This e-mail transmission may contain
>>> legally privileged and/or confidential information. Please do not
>>> read it if you are not the intended recipient(S). Any use,
>>> distribution, reproduction or disclosure by any other person is
>>> strictly prohibited. If you have received this e-mail in error,
>>> please notify the sender and destroy the original transmission and
>>> its attachments without reading or saving it in any manner. Rif.
>>> D.l. 196/2003 and Penal Code
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org [2]
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user [3]
>>
>> _______________________________________________
>> Qgis-user mailing list
>> Qgis-user at lists.osgeo.org [6]
>> http://lists.osgeo.org/mailman/listinfo/qgis-user [7]
>
>
>
> Links:
> ------
> [1] http://www.etraspa.it
> [2] mailto:Qgis-user at lists.osgeo.org
> [3] http://lists.osgeo.org/mailman/listinfo/qgis-user
> [4] mailto:carlos.lopez at psig.es
> [5] mailto:m.ometto2 at etraspa.it
> [6] mailto:Qgis-user at lists.osgeo.org
> [7] http://lists.osgeo.org/mailman/listinfo/qgis-user
> [8] mailto:carlos.lopez at psig.es
More information about the Qgis-user
mailing list