I'm using QGIS 2.18.17 on Linux Mint 19. I have several .gpx files of waypoints recorded using a handheld GPS device. I can load them on to QGIS or Google Earth with no problems. However, I want to be able to access the coordinate data and the values for each GPS point that I have recorded.

When I look at the attribute table of the .gpx files in QGIS, the X and Y coordinates are not displayed, although the elevation, time, name, and comment data are. When I open the .gpx files in a text editor, the coordinate information is there and I can copy and paste the values for each waypoint.

I assume that there is an automated way to do this, like converting the .gpx to a .csv file.

How do I extract all the X and Y coordinates from a .gpx file using QGIS?

1 Answer 1

  • You can do Layer... Save As... and choose the CSV output format. Choose Geometry type as POINT and Geometry as AS_XY:

enter image description here

Then you'll get a CSV like:


That was a for a set of route points rather than waypoints but similar output should result.

  • Alternatively you can open the attribute table for your points layer, then use the field calculator (abacus icon) to add two new attributes (columns) based on the $x and $y expressions. Like this:

enter image description here

  • Also theres a Processing module that does exactly this, called Add Geometry Attributes:

enter image description here

after running that on my test layer I see an extra xcoord and ycoord column.

What you should actually do will depend on why you want the coordinates anyway...

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.