“2.5D rendering is used to extrude polygons from their surrounding features, creating an illusion of depth in your map”
In this module we will examine the 2.5D renderer in QGIS and understand the basic options that can be used to specify how extrusion should take place.
Goal: To learn basic workflows behind working with the 2.5D renderer
You need to do the following tasks to achieve results like the example above :
Check your results:
Your map looks similar to the image above
Name | Expectation |
---|---|
Linear scaling ❗ |
scale_linear( "pop_max" , 4645, 19028000, 2, 10) |
Exponential scaling ❗ |
scale_exp( "pop_max" , 4645, 19028000, 2, 10, 1.1) |
Buffer distance ❗ |
15 km |
Buffer option ❗ |
Dissolve = No |
In order to simulate perspective for extruded objects, an algorithm is used to compute the distance of each object from the top of the map. This distance is then used to render the objects, starting with those closest to the top of the map, ending with those closest to the bottom. You can view (and modify) this formula in the 'control feature rendering order' expression editor.
2.5D renderer uses a special symbol layer style called 'geometry_generator' to compute the extruded geometry for the 'walls' and 'roof' of the extruded polygon. You can use the geometry generator to do other cool stuff like buffering geometries on the fly.
If you change the renderer to single symbol renderer QGIS will create a number of symbol layers and preserve the 2.5D rendered style. You can use these symbol layers to manipulate the 2.5D rendering in fine-grained detail. You can also add additional geometry generator symbol layers to create effects like this:
One other important thing to note: 2.5D renderer uses two special layer variables to store the qgis_25d_angle and qgis_25d_height. If you try to copy the style from one layer to another, these values will NOT be copied, so you need to manually set them on the destination layer if needed.
2.5D Renderer can be used with these feature types:❗
Download the sample data for the lesson.