I am working with both vector and raster data. I have several vector layers with land use data, e.g. including urban, (types of) forest and agriculture. I am also using Sentinel-2 raster data. My goal is to perform a supervised land use classification on the raster data. I am using the vector data to choose my training ROIs.

The problem is that the geography of the vector layers do not correspond with the raster layer. As you can see in the image I have attached, the polygons seem to be shifted slightly to the upper-left. Is there a tool to correct this by snapping the vector layer to the raster data in QGIS? For example, through selecting geographically matching points in both the raster and vector layers.

                Unmatching geographies of vector-raster data


1 Answer 1


If the offset is the same for all polygon geometries you can use Affine transform.

  1. Measure how much you want to move the polygons using "Measure Line", both X and Y axis
  2. Affine transform by the distance:

enter image description here

  • 1
    Thanks! Great suggestion. Is there a way to exactly measure the distance given as X and Y (rather than the Cartesian distance) with the "Measure Line"? Or should I just try to get it as accurate as possible and then adjust the transformation by eyeballing the result?
    – Sytze
    Commented Sep 10, 2021 at 11:13
  • 2
    I would create many point pairs one point where the polygon is now, and where it should be, then calculate mean x and y
    – Bera
    Commented Sep 11, 2021 at 14:20

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.