Quantcast
Viewing latest article 2
Browse Latest Browse All 3

Answer by Tom Brennan for Rotate a Geometry Generator expression with a 180 degrees rotation

If you're just to rotate your point within a polygon layer that has a single rectangle, you can use something like the following:

with_variable('centroid',centroid(aggregate('Rectangle','array_agg',@geometry)[0]),with_variable('distance',distance(@geometry,@centroid),with_variable('azimuth',azimuth(@geometry,@centroid),project(@centroid,@distance,@azimuth))))

It relies on the fact that a rotation within a rectangle is just projecting the point from the centroid, the same distance and same angle again.

Image may be NSFW.
Clik here to view.
enter image description here


Viewing latest article 2
Browse Latest Browse All 3

Trending Articles