“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 :
2.5D
renderer.2.5D
render and visualize your changes.2.5D
render settings.Hint Try out the expressions Linear scaling
or Exponential scaling
.
2.5D
render switch the render type to Catogorized
and symbolize using the options belowCheck your results:
Your map looks similar to the image above
Name | Expectation |
---|---|
Linear scaling |
scale_linear( "pop_capacity" , 4645, 19028000, 2, 10) |
Exponential scaling |
scale_exp( "pop_capacity" , 4645, 19028000, 2, 10, 1.1) |
Categorized - Column Name |
STRUCTURE |
Categorized - Color ramp |
Random |
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.