[Qgis-user] Label missing in Weekly

Andreas Neumann a.neumann at carto.net
Fri Aug 2 01:37:16 PDT 2013


 Hi all,

 I disagree with Bernd. We should stick to the SQL standard as closely 
 as possible. People know how to use SQL and the Expression builder 
 should be as close to SQL as possible. People would be surprised if QGIS 
 behaves different to a standard compliant database.

 So the current behaviour concerning NULL values is totally fine. Please 
 do not change it.

 Andreas

 On Fri, 02 Aug 2013 00:28:46 +0200, Bernd Vogelgesang wrote:
> mhm,
>
> Nathan, you wrote in the ticket:
> "String + NULL = NULL. We don't treat NULL as empty string because
> it's  not correct to do so. NULL and empty mean two different things
> so are  treated differently."
>
> Sorry, but for "what" is that not correct? This might apply to
> database  actions etc. but forcing user to make somersaults with
> "coalesce" (what  the f... is that???) to prevent empty labels ...
> hey! It's just labeling!
>
> Making labeling a nerd-discipline is not fair ;)
>
> Just my 2 cents
> Bernd
>
> Am 02.08.2013, 00:02 Uhr, schrieb Nathan Woodrow 
> <madmanwoo at gmail.com>:
>
>> Hey,
>>
>> QgsExpression doesn't treat NULL and Empty string as the same thing. 
>> Which
>> is why we don't auto convert.  To convert nulls in a field you 
>> should use
>> the coalesce("Areatype",'')
>>
>> See http://hub.qgis.org/issues/8369
>>
>> - Nathan
>>
>>
>> On Fri, Aug 2, 2013 at 7:35 AM, Larry Shaffer  
>> <larrys at dakotacarto.com>wrote:
>>
>>> Hi Lene,
>>>
>>> On Thu, Aug 1, 2013 at 2:25 PM, Lene Fischer <lfi at life.ku.dk> 
>>> wrote:
>>>
>>>> Hi Goyo
>>>> The geometries is OK.
>>>> I have a combined label Ex.
>>>> Areatype || '\n' ||  $Area   || ' m2'
>>>> Now I found that if one field is empty (Even if there is NULL in 
>>>> the
>>>> field), then the entire label will not be displayed.
>>>>
>>>
>>> When the expression-based label text was introduced, NULL values
>>> supposedly where just converted to empty strings [0], i.e. if 
>>> Areatype  was
>>> NULL, one would expect at least 'm2' to be present in the label.
>>>
>>> Try enclosing your field name Areatype in double quotes. Also, try  
>>> without
>>> the $Area function, but still with the || concatenation. If the 
>>> label  still
>>> does not contain any text, then it is probably a bug in how  
>>> QgsExpression
>>> handles NULL values from the data provider. If so, please create an 
>>> issue
>>> ticket [1]. Include a test project file, and try to list 
>>> reproducible
>>> steps, if you can.
>>>
>>> [0]
>>> 
>>> http://osgeo-org.1560.x6.nabble.com/Expression-based-labeling-tp4100735p4100736.html
>>> [1] http://hub.qgis.org/projects/quantum-gis/issues
>>>
>>> Regards,
>>>
>>> Larry
>>>
>>>
>>>> Regards
>>>> Lene
>>>>
>>>>
>>>>
>>>> ________________________________________
>>>> Fra: Goyo [goyodiaz at gmail.com]
>>>> Sendt: 1. august 2013 20:40
>>>> Til: Lene Fischer
>>>> Cc: qgis-user at lists.osgeo.org
>>>> Emne: Re: [Qgis-user] Label missing in Weekly
>>>>
>>>> 2013/8/1 Lene Fischer <lfi at life.ku.dk>:
>>>> > Hello
>>>> > I´m using the new labelfunction - it is great!! - but som of the 
>>>> labels
>>>> are
>>>> > missing. I have a small project with only 9 polygons, but only 7 
>>>> labels
>>>> is
>>>> > visible.
>>>> > I´ve tried:
>>>> >
>>>> > Settings to "View all labels in all layers"
>>>> > change attributefield and size
>>>> >
>>>> > Same result. Any suggestions?
>>>> > Regards
>>>> > Lene Fischer
>>>>
>>>> You might have invalid geometries. They are not labelled IIRC.
>>>>
>>>> Goyo
>>>>
>>>>
>>>> _______________________________________________
>>>> Qgis-user mailing list
>>>> Qgis-user at lists.osgeo.org
>>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>>
>>>
>>>
>>> _______________________________________________
>>> Qgis-user mailing list
>>> Qgis-user at lists.osgeo.org
>>> http://lists.osgeo.org/mailman/listinfo/qgis-user
>>>
>>>

-- 
 --
 Andreas Neumann
 Böschacherstrasse 10A
 8624 Grüt (Gossau ZH)
 Switzerland



More information about the Qgis-user mailing list