8

How can I convert coordinates which are stored in a csv and in a certain format in a different CRS, i. e. I want to convert GK 3 (EPSG:31467) into WGS 84 (EPSG:4326).

I am using QGIS and already tried different methods such as saving a shapefile into another with a different CRS but this did not work out! I hope you can help me! Thanks!

1 Answer 1

9

First, you have to load the data into QGIS, and tell it that the data should be treated as EPSG:31467. Normally you do that with right-click -> Set CRS for layer.

Then, save the data as shapefile in EPSG:31467, and add the file to the canvas. Check if QGIS has chosen the right CRS: The new layer should align with the old, and rightclick -> Set CRS should point to EPSG:31467.

In step three, you can Save As in another CRS.

By the way, your method worked for me without problem. Did you get an error message saying that .shp is not a valid layer? Then you forgot to choose a filename for the export. It might help setting the project CRS to 31467 too. Other chance is that QGIS has added the new shapefile with the wrong CRS.

EDIT Here is my simple dataset:

Nr E N
1 3324000 5690000
2 3338000 5698000
3 3330000 5686000

If you want the new coordinates to be in the attribute table, use the field calculator with $x and $y. Make sure to choose fields of type real, not integer; and precision greater 5.

Copying the attribute table into clipboard looks like this:

wkt_geom  Nr  E   N   x neu   y neu
POINT(6.474297 51.317527) 1   3324000 5690000 6.4743  51.31753
POINT(6.671295 51.393530) 2   3338000 5698000 6.6713  51.39353
POINT(6.562184 51.283429) 3   3330000 5686000 6.56218 51.28343
10
  • Thank you very much Andre for your help! The strange thing is, after doing all the steps carefully, the values in the table are still in the old GK 3 format (EPSG:31467). So if I look at the table values, nothing changed although I saved it correctly as a new shapefile in the right format and then saved it again into the format which I want.
    – ben
    Commented Feb 15, 2013 at 15:39
  • If you right-click on the layers, Porperties, Metadata tab: Is the extent identical in all layers? For me, the WGS84 layer is in degrees.
    – AndreJ
    Commented Feb 15, 2013 at 15:46
  • 1
    The values in the attribute table are not dynamic, they are not linked to the actual coordinates of the points, they won't change when you change the CRS of the shapefile. As far as QGIS is concerned, after you convert your CSV to a shapefile, those values are just another attribute, like the point's name.
    – Dan C
    Commented Feb 15, 2013 at 15:47
  • 1
    The data in the attribute table has nothing to do with the coordinates! You can get the real coordinates with $x and $y in the field calculator.
    – AndreJ
    Commented Feb 15, 2013 at 15:53
  • 1
    It does not work on the original CSV layer, but on the shapefile layer. Click on the yellow pen, and then the last icon at the bottom right. New field of type real, name x neu, precision 5, click before Geometry, choose $x. Same for &y.
    – AndreJ
    Commented Feb 15, 2013 at 16:15

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.