QGIS: Adding an X and Y Coordinate to Point Data using Field Calculator

  • Software: QGIS 3.34
  • OS: Any
  • Updated: August 2021

If you want the x and y coordinates for point data it’s fairly simple to do in QGIS 3.x. There’s actually two ways you can go about doing this and this tutorial will show you how to use Field Calculator.

Add your data to QGIS. Start editing by right clicking the layer and selecting “Toggle Editing”. You can also click the editing icon on the digitizing toolbar. Once you are editing, open Field Calculator located on the attributes toolbar.

Attributes toolbar in QGIS

Once open you can calculate a new field with the correct coordinates. Add a field called xcoord and add x_at($geometry,0) into the expression builder. Click OK and you have a new field called xcoord that has been calculated.

To repeat with the y coordinate just add a ycoord field and use y_at($geometry,0) in the expression builder. Open the attribute window and you will see your new data.

Your new columns will be in the projection of your data – not in the projection of the QGIS Map Canvas.

Want QGIS Training? Need help with a project? Give us a shout at info at northrivergeographic.com