I have many shapefiles representing the layers of a map (roads, buildings, etc). In total, I have hundred of layers, and I want to scale all of them by the same factor. I know I can use the affine transformation plugin to do that, but I was looking for an automatic way to do all 100+ layers to avoid having to do it manually every time.

Is there any such thing?

  • Do you need other parameters than just scale x and scale y? If not, with the SpatiaLite's ScaleCoordinates function it should be simple gaia-gis.it/gaia-sins/spatialite-sql-latest.html. You could use ogr2ogr with -sql parameter and make a script for the batch process.
    – user30184
    Commented Sep 15, 2016 at 4:43

1 Answer 1


You could use the GRASS tool v.transform and run it as a batch process. The tool is described as:

"v.transform - Performs an affine transformation (shift, scale and rotate) on vector map."

You can find this in:

Processing Toolbox > GRASS commands > Vector (v.*) > v.transform

And then right-click to bring up the options:

Batch process


If you want to have the fields automatically filled in, you can...

  1. Create a model from:

    Processing Toolbox > Models > Tools > Create new model
  2. Then add a Vector layer from the Input tab and give it a name (e.g. "layer"):

    Input parameter

  3. Then go to the Algorithms tab and find the v.transform tool:

    Algorithm parameter

  4. Fill in the fields with the relevant settings and an output name (e.g. "result"):

    v.transform settings

  5. Make sure to give a name to the model and group:

    Save names

  6. Save the model and close the model window. Then find your model in the Processing Toolbox and right-click to execute it as a batch process:

    Run model as batch process

  7. Click the ellipsis button for the top row only the input and select all your input layers (either those already loaded into QGIS or from a directory). Then again from the top row, click the ellipsis button for the result:

    Load and save files

  8. Select a directory to save the output files and add a name that you will use as a prefix to the original file name. I.e. if I use "Result_for_" then all my output files will begin with "Result_for_" followed by the original file name:

    Add prefix name

  9. When you click Save, another pop-up box will appear, use the Fill with parameter values for the Autofill mode:

    Fill parameter values

  10. Finally, you should see the output names of the results which will be produced when you run the model:

    Model ready

  • I don't see the GRASS GIS commands. I also tried looking for a plugin with that name but I couldn't find anything. I'm on Ubuntu, using QGIS 2.8.6-Wien
    – shittihs
    Commented Sep 15, 2016 at 22:17
  • Eventually I found out that is a common problem of incompatible libraries. So now I have the batch screen in front of me, where I can set the parameters for each transformation. However, I don't want to copy/paste the values of the Xscale, Yscale (..etc) for all of the layers. This kind of defeats the purpose of running them altogether... is there a way to automatically fill all the fields?
    – shittihs
    Commented Sep 15, 2016 at 23:45
  • 1
    @someoneElse - Glad you found it eventually (also, at the bottom of the of the Processing Toolbox interface, is it set to Advanced interface?). I've edited my post to include how to create a model which would have you only enter the parameters once and run it on all your layers :)
    – Joseph
    Commented Sep 16, 2016 at 12:56

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.