5

I am trying to use the Set Z Value algorithm in QGIS Graphical Modeler. More specifically, I would like to set the elevations using values contained in a field in the input layer, but the elevations are not getting passed to the output.

I have tried connecting things as described in this post: Using Set Z-Values in QGIS Processing Modeler, but Modeler is not passing any elevations to the output.

I have created the [Vector Layer] and [Vector Field] inputs as shown in the post.

In the [Set Z value] algorithm dialog, I have tried:

  1. setting the [Input layer] type to [Model Input] and the value to my [Vector Layer], and
  2. setting the [Input Layer] type to [Value] and setting the value to the corresponding layer name.

When I run the model, it prompts me to select the appropriate elevation field, which I do. The model runs and produces a result, but the result is not elevated. Any thoughts?

Model DiagramSet Z SetupModel Dialog

1
  • I only can confirm this behaviour, but I have no clue as to why it is as it is.
    – Erik
    Jan 7, 2021 at 13:03

1 Answer 1

2

In the Z value setting of the Set Z Value algorithm, set a Value (instead of a Pre-calculated Value).

The value starts with something like 0.000000.

Press the data defined override button, Edit... option. It will open the expression string builder. Write the following expression:

attribute( @ElevField )

2
  • Thanks Gabriel! That works wonderfully and helps me better understand the way Modeler works!
    – GSC_Mapper
    Jan 11, 2021 at 16:07
  • You are welcome, GSC. Jan 11, 2021 at 22:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.