Getting list of coordinates for points in layer using QGIS?

  • I've got a layer in QGIS that is comprised of points. Its attribute table doesn't have (show) the corresponding x and y coordinates for each point. Is there a way for me to extract a list of coordinates for those points? (ideally into a CSV, but not required)

    Also, for the exported list of coordinates (say, in a CSV file), how do I include the existing attribute table with it?

    For your information, I am running QGIS on Mac OS X 10.6.7.

  • Depending on your version, you should be able to right-click on the layer you want to export, and select Save As... Choose Comma Separated Value from the dropdown list of the dialog box that appears. Then, in the Layers part of the OGR creation options, type GEOMETRY=AS_XY or GEOMETRY=AS_XYZ depending on the dimensionality of your source data.

    QGIS Save vector layer as... dialog

    That's great and it works! One more thing: Can I also export columns I already have in the original layer's into the CSV, along with the X, Y coordinated? Thanks.

    Cool, glad it works! Make sure you have the "Skip attribute creation" checkbox unchecked. I'm not a fan of negative checkboxes like that, it always makes me think twice about what state I need it in.

    Very useful tips!

    For anyone else on Windows 10 (QGIS 4.3.1) confused about where this gets saved, check your "C:\OSGeo4W64\bin" folder.

License under CC-BY-SA with attribution

Content dated before 6/26/2020 9:53 AM