24

How do I change the projection of my shapefile using QGIS?

The default projection is set to EPSG:3003, I want to change it to WGS84 EPSG:32632. When I do a reprojection or I change projection in the properties mask I don't have the correct result.

On the left, I have the plan coordinates but they are not correct for the EPSG shown on the right:

image

0

4 Answers 4

36

There are three different ways to change/manipulate projections in QGIS:

1. Project Properties > CRS (or you can click on the icon where EPSG is written in the bottom right corner)

This defines the proprieties of the canvas (the background layer). For exemple, if I want to display a background map from openlayers plugin (google street etc.) I will need to set the project CRS to EPSG:3857.

2. Right click on vector layer > Set Layer CRS

This will force QGIS to accept the CRS that you define, whetever the metadata or previous settings might say. Essentially you are overruling whatever was there previously. If you have ended up with some data that has no CRS defined, and you know what it should be, this is the one to use. It should be noted that this does not modify the actual shapefile (unlike when you set a CRS in ArcCatalog), it only modifies the layer properties.

3. Right click on vector layer > Save As...

Here you can set the CRS when you save your data. If you select a new CRS, this will transform the coordinates of the data the new coordinate system and save the result in appropriate file. Depending on what you select you will also get to specify the transformation method. This is used when you already have your data in the correct CRS, but you want to save it in a different projection.


You can also activate the projection "on the fly" (and then "OTF" will appear next to the EPSG projection at the bottom right corner of the main window). This can be useful as it allows QGIS to handle layers with different CRS and to show them simultaneously on the same map without having to manually change the CRS.


Here a visual example to show the difference. I would like to plot a map showing some measurement points in the Jakarta Bay, a grid that created of the Jakarta Bay and in the background a google map:

enter image deCRSiption here

Because my default CRS is EPSG:4326, when I open a new project and try to add an openlayers map such as google physical I obtain an error.

enter image deCRSiption here

So I need to change to EPSG:3857 and then it will work. For the moment I still can't see the map, but it will appear once I will add an appropriate vector layer.

enter image deCRSiption here

When I add the grid layer it doesn't show. Looking into the proprieties of the layer indicates to me the CRS is EPSG:4326. I don't know for what reason but this is not the correct CRS for this layer (probably I did a wrong manipulation and changed it in the past). In this case I have to indicate the correct CRS: "Set Layer CRS" (as in 2 above) and set it to EPSG:32748. After that the layer will appear with the google map. Only now I can permanently change the CRS of the layer: "save as" and choose the same CRS than for the google map (EPSG:3857). If you try to do this manipulation before choosing the original CRS you'll get an error.

enter image deCRSiption here

... after setting the original CRS (as in 2)

enter image deCRSiption here

.. after saving to a new shapefile (as in 3)

enter image deCRSiption here

When I import my measurement points I have the same problem as before because QGIS chooses by default to set the CRS to EPSG:4326 (you can change that in preferences > CRS). So I will again do "action 2".

enter image deCRSiption here

And then again action 1.

enter image deCRSiption here

And finally...

0
10

You can right-click on your shapefile in the table of content, choose "save as" and define the projection system that you want as an output.

0
1

If you already know the real CRS, and even it is read properly by QGIS, the answer is easy.

In QGIS 3.2: right click on your layer --> "export layer..." and change CRS at the same time like this:

enter image description here

enter image description here

1
  • Man, the new version of qgis doesn't allow this what the hell were they thinking!? Jul 21, 2022 at 18:53
0

If you do not need the objects inside the layer but just the layer itself with all its styles etc. another solution is to save the layer as a layer definition file (.qlr) via right click layer > export > save as layer definition file and create a new layer from it via Layer > add from layer definition file.

4
  • 1
    what is the connection to this 7 year old question?
    – Bernd V.
    Mar 22, 2021 at 14:37
  • 1
    Well, that's how I changed the projection for my shapefile in QGIS, as the title suggests. Some of the other answers speak of menu entries that do not exist anymore or have been renamed since.
    – Marty
    Mar 23, 2021 at 8:15
  • there is nothing to say against using templates for layers, but the common use case around reprojecting is really NOT with an empty layer, cause there is simply nothing to reproject inside. So I still see no connection.
    – Bernd V.
    Mar 24, 2021 at 9:24
  • While the layer was empty, it retained its original projection used in my previous project. That's where I ran into github.com/qgis/QGIS/issues/29648 so i had to change the source projection of the layer even if it was empty. I value these stackexchange sites for providing different alternate solutions. That's what I'm doing here. I'm sorry if this does not please you. Feel free to downvote if you so desire. Have a nice day Bernd :)
    – Marty
    Mar 24, 2021 at 9:40

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.