I have saved waypoints from my Garmin as gpx and have successfully imported them into QGIS. Is there a way to now export the layers into a csv file with coordinates? I've tried the export to csv but that does not give me the coordinates.
QGIS Export – Exporting Point Layer from QGIS to CSV File
csvgpxqgis
Related Solutions
The GPX format does support only a defined list of attributes, so if your vector has any attribute that does not match what the specifications say, you'll get that error.
When you export a vector to a gpx don't expect to have necessarily attributes with the coordinates, nevertheless they are present in the gpx file, example (obtained with QGIS):
<?xml version="1.0"?>
<gpx version="1.1" creator="GDAL 1.7.3" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://www.topografix.com/GPX/1/1" xsi:schemaLocation="http://www.topografix.com/GPX/1/1 http://www.topografix.com/GPX/1/1/gpx.xsd">
<metadata><bounds minlat="-0.406488549618321" minlon="-1.158778625954199" maxlat="0.674427480916031" maxlon="1.520610687022901"/></metadata>
<rte>
<name>um</name>
<rtept lat="0.660687022900763" lon="-1.158778625954199">
</rtept>
<rtept lat="0.674427480916031" lon="-0.409923664122138">
</rtept>
<rtept lat="-0.001145038167939" lon="-0.041221374045802">
</rtept>
<rtept lat="-0.406488549618321" lon="0.453435114503817">
</rtept>
<rtept lat="0.239312977099237" lon="1.520610687022901">
</rtept>
</rte>
</gpx>
More:
I do not know exactly what are you doing, I did the following experiment. First, From the point you mention I created a csv file. Then I used gps babel to create a gpx file from the csv (you do not need to do this). This is the point in google earth
I loaded the gpx file in QGis using GPStools (vector/GPS/Gpstools). When you load a GPX file Qgis separates the way points, tracks and routes as different layers. Waypoints are defined as a point layer, tracks and routes as line layers. I did have a waypoint so I have only a point layer in my project. Also take in to account that the coordinate system of a GPX file is lat lon with WGS84 datum (EPSG 4326).
I selected my point layer (the waypoint), right click and choose save as. This is the dialog box:
In the format section I want a ESRI shape file. I give a name and where I want to be stored in my computer.In the CRS section I choose the globe icon which let me select the coordinate system that I want. This is the dialog box:
In the filter I write 27700, select OSGB 1936 British National Grid EPSG 27700 and I can see the parameters. In the image you can see the things I mention in the elipses. In my experience it is mandatory to select the coordinate system you want and check its parameters before selecting ok. Once you hit OK you will have this dialog box:
Notice that the CRS section has changed and now shows "selected CRS (EPSG 27700, OSGB 1936/British National Grid)". Also notice that I did not want to add the saved file to map. When I am reprojecting I do not do this because Qgis will load the layer and will also activate "on the fly reprojection" in order to show all the layers in the project even though they are in different coordinate systems. Now I select ok
In order to check if everything is without problems I define a new project (poject/new) and load the reprojected shape file.
Notice the coordinates, they are no longer in lat lon, also chek the EPSG code of the project, now is set to 27700. Finally, I calculated the east and north values of the point with the field calculator and this is what I get
Hope it helps
Gerardo
Best Answer
Two methods are described in other answers here: