I'd like to rotate marker line made from geometry generator function: the thing is that, by means of geometry generator I create line via make_line and points are the calculated values (based on values in attribute table fields - in Asia Lambert Conformal Conic projection EPSG:102027).

initial rectangle in EPSG:102027

Received linestring must be rectangle (parallel to map canvas), but when changing map projection in map canvas, сonsequently these points forms rotated rectangle (although label is parallel)

received rectangle in custom projection

How I can rotate (or maybe on-fly transform point coordinates in attribute table in custom projections) my rectangle so that it would be parallel to map canvas?

My projection: +proj=lcc +lat_1=57 +lat_2=63 +lat_0=0 +lon_0=133 +x_0=0 +y_0=0 +ellps=intl +units=m +no_defs

My geometry generator style: style

I tried to transform my geometry (constructed with geometry generator) via transform function (transform(geom, source_auth_id, dest_auth_id)) but nevertheless it puts wrong:

transformed geometry and labels

In draw background I didn't find any functionality for drawing custom shape borders - only solid line, but I would like to get a line with point markers

only solid line

  • Could you make a minimal shapefile for reproducing this and prepare the attributes so that the expression is only focused on the geometric challenge? Sounds like a nice puzzle! Commented Aug 24, 2017 at 11:11
  • Yes! Here you are cloud.mail.ru/public/JAeg/L97RSjGQs You can download shp and qlr, projection formulas are in post above.
    – Jane
    Commented Aug 24, 2017 at 12:07
  • I used in geometry generator style my custom function for fitting text in box to linestring, so in example file (in link) I removed my function for you are not to create my function in function editor (not to be afraid that rectangle is a little bit bigger than in printscreens above). Anyway, when changing map projection, rectangle is not parallel to map canvas and text in box
    – Jane
    Commented Aug 24, 2017 at 12:14
  • Thanks! It would be great to make it even more general. From what I understand you are trying to make a box from points where the points are created from attribute values. Having that work after transforming would require you to also calculate the offsets for the points depending on the transformation. I think this is way too complicated and probably leading into insanity. Why not simply use "Draw Background" in labelling? Commented Aug 28, 2017 at 11:44
  • Yeah, that is what I actually want. In draw background there is no functionality to make custom borders for shapes - only solid line, but I want to get line with point markers - I add some more information about it in my discription of the question
    – Jane
    Commented Sep 1, 2017 at 12:15

1 Answer 1


Not an answer to the question title, but maybe a workaround to reach the desired result. Have you tried generating an SVG graphic of a rectangle with a dotted border and using that as the label background? It won't scale independently on the X and Y axes, and the number of dots will have to be predefined, but you should avoid any issues caused by reprojection.

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.