16

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

25

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...

9

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.

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.