I am making a plan and I would like to make it beautiful using illustrations.

I have to place some vehicles in a square and see how many fit.

enter image description here

I have thought about making some polygons represent these vehicles.

To make it more attractive to the eye I have thought that the filling of the polygon is an image of that type of vehicle.

enter image description here

For that I use the fill with raster option. My problem is that I can't control where that image is located within that polygon.

enter image description here

In this example I would need to upload the image so that the entire bus is biased. If I use X and Y modification the image moves but it is still cut off.

Any idea how to do it?

Do you know of videos that help to make plans of this type? (QCad could be a solution to make it more professional)

Following @BERA indications:

Geometry Generator

Programing Rotation


  • When you say “plane” a few times in these questions do you mean plan?
    – PolyGeo
    Commented Oct 22, 2022 at 20:48
  • 1
    Try calculating a new field called rotation with the formula main_angle($geometry) then convert the polygons to centroids, symbolize with Raster image marker, rotate by the field
    – Bera
    Commented Oct 23, 2022 at 13:43
  • @BERA thank you so much for your solution.I don't know why, but the angle always fails by 90 degrees. But for me this is not a solition because I need to create another layer and solvin the problem of degrees, it's not visual to change it.
    – RBenet
    Commented Oct 23, 2022 at 19:27
  • You can copy the layer and use geometry generator
    – Bera
    Commented Oct 24, 2022 at 5:20
  • @BERA Works with Geometry Generator. Now my problem is with rotation. I introduce formula "main_angle($geometry)" but the program only uses the value in rotation, and not evalue the formula. Any idea why?
    – RBenet
    Commented Oct 28, 2022 at 16:10

1 Answer 1


Following @BERA indications, I find a solution:

First of all, using Field Calculator, I need to create a Decimal Virtual Field with the rotation of the polygon. If is virtual field, when you rotate the polygon field will be update. The rotation of polygon you can obtain with main_angle($geometry), but I don't know why but I need to reduce with 90. So the final expression is main_angle($geometry)-90

enter image description here

Second in Symbology, I add a Geometry Generator - Point/Multipoint with centroid($geometry):

enter image description here

Inside the Geometry Generator I add a Marker/Raster Image Marker with the picture/illustration you want to insert.

After that, I go to rotation, and I said that value to get, is the value of virtual Field called Rotation.

enter image description here

P.D.: My questions to @Bera, was because if I put the formula inside of this, it doesn't works, and is for this I created a virtual field.

Enjoy it!!! I thank you so much to @Bera for his help.

enter image description here

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.