7

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.

3
  • You need can use the 2.5 D render where you use your height column as a data defined input May 28, 2019 at 16:18
  • here is a short video on the 2.5D Render as mentioned by @kartoza-geek vimeo.com/149742884
    – Mapperz
    May 28, 2019 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, 2019 at 16:27

3 Answers 3

7

Use Translate, in the toolbox:

Translate

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:

add-a-blur

3
  • 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, 2019 at 17:30
  • 1
    Where did the .71 come from and how is this used to simulate the sun angle?
    – user35594
    Oct 19, 2020 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. Oct 20, 2020 at 11:14
3

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:

Before:

enter image description here

After:

enter image description here

1
  • 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. :) May 29, 2019 at 6:15
1

This is an old thread but in case anyone is looking for how to set this up using the 2.5 D symbology mentioned in the comments here it is:

25D Setup

The key is to generate a negative height. In this case I am multiplying my stories field by -10. Make sure to turn off shade walls based on aspect and shadow.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.