I have a raster in correct projection. I used shapefiles, and marked objects (manually), but I found out that my vector layers have different projection, so they have different size and position. Is there a way to correct it using QGIS functional?

That is what I see:

enter image description here

Then, I tried to convert vector projection to raster projection and got that:

enter image description here


2 Answers 2


Have you tried an affine transformation? Yours is a typical case for such kind of transformation for cartesian coordinates (i.e., not for lat-lon coordinates).

Basically, you would need to pick at least 3 well spread common points on both your vector and raster layers (for example, a street intersection) and arrange their coordinates in a matrix like this:

¦ Xs1 Ys1 1 0 0 0 ¦ | a ¦   ¦ Xt1 ¦
¦ Xs2 Ys2 1 0 0 0 ¦ ¦ b ¦   ¦ Xt2 ¦ 
¦ Xs3 Ys3 1 0 0 0 ¦ ¦ c ¦ = ¦ Xt3 ¦ 
¦ 0 0 0 Xs1 Ys1 1 ¦ ¦ d ¦   ¦ Yt1 ¦ 
¦ 0 0 0 Xs2 Ys2 1 ¦ ¦ e ¦   ¦ Yt2 ¦ 
¦ 0 0 0 Xs3 Ys3 1 ¦ ¦ f ¦   ¦ Yt3 ¦

Where Xs and Ys are coordinates on the source (your vector data) and Xt and Yt are coordinates on the target (your raster data).

Once you solve that system of equations, you obtain the transformation parameters, which are:

a: Scale X 
e: Scale Y
d: Rotation X
b: Rotation Y
c: Translation X
f: Translation Y

Then you can use the QGIS plugin 'Affine transformation' placing the calculated parameters in the plugin interface, this way:

Affine transformation parameters

That's it!


If you digitized the vector layer based on the raster but had a wrong CRS specified for the vector layer, the easiest option should be to simply overwrite the Shapefile's .prj file with the correct CRS information.

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.