4

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 – kartoza-geek May 28 at 16:18
  • here is a short video on the 2.5D Render as mentioned by @kartoza-geek vimeo.com/149742884 – Mapperz May 28 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 at 16:27
4

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

  • 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 at 17:30
1

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
    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 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.