-
-
Notifications
You must be signed in to change notification settings - Fork 3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expression parser: some expressions evaluate to NULL when they shouldn't #14373
Comments
Author Name: Nathan Woodrow (@NathanW2) I have just changed the title because it's related to the underlying expression parser more then anything else.
|
Author Name: Martin Dobias (@wonder-sk) Fixed in 699694
|
Author Name: Alister Hood (@AlisterH) I guess I should maybe open a new ticket - there is still be a problem for labelling. As far as I can tell, the field calculator is working correctly, e.g. I can now fill a field with @toint($perimeter)@, or @regexp_replace( toint($area) ,'(\\d+)(\\d{3})','\\1,\\2')@, and I can label with fields created that way. But if I try to use either of those expressions for labelling, the label is shown correctly in the output preview, but no labels are drawn on the map. |
Author Name: Nathan Woodrow (@NathanW2) I noticed this too. I think I know what might be causing the issue. My guess is that how I'm using QgsExpression::evaluate() is wrong. In the widget I use:
but in the labeling class I use:
Will patch it and see if that makes any difference. |
Author Name: Alister Hood (@AlisterH)
Original Redmine Issue: 4441
Redmine category:vectors
Assignee: Martin Dobias
example 1:
I can create a string attribute field called "test1" and fill it using @$perimeter@
I can then fill it using @toint(test1)@
But the entire column is set to NULL if I try to do this in one step using @toint($perimeter)@
example 2:
With the new expression based labelling in Trunk, with some expressions the result displays OK in the "expression based label" window's preview, but no labels are drawn on the canvas. e.g. this expression: @toreal(toint($AREA/100))/100@
But for some reason I can build a larger expression which includes it, and the labels are drawn successfully:
CNAME || '
SMU '|| CNUMBER || '
AREA = ' || tostring(toreal(toint($AREA/100))/100) || ' ha'
The text was updated successfully, but these errors were encountered: