Bug report #17267

Processing/GeoPackage, Set Z Value, expression based input does not show fields

Added by Richard Duivenvoorde over 6 years ago. Updated over 6 years ago.

Affected QGIS version:master Regression?:No
Operating System: Easy fix?:No
Pull Request or Patch supplied:No Resolution:
Crashes QGIS or corrupts data:No Copied to github as #:25165


Having a building geopackage with an attribute 'gemiddelde hoogte' == mean height, I thought to use the 'Set Z Value' (or set M Value) from the Processing Toolbox.

Setting it to a fixed value, like 50.0 works like a charm.

BUT if I want to set the Z value to the value of one of the fields of the feature (as seen in the screenshot) the 'Fields and Values' dropdown just shows NULL.
While if I use the 'Expression Dialog' to show a label, all Fields are shown.

I will attach the dataset (a GeoPackage) too.

OR am I missing a clue, like having a 2d crs while a 3d crs is mandatory?

MissingFields.png - Missing fields (456 KB) Richard Duivenvoorde, 2017-10-10 12:00 PM

ExpressionDialogOk.png - Fields visible (55.9 KB) Richard Duivenvoorde, 2017-10-10 12:00 PM

3dAmsterdam.gpkg - GeoPackage Z to be updated (2.08 MB) Richard Duivenvoorde, 2017-10-10 12:01 PM

Associated revisions

Revision 612f5160
Added by Nyall Dawson over 6 years ago

[processing] Remove expression buttons from parameters outside modeler

Since these expressions were only evaluated immediately, it led to
confusing behavior for users who were expecting that the expression
would be applied per-feature.

Given that expressions can be directly entered into spin boxes, we already
have a way of users evaluating simple calculations for numeric
parameters at least.

I don't think there's a strong enough use case for needing to
calculate string results to leave the confusing expression builder
option in place.

This should be re-evaluated when we add UI support for dynamic
parameters (which are already supported in the backend), where
expressions are evaluated per-feature.

Fixes #17267


#1 Updated by Nyall Dawson over 6 years ago

It's because that "expression" button is a bit misleading - it's there only for "instant" calculations. So you can use it to do something like "500/3", but this expression is evaluated immediately and the result placed in as the parameter value. Then the algorithm operates using just that static value.

That's why there's no fields available there - it's not calculated per feature, so field values have no meaning.

I think the button needs changing to a "calculator" icon or something to help clarify this.

But, for what you're ACTUALLY after:

While processing in 3.0 has support for "data defined" parameters (e.g. taking the parameter value from a feature based calculation, such as a field value), this hasn't yet been exposed in the ui, and accordingly no algorithms support it yet. Something to tackle for 3.2....

#2 Updated by Richard Duivenvoorde over 6 years ago

Ok, Nyall, thanks for the clarification. I think this is more a UI-thing then?

Not sure if only changing the button to a calculator will fix this. As the dialog is identical, so I think people like me will think they can use is as they use it on other places?
Not sure what a viable solution for this would be though.

Close this one then?

#3 Updated by Giovanni Manghi over 6 years ago

  • Status changed from Open to Feedback

Close this one then?

I would suggest at least to change the title and description of this ticket. Thanks!

#4 Updated by Richard Duivenvoorde over 6 years ago

  • Assignee deleted (Victor Olaya)
  • Status changed from Feedback to Closed

Also available in: Atom PDF