eyecatch

How to Create a Buffer in QGIS

Published: Last updated:
This article uses QGIS 3.40. The current LTR is 3.44.

What you'll learn


  • The concept of buffers and an overview of the buffer function
  • How to create a buffer
  • Points to keep in mind when creating buffers

Recommended for


  • Anyone using the buffer function for the first time
  • Anyone who wants to use buffers in QGIS

Introduction

When you look for a home, have you ever wondered, “Which properties are within a 10-minute walk of the station?” or “Is there a convenience store within 500 m of this property?” The buffer function is handy for this kind of analysis in GIS. Creating a buffer lets you draw shapes such as a circle within 100 m of a station.

This article explains the buffer function in QGIS, from the basic concept to the actual steps for creating a buffer. Buffers are an important GIS function used in many fields, such as disaster prevention mapping and transportation analysis. The article gives an overview of buffer processing, then shows how to create a buffer with real data.

What is a buffer?

A buffer is a shape drawn at a set distance from features such as points, lines, or polygons. As shown below, enter point data and a distance of your choice, and the output is circles. Enter line or polygon data, and the output is a shape that covers the lines or polygons.

100 m buffers created around designated emergency evacuation sites
100 m buffers created around designated emergency evacuation sites

Buffers are used in situations such as the following.

Creating hazard maps

By creating buffers around rivers or volcanic craters, you can convey messages such as “The area within a certain distance of a river is dangerous in heavy rain or a landslide” or “If a volcano is at risk of erupting, the area within a 1 km radius of the crater is closed.”

Disaster prevention and emergency information about Mount Asama (Source: Miyota Town website)
Disaster prevention and emergency information about Mount Asama (Source: Miyota Town website)

Analyzing public transportation gap areas

Create buffers around points such as stations and bus stops, and you can visualize the areas outside the buffers as public transportation gap areas. The web page of the Ministry of Land, Infrastructure, Transport and Tourism shows how to analyze public transportation gap areas, and it also uses buffers in that analysis.

Analysis of public transportation gap areas (Source: National Land Numerical Information)
Analysis of public transportation gap areas (Source: National Land Numerical Information)

Buffers are also widely used in planning store openings and analyzing trade areas.

Create a buffer in QGIS

This section shows how to create a buffer in QGIS.

The example uses data on designated emergency evacuation sites in Saitama Prefecture, provided by the Geospatial Information Authority of Japan (GSI). Get the Saitama Prefecture data from the GSI website.

Check the coordinate reference system

Pay attention to the coordinate reference system (CRS) when you create a buffer. Buffer processing draws a circle of a given radius, in meters, around a center point. However, some CRSs use degrees of latitude and longitude as their unit instead of meters. Depending on the CRS of your data, the circles can come out larger than expected or distorted, and the result is wrong.

Instead of the intended 1 km buffer, a buffer of 1 degree of latitude and longitude was created
Instead of the intended 1 km buffer, a buffer of 1 degree of latitude and longitude was created

So right before you run buffer processing, convert the data to a Cartesian coordinate system such as the Japan Plane Rectangular Coordinate System, chosen from the many available CRSs.

The Japan Plane Rectangular Coordinate System uses a different zone for each region. Saitama Prefecture belongs to zone IX of the system in JGD2011 (JGD2011 / Japan Plane Rectangular CS IX, EPSG:6677), so you need to reproject the data to zone IX.

The following article explains in detail how to reproject a vector layer.

Create the buffer

Once you have checked the CRS and reprojected the data, create the buffer.

From the menu at the top of the window, choose Vector → Geoprocessing Tools → Buffer.

Choose Vector → Geoprocessing Tools → Buffer from the menu at the top of the window
Choose Vector → Geoprocessing Tools → Buffer from the menu at the top of the window

When the Buffer dialog opens, check and set the following.

  1. Input layer: Select the layer that contains the features you want to buffer. Make sure it is the layer you reprojected to the Japan Plane Rectangular Coordinate System. The EPSG code that identifies the CRS is shown next to the layer name, so check it too to avoid mistakes. In the image below, the layer shows EPSG:6677, so it is correct.
  2. Distance: Set how far from the original features the buffer extends. For a buffer around a point, this value is the radius. You can set the unit to meters or kilometers, and also to nautical miles or inches. This example uses 100 m.
  3. Segments: Sets how smooth the buffer's shape is. The larger the value, the more accurate and smoother the shape. The default is 5, but a value of about 50 to 100 works well.
  4. End cap style: When you buffer lines, sets the shape of the buffer at the line ends. The “End cap style” section below explains it.
  5. Join style: When you buffer lines, sets the shape of the buffer at bends and similar places. The “Join style” section below explains it.
  6. Dissolve result: When enabled, QGIS outputs all buffers joined as a single shape. If you select Keep disjoint results separate under Advanced Parameters, QGIS joins nearby buffers only where they overlap, and outputs each set of joined buffers as its own shape.
  7. Buffered (output layer): Click the ... button and specify where to save the file and its file name. If you leave it empty, QGIS outputs a temporary layer.
  8. When the settings above are complete, click the Run button.
Specify the distance and other settings in the Buffer dialog
Specify the distance and other settings in the Buffer dialog

When the algorithm finishes, the buffers appear as shown below.

The buffers created
The buffers created

Buffer options

Buffer creation has several options. This section explains what the main ones mean, with examples.

End cap style

Here, End cap style sets the shape of the ends when you create a buffer for a line.

This is the result with End cap style set to Round. The buffer keeps its distance from the end of the line as well, so the end of the buffer is round.

Buffer created with End cap style set to Round (buffer in gray, original line in blue)
Buffer created with End cap style set to Round (buffer in gray, original line in blue)

This is the end with End cap style set to Flat. The buffer stops exactly at the end of the line.

Buffer created with End cap style set to Flat (buffer in purple, original line in blue)
Buffer created with End cap style set to Flat (buffer in purple, original line in blue)

This is the end with End cap style set to Square. The buffer extends beyond the end of the line as well.

Buffer created with End cap style set to Square (buffer in orange, original line in blue)
Buffer created with End cap style set to Square (buffer in orange, original line in blue)

Dissolve result

Dissolving means creating all buffers as a single shape. By default, QGIS does not join buffers, even when they overlap.

Buffers not dissolved
Buffers not dissolved

When you enable dissolving, nearby buffers appear as a single shape, as shown below.

Buffers dissolved
Buffers dissolved

Join style

Join style sets the shape of the buffer at bends in a line. You can choose from three styles, Round, Miter, and Bevel. Round is the default. Examples of each follow.

With Round, the outside of the bend is rounded, and the inside follows the bend of the line.

Example with Round selected. The outside of the line is rounded, and the inside bends parallel to the line (buffer in pink, original line in green)
Example with Round selected. The outside of the line is rounded, and the inside bends parallel to the line (buffer in pink, original line in green)

With Miter, both the inside and the outside follow the bend of the line.

Example with Miter selected. The buffer bends parallel to the line on both the outside and the inside (buffer in brown, original line in green)
Example with Miter selected. The buffer bends parallel to the line on both the outside and the inside (buffer in brown, original line in green)

With Bevel, the inside follows the bend of the line, but the outside bends several times.

Example with Bevel selected. The outside of the line bends in two steps, and the inside bends parallel to the line (buffer in purple, original line in green)
Example with Bevel selected. The outside of the line bends in two steps, and the inside bends parallel to the line (buffer in purple, original line in green)

The official QGIS documentation describes the options covered here in more detail, along with the other options.

Conclusion

This article covered an overview of buffers, the basic steps for creating a buffer in QGIS, and how to use the various options. The buffer function makes many kinds of analysis with geospatial data possible. Start with simple settings, then work up to more complex analyses.

Data sources

About the author
QGIS LAB Editorial Team
QGIS LAB Editorial Team

QGIS LAB is a comprehensive information hub for QGIS, the open-source GIS software. Under the concept of “Geospatial for Greater Good,” we share the knowledge and skills to open up the world through location data.