Home / GIS and Open Map Data for Beginners

Network Analysis in QGIS: Shortest Paths and Service Areas on Your Own Streets

Highway running between green mountains in the Canadian Rockies

Photo: Ali Kazal / Pexels

Most map questions people bring to QGIS are secretly network questions. Not "what is near the school" but "what can reach the school in ten minutes of actual streets." Not "how far is the depot" but "which roads, in which order, at what cost." QGIS answers these with a native library most users scroll past: the Network Analysis group in the Processing toolbox, a set of algorithms that treat your road layer as a graph of edges and junctions and compute paths and service areas along it. This guide teaches the native set properly: what each algorithm computes, what it demands of your data, and the point where the native set ends and a plugin takes over.

Interactive tool

Follow the Edges: The Network Analysis Checklist

Check off each step as you finish it. Your progress stays on this page.

0 of 7 complete

0% done

The Graph Under the Streets

Every network algorithm begins with the same act of interpretation: your line layer becomes a graph. Each line is an edge; each place lines meet is a node; travel is movement along edges between nodes. Two consequences govern everything that follows. First, the graph only connects where the lines connect: a road that visually crosses another without a shared node, an overpass drawn as an intersection, a street ending a hair short of the junction, breaks the graph at exactly the place the eye forgives. Network analysis is unforgiving about topology in a way ordinary mapping is not, and the first service-area result with a mysterious bite taken out of it is almost always a topology lesson, not an algorithm bug. Second, cost is a property you define: the native tools measure cost in layer units by default, or in time when you give them a speed field, and the same graph answers "shortest" or "fastest" depending on which cost you ask it to minimize. Confusing the two is the classic beginner result: a geometrically short path through a slow street, delivered with total correctness to the wrong question.

The Four Native Algorithms

The Network Analysis group in Processing carries the core set:

  • Shortest path (point to point): one start, one end, the route between them, returned as a line with its total cost. The atom of the family.
  • Shortest path (point to layer): one start, many candidate ends (every feature in a target layer), a route to each, with costs. "From the depot to every customer," in one run.
  • Shortest path (layer to point): the mirror: many starts, one end. "From every school to the hospital."
  • Service area (from layer): from one or more start points, everything reachable within a cost budget, returned as the set of network edges inside the budget, the raw material of drive-time polygons.

Each takes the network layer, the points (clicked on the map or from a point layer), and the cost settings. The service area deserves a note of precision: the native output is the reachable edges, a web of lines, not a filled polygon. Turning the web into the smooth catchment shape of reports is a second step (a buffer or hull over the result), and knowing the web is the truth and the polygon is a drawing of it keeps you honest about what the analysis actually proved.

Direction and Speed: The Settings That Change the Answer

Two settings separate a toy run from a real one. Direction: road layers can carry one-way information, and the toolbox lets you declare which field holds it and how its values map to forward, backward, or both-way travel. Ignore direction on a one-way city grid and your shortest paths will cheerfully route the wrong way down real streets. Speed: declare a speed field (or a default speed) and set the cost to time, and the algorithms minimize minutes instead of meters; service areas become true drive-time or walk-time catchments. The speed values deserve suspicion in proportion to their importance: a layer whose speed field is a legal limit gives legal-limit times, not lived times, and the honest report says which one it used.

Aerial view of a city intersection with autumn trees
Aerial view of a city intersection with autumn trees

A Worked Run: The Ten-Minute Catchment

The canonical first analysis, end to end: a point layer with one clinic; a road layer for the town, checked for the junction breaks described above; speed set from the layer's field, cost set to time. Run Service area (from layer) with the clinic as the start layer and a budget of 600 seconds. The output web is every street segment reachable in ten minutes of modeled driving. Read it against the map: does the web cross the river only at the bridges? Does it stop, correctly, at the pedestrianized core? Does it leak across the rail line at a place no car can cross? Each answer is a topology audit disguised as a result. Then, and only then, draw the polygon for the report, and label it with the model it came from: ten minutes at posted speeds, Tuesday's network, this layer's completeness. A catchment without its assumptions printed on it is a claim without evidence.

Where the Native Set Ends: QNEAT3

The native algorithms answer point-and-path questions one at a time. The moment the question becomes a matrix, every origin against every destination, travel times between all pairs of clinics and all pairs of neighborhoods, the native set has no tool and the QNEAT3 plugin is the established answer: it builds origin-destination matrices from the same network logic, plus interpolation products like drive-time contours over a grid. The division is clean enough to memorize: native for routes and single catchments, QNEAT3 for matrices and surfaces. Both stand on the same graph discipline, and neither forgives a broken junction. Readers coming from the web side will recognize the family resemblance to the routing engines in our OpenStreetMap routing guide: OSRM and Valhalla do this work as services on OSM data, while QGIS network analysis does it locally, on your layer, under your assumptions, which is precisely its value when the network is yours, proposed, private, or hypothetical.

Building the Network From OSM: The Preparation Hour

Most QGIS network work starts from OpenStreetMap data, and the preparation hour decides the analysis before any algorithm runs. Take the road network for your area as lines, from an extract or a plugin download, and then do the unglamorous work in order. Clip to a study area slightly larger than the question, because catchments leak across tidy boundaries. Check the CRS and reproject to meters; cost in degrees is cost in nonsense. Inspect the junctions at a few known crossings, an overpass, a pedestrianized core, a dual carriageway, because those are the places the graph's honesty is decided: the motorway flyover must not connect to the street beneath it, and in raw OSM data the ways cross without a shared node there, which the graph reads correctly as no connection, one of the dataset's quiet virtues. Read the fields you will rely on: the one-way tags and the speed information exist in OSM's tagging, unevenly, and the analysis inherits their completeness exactly. An hour spent here is not overhead. It is the difference between a catchment you can defend in a meeting and one that dissolves under the first local question, and it is the same preparation ethic as the spatial join's predicate discipline: the tool is exact, so the inputs must be.

Shortest Path as a Diagnostic, Not Just an Answer

A habit worth adopting from practitioners: use the point-to-point shortest path as a network diagnostic before trusting any larger run. Pick two points whose real route you know by heart, your office and the depot, the school and the hospital, and run the path. If the algorithm's route matches local knowledge, the graph, the direction rules, and the cost settings are probably honest. If it invents a shortcut through a pedestrian street, or refuses a legal turn, or detours around a junction you drive daily, the path has just audited your data at the cost of one run, and the fix belongs to the data, not the report. Scale the habit: three known pairs before a service area, five before a matrix. The algorithms in this family are deterministic and literal; they will compute a flawless answer over a broken graph all day, and the only witness for the defense is a route you can check against the ground you know.

Data That Makes or Breaks It

The algorithms are the easy half. The inputs decide the truth: a road layer with real connectivity (the OpenStreetMap in QGIS guide is the usual source, with extracts for whole regions), a CRS in meters rather than degrees so costs mean what they say, one-way and speed fields that exist and are populated, and start points snapped to the network, because a point floating between streets gives the algorithm a riddle instead of a start. Budget the preparation at half the project. Every network analyst's war story is a data story wearing an algorithm's clothes.

Related Guides

If this page answered part of the question, these GIS and open data guides cover the rest of the same ground:

Frequently Asked Questions

What network analysis tools does QGIS include natively?

The Processing toolbox's Network Analysis group: Shortest path in three forms (point to point, point to layer, layer to point) and Service area (from layer). They run on your own line layer, with direction rules and speed fields, measuring cost in distance or time.

Why does my service area have a hole or a bite taken out of it?

Almost always topology: the network graph breaks where lines fail to share a node, at a gap, an overshoot, or an overpass drawn as an intersection. The algorithm can only travel where the graph connects. Inspect the network at the boundary of the missing area first.

What is the difference between shortest and fastest path in QGIS?

The cost being minimized. With default settings the algorithms minimize distance in layer units. Declare a speed field and set the cost to time, and they minimize travel time, which can choose a longer, faster road over a shorter, slower one.

Does the native service area tool produce a polygon?

It produces the reachable network edges within your cost budget: a web of lines. The filled catchment polygon in reports is a second step, typically a buffer or hull over that web. The web is the analysis; the polygon is its portrait.

When do I need QNEAT3 instead of the native tools?

When the question is a matrix or a surface: travel times between every origin and every destination, or interpolated drive-time contours. The native set answers individual routes and single catchments; QNEAT3 extends the same network logic to OD matrices.

Photo credits: Ali Kazal (Pexels); Stephen Leonardi (Pexels). Photos are served from this site; follow the credit to the library page for the original.