I have a map that uses the equirectangular projection (EPSG:3786). This makes the map look compressed towards the equator and I want to stretch it by 120% vertically whilst still retaining the correct points. The nearest thing I can find is GRASS' v.transform, but that simply stretches the dataset, causing it to have incorrect real world coordinates.

-
3You would be better off just picking a different projection – Ian Turton Jul 15 '22 at 07:34
-
Ian Turton, I would but the problem is I want it to be compatible with a Lua module that only supports this projection, so stretching it vertically is the only way to correct the proportions and retain compatibility. – Jul 15 '22 at 12:15
1 Answers
As mentioned by @Ian Turton, at least from a GIS point of view, it would be better to choose another projection. If you still want to simply stretch, you can use the almost unlimited power of QGIS expressions with Geoemtry Generator or Geometry by expression (see here for details).
The expression takes the vertices of each polygon and shifts it for a certain, freely definable amount away from a point inside the polygon, in this way stretching the polygon vertically. The amount the polygon is stretched can be changed on line 3 (here: 0.2). This is the expression to use:
with_variable (
'stretch',
0.2,
make_polygon(
make_line(
array_foreach (
generate_series (1, num_points( $geometry)),
make_point (
x (point_n( $geometry,@element)),
y (point_n ($geometry,@element)) -
@stretch * (y (point_on_surface ($geometry)) - y (point_n ($geometry,@element)))
)
)
)
)
)
Option
You could also replace point_on_surface (line 11) by centroid if the polygons you want to stretch do not shift evenly (depending on the shape of the polygons).
Screenshot: initial polygons (red) and streched version (blue), using Geometry generator with the expression above:

- 71,072
- 14
- 78
- 208