5

I have a single polygon shapefile (EPSG: 3044) which I want to enlarge using QGIS 2.18.16. I tried to use the vector affine transformation plugin, but whenever I try to change the size of the polygon, the whole layer changes its position and shape. Is there a tool in QGIS where I can do this task or is it possible with the affine transformation plugin and I just cannot find the right values?

What I have: Some csv points and a country-border. The points do not have the correct positional accuracy. Therefore I want to enlarge the country-border so that all points fit into the poylgon.

What I get when I change the X and Y scale from 1,0 to 2,0: enter image description here

  • Buffering has the downside of producing round corners, hence I would go with extracting the desired polygon from the layer, transform/enlarge it, and then paste it back in. Assuming there are more than one features in your layer? – Erik Mar 6 '18 at 14:16
  • I tried buffering and you're right.. the result resulted in round corners which I don't want. The layer consists of only the one polygon which I want to enlarge, I just don't know how to do that. – Blabsl Mar 6 '18 at 14:29
  • The transform-tool from the GRASS-GIS toolbox is rather self-explanatory. What happens when you use that one? – Erik Mar 6 '18 at 14:34
  • I added two screenshots. The first one is what I have right now. I want the polygon just to be a little bigger so that every point fits in within the border. When I use the v.transform GRASS tool and change the x and y scale the polygon also changes its position and thats what I don't want. – Blabsl Mar 6 '18 at 15:36
  • shouldn't the polygon be shrinked to match the points? So that the upper left point is in Sylt? – pLumo Mar 6 '18 at 15:54
11

Both GRASS (as Erik Lohmann points out) and SAGA have tools that can accomplish this. I've accomplished this in the past using the tool SAGA > Vector General > Transform vector layer.

  1. In order to prevent your shape from "drifting", you'll need to derive the centroid first. Run Centroid, using input polygon_layer. Here's an example, with the centroid labelled using the expression x($geometry)||' '||y($geometry).

polygon w/ centroid

  1. Run Transform vector layer:

    • Shapes = polygon_layer
    • Scale Factor X/Y = the coefficient you want to enlarge by. In this example, I've specified a scale factor of 2 for both, meaning my output will be double the size of the input.
    • For parameters X and Y, input the centroid coordinates. These values serve as the anchor points from which your input will be scaled.

transform dialog

Output from the above shape, with the new shape's centroid visible:

transformed polygon

| improve this answer | |
  • 1
    The SAGA tool with help of the centroids did the job! Thanks! – Blabsl Mar 7 '18 at 8:38
  • Can this approach be adapted for batch processing, such as if you had a layer with hundreds of polygons you wanted to do this to? – Kirkman14 Sep 17 at 19:14
  • Oh, absolutely! Just wrap the centroid -> transform process into a model and then batch process the model. It's also worth noting that in the time since my original answer, the latest QGIS version has an affine transform tool built in, and can take data-defined overrides, so you could have the centroid being calculated and insert those values for the translation. – JoshC Sep 18 at 2:11

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.