I am trying to calculate a bearing from each point in a layer to a single target using the graphical modeller as its part of some other processing I need to do. I can do the bearing calculation (below) but is there a way to get X,Y coordinates from a mouse click and use that as the target?


  • I suggest you use the azimuth expression of the field calculator instead of your custom expression.
    – Erik
    Feb 23, 2021 at 11:28

1 Answer 1


Yes, you can use "Point"-Input in your model:

enter image description here

It expects a user given point by clicking on the canvas and return x,y [EPSG:xxxx] e.g. -0.12,12.4 [EPSG:4326]. You can turn this into a geometry-point by using regular expressions like

array_get(string_to_array((regexp_substr(to_string('-0.12,12.4 [EPSG:4326]'),'[^\\s]*'))),0),
array_get(string_to_array((regexp_substr(to_string('-0.12,12.4 [EPSG:4326]'),'[^\\s]*'))),1)

Where you should use @point as variable accessing this input instead of -0.12,12.4 [EPSG:4326]. Its your original input name without whitespaces and an @ in front. so your expression could be


Note, that you wont be able to test this when you run the model from the model builder. You need to save it first and run it from your processing toolbox, otherwise you wont get a chance to click on your canvas.

  • Cheers for the advice, I tried using the point input but I didn't get any option to click on screen when I ran the model and clicked the 3 dots so I assumed I was heading in the wrong direction, maybe it isn't running right or I have done something wrong elsewhere
    – Sethinacan
    Feb 23, 2021 at 11:53
  • @Sethinacan You can only click one point, not 3. If you need three points, you need 3 Point-Inputs. Also its a little annoying that you need to save your model first and run it from processing toolbox. If you run it from inside the model builder you wont be able to click on the canvas...
    – MrXsquared
    Feb 23, 2021 at 12:03
  • 1
    Not running it from the processing toolbox was the issue, and that might be the case for another model I have - many thanks
    – Sethinacan
    Feb 23, 2021 at 12:05
  • The Point Input is not available as Model Input in any algorithm I tried. Which algorithm would you use to create an actually usable geometry from it? Apr 8 at 7:47
  • Nevermind, there is a Create Layer from Point algorithm exactly for this. Apr 8 at 7:49

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.