Spatial Analysis in QGIS: A Beginner’s Guide (Buffer, Overlay, Distance, Heatmaps)

Spatial Analysis in QGIS

Spatial analysis is one of the most powerful parts of GIS, whether you are checking which schools fall near a highway or identifying hotspots of activity in city, QGIS makes this task easier even for beginners.

In this blog, we will walk through the four basic guides,

Spatial analysis techniques using simple data,

roads (lines),

school (points),

city (zones),

polygons (random events),

CSV points for heatmaps.

Let’s get started step by step like a friendly guide sitting beside you.

1. Load the data in QGIS:

1. Load your sample data into QGIS. Once you unzip the folder, layers included, roads.shp, lines data, schools.shp, point data, city, zones.shp, polygons, hitmap, underscore, points.csv, point data, steps to add them, 1. Open QGIS,

 2. Go to Layerè Add Layerè Add Vector Layer,

3. Browse to the folder,

 4. Select roads.shp, schools.shp, city, zones.shp,

 5. For csv, go to Layer, Add Layer, Add Delimited Text Layer,

6. Select heattmap, points, csv, points, choose, x is equal to longitude, y is equal to latitude, geometry is equal to point.

2. Buffer Analysis.

Buffer analysis means drawing a safety circle (or distance circle) around something to find what lies inside that area.

Buffer analysis example 300m around roads Buffer helps you find areas within the certain distance of feature Here we will create 300m buffer around main roads To check which houses fall inside Step by step procedure

We used data of Main Roads Maharashtra along with upper Western part of india.

1)Data import:

Go to Layerè Add vector Layer

Select that highlighted (.shp ) file

1. Go to Processing Toolbox

 2. Search Buffer

 3. Select Buffer Vector Geometry

4. Set Input Layer

5. Default

 6. Dissolve Result  Yes Recommended

 5. Click Run

A new polygon layer Roads  Buffer 13. 200m appears

After following above procedure, 300m area around main roads is buffered.

For clear vision, just zoom the map canvas you will get required output

Buildings concerntrated in following areas

To see that clearly need to just zoom the map canvas

Interpretation:

The 300 m buffer around main roads highlights the immediate influence zone for development and infrastructure in western India (Maharashtra). This corridor often becomes the focus of commercial growth, improved access, and higher land values, but also concentrates environmental pressures—noise, pollution, runoff—and safety concerns. Overlaying land-use and protected-area data shows which natural or agricultural areas are most vulnerable. Planners should use these buffer maps to guide zoning, extend services efficiently, and implement mitigation (setbacks, green belts, pedestrian infrastructure).

Practical recommendations based on the buffer results
  1. Zoning & land-use policy: Define corridor-specific land-use rules — encourage mixed-use and transit-oriented development where appropriate; restrict harmful uses near sensitive habitats.
  2. Mitigation measures: Require green buffers, noise barriers, stormwater controls, and preservation zones near important ecosystems.
  3. Infrastructure staging: Prioritise utilities and public transport along these corridors to optimise service coverage.
  4. Safety upgrades: Introduce speed-calming, pedestrian crossings, and limited access points in densely developed sections.
  5. Further analysis: Normalize by population or traffic volume (if available) to estimate risk per exposure rather than raw area of influence.

3. Overlay Analysis:

Cut the roads to the exact shape of Taluka boundaries.

So you get:

  1. Only road parts inside Taluka A
  2. Only road parts inside Taluka B
  3. Nothing outside

It’s like trimming roads with scissors using Taluka polygons as the stencil.

 How to RUN CLIP in QGIS (Step-by-Step)

 Step 1 — Load the two layers (if not already)
  • taluka_sample.geojson
  • roads_sample.geojson

These should appear in Layers panel.

Step 2 — Open the Clip Tool

Go to:

Processing Toolbox → Vector Overlay → Clip

Not “Raster Clip”.
Not “Clip by Mask”.

Choose:

Clip (Vector Overlay)

Step 3 — Fill in the Tool Settings
SettingWhat to choose
Input Layerroads_sample
Overlay Layertaluka_sample
Output layerSave as: roads_clipped.geojson
      

Important:
Input layer = the layer you want to cut
Overlay layer = cutter (Talukas)

So roads are cut by Talukas.

 Step 4 — Click RUN

You will get a new layer:

roads_clipped

It will contain:

  • One road segment inside Taluka A
  • One road segment inside Taluka B
  • Nothing outside

Exactly like Intersect, but with simpler attribute output.

Before Clipping

After Clipping:

 What the result looks like (conceptually)

Taluka A (square) → contains pieces of Road 1 + Road 2
Taluka B (square) → contains pieces of Road 1

Clip output gives you:

Road NameFalls insideResult
Road_1A + BHorizontal piece cut into A and B
Road_2A + BVertical piece cut into A and B

You can click each clipped road to see its length, attributes, etc.

Why Clip is Useful?

You can now calculate:

  • road length per taluka
  • road density
  • road hierarchy inside boundaries
  • infrastructure reach
  • emergency access corridors
Heatmap

We will convert your Excel file into a point layer.

Objective of why we are doing the heatmap analysis ?

We’re mapping 2017 accident locations in Barcelona, Spain to reveal where accidents concentrate and why. A heat map turns hundreds of point records into an easy visual: hotspots suggest places with high collision frequency (bad intersections, busy roads, or unsafe designs). This helps readers and decision-makers quickly see patterns, plan targeted safety audits, design interventions (speed calming, better signage, lighting), and prioritize limited resources.

Step 1 — Add Excel File
  1. Go to Layer → Add Layer → Add Delimited Text Layer
  2. Browse → Select Heatmap_Points.xlsx
  3. Set:
    • X field → Longitude
    • Y field → Latitude
  4. CRS → EPSG:4326 (WGS 84)
  5. Add layer

After importing you will get following output.

Added Basemap over that

Step 2 — Create Heatmap
  1. Go to Propertiesè symbologyè Heatmap
  2. Run
Interpretation:

The heat map highlights clear spatial clusters of 2017 accidents in Barcelona, with intense hotspots along major thoroughfares and at several intersections. High-intensity (red) zones indicate repeatedly recorded incidents and likely problem locations for road design, visibility, or traffic control. Moderately warm areas suggest secondary risk corridors. Cooler areas show sparse incidents. These patterns direct attention to targeted engineering, enforcement, and outreach measures but should be combined with traffic volume data for risk-adjusted decisions.

For an in-depth understanding, please refer to our book, “Academic Research Fundamentals: Research Writing and Data Analysis”. It is available as an eBook here, or you may purchase the hardcopy here .