3

I am trying to use field caluclator within a model. In this formula I want to reference the output (temporary layer) of another step of the same model (output objektfilter_strassen_wege, which is named strassenpolygone_flurstuecke). Since this layer is not loaded in QGIS, I get no result. If I save the correct layer after running through the model and have the model repeated, I get a result. But that's not my goal! I want to get it the first time. I enter the following into the field calculator:

aggregate(
 layer:= 'strassenpolygone_flurstuecke',
 aggregate:='concatenate',
 expression:=oid,
 concatenator:=', ',
 filter:=intersects($geometry, geometry(@parent))
 )

strassenpolygone_flurstuecke should be called differently as input, I suspect. So not layer:= but something else that suggests that it is a generated output. The second possibility that went through my head was to choose to save the layer strassenpolygone_flurstuecke instead of the temporary layer. But even if I do this using the model, I don't get any result.


4
  • 2
    Alice ... this is an english-only ressource ... danke ! – Snaileater Nov 18 '20 at 13:01
  • GIS SE is an English language forum. Please use translation software to post your question. Neither greetings nor thanks are necessary (and are usually edited out to maintain style). Please take the quick Tour to better understand how things work here. Welcome to GIS SE. – Vince Nov 18 '20 at 13:02
  • thanks for your notes! So I put the translation on top now. – Alice123 Nov 18 '20 at 13:08
  • Have tried this kind of calculations within graphical modeler a lot, but never made it work. A similar question about this is still unanswered. I am afraid the answer is "not possible", but lets hope for the best. – MrXsquared Nov 18 '20 at 13:09
3

This is currently (QGIS 3.16.1) not possible, see the following comment from https://github.com/qgis/QGIS/issues/30397#issuecomment-505699624 :

The issue here is that expression functions which operate on map layers [...] don't currently have access to any temporary output layers created a step in a model. This applies to a lot of functions, including aggregates.

Here is another ticket describing your use case which is marked as a duplicate of the ticket linked above: https://github.com/qgis/QGIS/issues/37347

2
  • Hello pathmapper, thanks for your answer. Unfortunately, I am not looking for an input layer which is an output of another step but for the layer in my formula within the field calculator. The field calculator is part of my geaphical model. – Alice123 Nov 25 '20 at 13:48
  • @Alice123 thanks for your reply. Unfortunately this is currently not possible, see my adapted answer above. – pathmapper Nov 26 '20 at 8:28

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.