Can anyone think of a simple way to create a polygon to represent building shadows?

I have a shapefile with height information for the buildings and I want to create a simple plan looking like the image below:

dropped shadows

I don't want it to be accurate based on the terrain etc or really specific of the sun, but just a way to demonstrate the height of the building with a shadow that is connected to the building.

  • You need can use the 2.5 D render where you use your height column as a data defined input May 28 '19 at 16:18
  • here is a short video on the 2.5D Render as mentioned by @kartoza-geek vimeo.com/149742884
    – Mapperz
    May 28 '19 at 16:23
  • Yes, I'll try to get an answer written up using a Geometry Generator that uses the translate(geom,dx,dy) function. It should be able to get the delta x and delta y values from your height field and maybe even using a scale() function. Currently away from desk so will try to get it up in a bit here if someone doesn't beat me to it.
    – SaultDon
    May 28 '19 at 16:27

Use Translate, in the toolbox:


here I set dx and dy both to .71*Height to simulate a 45° sun incidence, but you can use whatever combination you prefer.

This creates a new layer, which you have to move under your original one, and set to a dark shade. Optionally, for a smoother rendering, set a slight blur with the Draw effect:


  • Thant's great! thank you! Any ideas on how to connect the corner of the shadows to the corner of the buildings?
    – George
    May 28 '19 at 17:30
  • 1
    Where did the .71 come from and how is this used to simulate the sun angle?
    – user35594
    Oct 19 '20 at 15:03
  • .71 is an approximation of cos(45°) , where 45° is the incidence angle of the sun light that I wanted to simulate. At noon the sun may be for example 70° (depending on day of the year and your latitude), so you could use cos(70°) = 0.34 and shadows will be correspondingly shorter.
    – RafDouglas
    Oct 20 '20 at 11:14

You can use also the Draw effects and select Drop Shadow option. Using this option does not require to create a new file with modified geometry. Drop Shadow option gives you the ability to change the Blur and the direction of shadow freely and easily without the need to create a new file each time.

  • Go the buildings polygon's Layer properties -> Symbology -> select Simple fill -> Draw Effects

enter image description here

  • Click on the Yellow star
  • Select the Drop shadow option and select it to see its options

enter image description here

Here is a sample building before and after using Draw effects:


enter image description here


enter image description here

  • 1
    This is a good and fast approach, however it does not take into account the actual building height, i.e. all shadows are offset by the same distance. For a quick visual effect however it is a good compromise. :)
    – RafDouglas
    May 29 '19 at 6:15

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.