top of page

Raster Analysis in QGIS for Beginners: Slope, Aspect, and Hillshade for Road Planning

Introduction:

QGIS is a widely used open-source GIS with advanced capabilities. Here we are learning about raster data. Raster data is quite different from vector data. Vector data has discrete features with geometries,

raster data is an image; it is represented using pixels with different values. It is typically in .tif, .tiff, or GeoTIFF format. With the raster file, we often get a supporting file in the .tfw format, which stores metadata information about the image.

Why do we need raster data for analysis? For example, while constructing a road through hilly terrain, using DEM (Digital Elevation Model) raster layers, QGIS can derive slope, aspect, and hill shade maps to help engineers assess the best and safest routes for construction.

Extracting Road Construction Suitable Surface using DEM data:

First we need to add the raster data on map canvas, while adding the raster data in the browser Pannel, navigate your .tif dem data drag and drop the layer on to the map.

First we need to add the raster data on map canvas, while adding the raster data in the browser Pannel, navigate your .tif dem data drag and drop the layer on to the map.

For choosing correct path while constructing the road we need to calculate slope, aspect, hill shade.

While calculating the slope we need to add the tool box on the map canvas. For that inside the QGIS in main Processing main Toolbox select the Toolbox.

While calculating the slope we need to add the tool box on the map canvas. For that inside the QGIS in main Processing main Toolbox select the Toolbox.

Inside the toolbox we have to choose Raster Terrain Analysis Tool box select the slope tool.

Raster Terrain Analysis Tool box

Then we need fill all the required parameter Elevation layer we have to add dem data for Z factor it was scaling factor for elevation values while calculating the slope we need to Project the data on the map using PCS(Projected coordinate system.

  • Use 1 if your elevation units and horizontal units (like degrees or meters) are the same.

  • For EPSG:4326 (lat/lon), use a Z factor that converts meters to degrees, typically around 0.00001 if needed.

Select output file location. Run the Tool

Run Tool

The slope value It was ranging between 00 to 83.250.

The slope value It was ranging between  00  to 83.250.

Aspect :-

Aspect gives the compass direction that a slope faces — essentially, it indicates the orientation of terrain.


Set the elevation layer as the DEM input layer, specify the Z factor based on the projection's unit scaling, and define the output path for the resulting aspect layer

Aspect

The output aspect layer is a grayscale raster representing slope orientation, with values from 0° (North) to 360° clockwise. It visually highlights terrain directionality, useful for hydrological modeling, solar radiation studies, and landform classification.

grayscale raster
Hillshade :
Hillshade

Hillshade is a raster visualization technique used in digital terrain analysis to simulate the appearance of sunlight and shadows on a surface.


Set the input layer as the DEM raster. Assign the Z factor based on the map projection to maintain accurate vertical scaling. Specify the horizontal angle (azimuth) as 300°, representing the sun's direction from the northwest, and the vertical angle (altitude) as 40°, simulating mid-elevation sun. Define the output path to save the generated hillshade raster.

hillshade raster
Extracting surface using slope data to identify suitable surface for road construction.

Right-click on the layer slope output layer, go to Symbology, and select the Primary Symbology as Classified. Set the Method to Manual Interval and manually define the percentage ranges.

Extracting surface using slope data
  • Residential Streets:

Maximum slope is typically 10%, which corresponds to approximately 5.71°.

This means the road rises 1 meter for every 10 meters of horizontal distance.

  • Main Roads and Highways:

Maximum slope usually ranges from 6% to 8%, which corresponds to 3.43° to 4.57°.

Designed for safety and smooth vehicular movement.

  • Steep Roads (Mountainous Areas):

Slopes may exceed 10%, reaching 12% to 15%, which equals approximately 6.84° to 8.53°.

These roads typically include features like switchbacks to manage elevation gain.

  • ADA Compliant Ramps:

Recommended maximum slope is 5%, equivalent to 2.86°, with allowances up to 8% (4.57°) for short distances.

Designed for wheelchair and pedestrian accessibility.

  • Safety Considerations:

Steeper slopes (especially >10%) can reduce traction and increase braking distance, requiring road safety measures such as guardrails, signage, and graded switchbacks.

So, for selecting best road am dividing entire Slope value in to 7 subclasses.

Reclassify by table

To visualize the classified output, set the symbology mode to 'Interpolation: Discrete' and use 'Classification: Continuous' to represent the data ranges effectively on the map.

symbology mode to 'Interpolation

After applying the symbology, the output can be visualized on the map canvas.

Map Canvas
Raster calculator am dividing slope:

According to my evaluation of geospatial slope data and transportation engineering guidelines, areas with slopes between 3° and 5° are considered suitable for highway construction.

Raster calculator am dividing  slope

These layers represent areas that are suitable for highway development based on slope criteria.

These layers represent areas that are suitable for highway development based on slope criteria.

**Based on my evaluation of geospatial slope data and transportation engineering guidelines, areas with slopes between 5° and 7° are considered suitable for mountain road construction.

Based on my evaluation of geospatial slope data and transportation engineering guidelines, areas with slopes between 5° and 7° are considered suitable for mountain road construction.

These are the layers suitable for road construction in mountainous regions.

layers suitable for road construction in mountainous regions

**Based on my evaluation of geospatial slope data and transportation engineering guidelines, areas with slopes between 7° and 20° are considered suitable for the construction of roads on steep slopes.

Based on the analysis in the image below, we can observe that no surface is available within that slope range.

Based on the analysis in the image below, we can observe that no surface is available within that slope range.

Based on the analysis in the image below, we can observe that no surface is available within that slope range
Conclusion

In this guide, we ca learned how to extract slope classes from a reclassified raster using QGIS tools such as the Raster Calculator and Polygonize. By identifying specific slope intervals (e.g., 3–5°, 5–7°, etc.), we can isolate terrain features for further spatial analysis, mapping, or decision-making. This technique is crucial for applications in hydrology, urban planning, agriculture, and environmental management. Whether you’re preparing data for modelling or visualizing terrain characteristics, these steps help streamline the classification and extraction process.


留言


bottom of page