Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a non-georeferenced vector layer that I need to be georeferenced. With raster layers the task is easy and straightforward, but I have no idea what should I do with my vector layer. I have a few control points with known coordinates which should provide some basis to transformation. So, let's say I know points with id-s of 1, 2 and 3 should have the coordinates of x1,y1 ; x2,y2 ; x3,y3. There might be some rotation and scale transformation in addition to simple shifting. Any ideas?

share|improve this question
Have you tried the qgsAffine plugin? Similar question here: – Rayner Sep 11 '12 at 11:25
The Affine plug-in will probably do the transformation, but you will need to know the transformation parameters to use it. Can you post the vector coordinates and the corresponding real-world coordinates for your three points? N. – nhopton Sep 11 '12 at 11:38
Can you convert the shapefile to a tiff using gdal_rasterize, georeference the tiff, then extract the parameters from the world file? – klewis Sep 11 '12 at 20:55

To georeference a vector layer, try the qgsAffine plugin. More info here: Where to find qgsaffine in the menu?

share|improve this answer
Thank you for answers. I guess I have to use the qgsAffine then and figure out the transofrmation parameters manually. I was just hoping that there's some way to automate that process. Perhaps I'll try writing some Python code to do that – AHaav Sep 11 '12 at 11:46
Thinking about it, you might find that GRASS v.transform (it's in the Sextante toolkit) is friendlier to use than the qgsAffine plug-in. N. – nhopton Sep 11 '12 at 12:03
By the look of it v.transform will do the sums for you as well, see – nhopton Sep 11 '12 at 12:28

Given the fact that you have some points of control, you should be able to use an Affine transformation to shift your vector data. Have a look at this recipe. The process is a two part process:

  1. Use your control points to define the coefficients of your affine function required
  2. take the coefficients and apply them to the ST_Affine() in postgis.

If you put your control points into a CSV file (old_x,old_y,new_x,new_y), you can just about cut'n paste the R commands from the link to solve the coefficients part.

share|improve this answer

see my answer in this thread: Snapping two polygons together and give the free openjump a try. its affine transformation is much more userfriendly than qgis affine plugin

share|improve this answer

Following-on from my comments on Rayner's answer, GRASS v.transform, which can be run from the Sextante toolbox, can be used to calculate transformation parameters and apply them to a vector layer to perform an affine transformation. A text file containing control points is required, in the format shown here.

It's very easy to use and works well.


share|improve this answer

With the release of GDAL 1.10 this is now possible.

It is done by performing a basic transformation in ogr2ogr and supplying the control points in the -gcp tag.

For a guide please see:

share|improve this answer
See also my answer here:… – AndreJ Apr 14 '14 at 11:37

I recommend the Vector Bender plugin for QGIS. I tried it and it works fine and is user friendly. Depending on amount of pair of points that you define, you can either do:

  • translations: translation from one starting to ending point (1 pair)
  • uniform: translation, scaling and rotation (2 pairs)
  • bending: additional deformation (3 pairs or more)

You find a short video here and I advice you to read the Vector Bender help once you installed the plugin.

share|improve this answer

I just had to do that, and ended up doing this :

  1. Rasterize the shapefile
  2. Georeference the raster using the Georeferencer plugin
  3. Save the GCP as a gcps.points file
  4. Compute the affine transformation using this file
  5. Apply the affine transformation to the shapefile using qgsAffine

The following script computes the affine transformation matrix using the saved GCPs :

# Computes an affine transform based on QGis GCPs
# Usage: gcps.points

import csv
import sys
import numpy as np
from skimage.transform import AffineTransform

u = list(csv.DictReader(open(sys.argv[1], "rb")))
source = [(d["pixelX"], d["pixelY"]) for d in u]
dest = [(d["mapX"], d["mapY"]) for d in u]
source = [map(float, s) for s in source]
dest = [map(float, s) for s in dest]
source = np.array(source)
dest = np.array(dest)
aft = AffineTransform()
aft.estimate(source, dest)
print aft._matrix
share|improve this answer

You can use the spatial adjustment method in ARC GIS. Once you add into arc Map, you need to make it editable than after spatial adjustment option is enable.And you also import your control point Spatial Adjustment->Link->Open Link.......

For more details please refer Spatial Adjustment section of ESRI help

share|improve this answer
The asker had tagged the question with qgis. So I assume he does not have an Arcgis license. – AndreJ Sep 29 '14 at 11:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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