3

I am trying to use "Geometry by Expression" to add a point feature in a layer but I am getting unexpected results.

I added the expression make_point(0,0) but it just takes all the existing points and moves them to the 0,0 coordinate instead of adding a new feature.

I tried seeing if this similar answer would help, Adding a point to an existing layer, but when I download and run the model it keeps the original features and duplicates them all at the 0,0 coordinate.

My purpose for trying to use "Geometry by Expression" and not just toggling edit mode was because I was trying to incorporate that algorithm in a model for an automated task. In the question I referenced, the answer had explained a process to accomplish this but it wasn't working for me so I thought that I would start with trying to figure out this one part separate from what my end goal was. I couldn't make comments on that question so I had to make a new question.

2
  • Not sure why you want to use Geometry by Expression for this task. The logic behind Geometry by Expression is to create a geometry for each feature of a layer, so the result you get is not unexpected, but what could be expected. Why don't you just simply toggle edit mode and add a point?
    – Babel
    Commented Sep 21, 2022 at 22:52
  • Please, do not forget about "What should I do when someone answers my question?"
    – Taras
    Commented Oct 27, 2022 at 10:43

1 Answer 1

2

Short answer

Add a new point manually, activating Advanced Digitizing Toolbar and define coordinates 0/0.

Detailed answer

  1. Instead of Geometry by Expression (which by default creates a new geometry for each feature of the input geometry), rather toggle editing and add a point.

  2. To place it exactly at coordinates 0/0, use Advanced Digitizing Toolbar - if it is not visible, you can show it in menu View > Toolbars.

  3. Enable the advanced digitizing tools and for x and y values, type 0 and ENTER for each (Lock icon should be activated). When you now click on the canvas, a point at the exact location will be added to the layer.

Wherever you click on the map canvas, the point will be added at 0/0: enter image description here

1
  • My purpose for trying to use Geometry by Expression was because I was trying to incorporate that algorithm in a model for an automated task. In the other question I referenced you had explained a process to accomplish this but it wasn't working for me so I thought that I would start with trying to figure out this one part separate from what my end goal was. I couldn't make comments on that question so I had to make a new question.
    – David
    Commented Sep 22, 2022 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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