Skip to content
AI Segmentation
QGIS
Tutorial

Extract Roads in QGIS: 6 Methods and One Trap

Three panels of the same suburban street from the air: bare satellite imagery, an OpenStreetMap centreline drawn down the middle of it, and the paved surface filled in kerb to kerb as a polygon.

To extract roads in , install QuickOSM, open Vector > QuickOSM > QuickOSM, query the key highway over your canvas extent, and the network arrives as lines in seconds. Where OpenStreetMap is thin, five other methods put roads on the map: a published national dataset, hand digitizing, GRASS thinning, supervised classification, and a segmentation model.

  • Fastest, and free: QuickOSM, if somebody has mapped the area.
  • National coverage today: a published dataset, still free.
  • Imagery newer than the map: a segmentation model, from a free tier.
  • Lines out of a mask or a scan: GRASS r.thin then r.to.vect.

One choice comes first, and it decides which methods are open to you. You are not extracting roads. You are choosing between a centreline, one line down the middle carrying lane count and speed limit, and a surface, the tarmac kerb to kerb. Routing needs the line. Drainage and resurfacing quantities need the area. Half the methods below give you one, half give you the other, and converting between them costs an extra step.

Where the web gets this wrong

Two answers get repeated in QGIS tutorials and forum threads, and both cost an afternoon before you find out.

"Turn on automatic tracing and follow the road on the imagery." Tracing does not look at the picture. The QGIS 3.44 manual is explicit: it builds the shortest path along the edges of existing vector features. Over bare satellite imagery there is nothing to follow, so the tool does nothing at all. It pays off when you already hold parcels or a partial network and want the new geometry to snap to them.

"Run GRASS r.thin on your aerial photo." r.thin needs a raster where road is one value and everything else is another. Hand it a colour photograph and it thins whatever the pixel values happen to group into, which is not roads. It is a brilliant tool placed one step too early: it belongs after a classification or a detection, not before.

The short answer

What you are working withMethodWhat it costs
A city with active OSM mappers1, QuickOSMFree
A country with a national road dataset2, download and clipFree
A handful of roads, or fixes to a layer you hold3, digitize with tracing onFree, and slow
A road mask or a scanned map4, GRASS r.thin then r.to.vectFree
A multiband scene where tarmac stands out5, supervised classificationFree plugin, hours of samples
Recent imagery of somewhere OSM has not reached6, a segmentation modelFree tiers, then a subscription

Before you start

Work in a projected CRS. Two steps below take a width in layer units, and a width in degrees is meaningless.

Four things break every method on this page, whatever you paid for it. Tree canopy over a residential street hides the road from any sensor looking down, so the result comes back in pieces. A dirt track and the field beside it are the same colour, which is why unpaved roads go missing in exactly the places that need them mapped.

The other two are shape problems. Rivers, dry riverbeds and railway lines are long thin features, and any pixel-based method drops them into the road class. Bridges and tunnel mouths cut the surface at the point where a network most needs to stay joined.

Method 1: Roads from OpenStreetMap with QuickOSM

Thirty seconds of checking OSM saves you every method below. QuickOSM queries the Overpass API and drops the answer straight into your project.

Install QuickOSM

Plugins > Manage and Install Plugins, search QuickOSM, install.

Open the quick query

Vector > QuickOSM > QuickOSM, Quick query tab.

Set the key

Key highway, value empty for every road class. Add a value to narrow it: residential, track, motorway.

Bound it

Pick Canvas Extent. An unbounded country query times out on Overpass.

Run and filter

Lines arrive with the OSM tags attached. Filter on highway, and read surface where it exists.

The QuickOSM Quick query tab in QGIS: key highway, value empty, extent set to Canvas Extent, with the Run query button.
The whole query is three fields. Key highway, no value, canvas extent. Captured 3 September 2026.

The tags are the reason a mapped area beats any detection. highway=track tells you a way is an agricultural track and highway=unclassified that it is a minor public road. No model on this page can tell you either one, because a detection returns a shape and OSM returns a shape somebody has already named. Attribution is required under the ODbL.

Coverage is where OSM stops. Open the highway lines over recent imagery in rural Africa, in South Asia, or on the growing edge of most cities, and the tracks sit plainly in the picture with nothing drawn on them.

Satellite imagery of a rural district with OSM highway lines in blue over it. Two main roads carry lines, while a dozen visible dirt tracks between fields carry nothing.
OSM highway lines over the same extent. Two surfaced roads are mapped. The tracks between the fields are visible in the picture and absent from the layer.

Use it when: somebody has already mapped the area.

Skip it when: the imagery shows roads the OSM layer does not.

Method 2: Published road datasets

Somebody may have run the detection already and given the result away.

Microsoft Road Detections covers 54.2 million kilometres of road across 235 countries, mined from Bing Maps aerial imagery and released under the ODbL as centrelines, one file per country.

Meta publishes its own AI-generated roads through the Rapid editor. The Daylight distribution that used to package them was sunset in May 2024, so Rapid is now the practical route to them.

National agencies beat both where they exist. France publishes BD TOPO with its Troncons de route layer at metric precision under Etalab 2.0, against the rough alignment a mined dataset gives you. Great Britain publishes OS Open Roads free through the OS Data Hub, refreshed each April and October.

The catch is vintage. A detection set is a snapshot of the imagery it was mined from, and none of these knows that a road closed last spring.

Use it when: you need national coverage this afternoon and the date is good enough.

Skip it when: the job is a change since the dataset was built.

Method 3: Digitize by hand, with tracing on

Under about fifty roads, drawing them still wins, and QGIS gives you real help once you know what tracing actually follows.

Toggle editing, pick Add Line Feature, then enable the Tracing tool on the Snapping toolbar or press T. Snap to a vertex, move to a second one, and QGIS builds the shortest path between them along existing feature edges. Unfold the tracing icon and set Offset to digitize parallel to those features rather than along them.

Two behaviours surprise people. Tracing switches itself off when the canvas holds too many features, and comes back when you zoom in. For a freehand curve, R gives you streaming digitizing instead.

Use it when: under about fifty roads, or corrections against a layer you already trust.

Skip it when: you are staring at a district of unmapped tracks.

Method 4: GRASS r.thin, then r.to.vect

This is the one method that hands you centrelines directly, which is why it survives in 2026. Feed it a raster where road is one value and everything else is another: a thresholded scan of a paper map, or a mask from Method 5 or 6.

r.thin reduces every stroke to one pixel wide, and that pixel chain is the centreline. r.to.vect with feature type line turns it into geometry. The GRASS manual warns that it creates excessive nodes at junctions and dangling spurs, so budget the cleanup: drop the spurs by length, then merge the segments that should be one road.

GRASS ships with most QGIS installers, so there is nothing extra to buy. It is also the step that turns a Method 6 surface into a line network, which is the pairing I use most.

Use it when: you hold a clean road mask or a clean scan, and you need lines.

Skip it when: the input is a colour photograph.

Method 5: Supervised classification

Classify the pixels, then vectorize the road class. The Semi-Automatic Classification Plugin is the standard tool, by Luca Congedo. Release 9.0.4 needs QGIS 3.99, the QGIS 4 line, so on QGIS 3.x the manager serves you 8.5.0 instead. dzetsaka does the same job with a smaller interface.

You draw training regions on road pixels and on every other class in the scene, run a classifier such as Maximum Likelihood, then send the road class through Raster > Conversion > Polygonize. The raster to vector guide covers that second half, including the algorithms that fix the staircase edges polygonize leaves behind.

It works when tarmac genuinely differs from what surrounds it, and multispectral bands help. It falls over on the look-alikes, because a classifier compares pixel values and knows nothing about shape: grey roofs, dry riverbeds and bare field margins all land in the road class. Budget hours for the training samples, and expect to redraw them for the next scene.

Use it when: you have multispectral bands and roads that stand out in them.

Skip it when: roads and roofs share a colour, which is most cities.

Method 6: A segmentation model

A segmentation model has learned what a road looks like, so shape and context carry it past the look-alikes that stop Method 5. We build one of these, AI Segmentation. This section is about our own tool.

Install from the plugin manager

QGIS 3.22 or later on Windows, macOS or Linux. No GPU, no Python environment, no weights to fetch.

Draw the area

Over whatever raster the canvas already shows, from a satellite scene to a WMS.

Type the word

road for the carriageway. parking lot, sidewalk and driveway are separate words. Run them separately, or a car park pressed against a road merges into it.

Filter, then convert if you need lines

Once the run has returned the polygons, they carry label, class, score, area_m2 and perimeter_m in the project CRS. Filter on score and area, then send the surface through GRASS v.voronoi.skeleton for a centreline.

A suburban district on Google Satellite imagery in QGIS, the road surface filled kerb to kerb as one connected polygon layer in red.
A road run over Google Satellite imagery, captured 3 September 2026. The whole carriageway comes back as a surface, junctions included, not as a line down the middle.

Output is polygons kerb to kerb and never centrelines, so a line deliverable costs you the skeleton step above. Both cloud modes send imagery to a server in the European Union, and only the small local model stays on your machine.

Tree canopy breaks the surface into pieces you rejoin by hand, and bridge decks do the same. Wet asphalt and fresh resurfacing change the tone enough to drop a stretch. We publish no accuracy figure, because the number moves with your imagery.

The same road layer over a tree-lined street: the polygon runs solid in the open and stops at each canopy overhang, leaving three gaps along one block.
The canopy problem on one block. Three gaps in a single street, each under a tree. No method on this page sees through leaves.

One number from our own tuning table, because it explains a result people find strange. Roads run on a coarser tile than buildings, floored at 512 m of ground per tile against 128 m for a building, because a model handed a fragment of tarmac calls it a car park. A road only reads as a road when the model can see a run of it.

Costs, read 3 September 2026. The free plan covers 3 km2 of ground a month on Automatic with no card, plus 50 object detections a month on cloud Semi-Auto, and Semi-Auto on your own machine has no counter at all. Pro raises those to 200 km2 and 500 objects for 39 euros a month excluding VAT. Mapflow ships a roads model priced in credits at 0.10 dollars each, 5 credits per km2 plus the imagery cost, with 250 credits free to start.

Use it when: the imagery is newer than the map, and there is more road than you would draw by hand.

Skip it when: OSM already holds the network, or the imagery cannot leave your machine.

What to remember

Check OpenStreetMap first, because thirty seconds there decides whether the other five methods are worth opening.

Decide between a centreline and a surface before you pick a method, not after. Routing needs the line, area calculations need the polygon, and the conversion costs a step either way.

Automatic tracing follows existing vector features, never the imagery underneath. r.thin needs a binary raster, never a photograph.

Roads under trees come back broken in every method on this page, and no amount of money fixes it.

A Method 6 surface run through Method 4 gives you a centreline network that nobody had to digitize.

Try it free in QGIS, no card needed

Questions people ask

Can QGIS extract roads from satellite imagery on its own?

Not automatically. Core QGIS digitizes by hand and vectorizes rasters you have already classified. Getting roads out of a photograph needs a plugin: a segmentation model, or a classifier such as SCP that you train yourself.

Does road extraction give lines or polygons?

Both exist, and the method decides. OSM, national datasets, published detections and GRASS r.thin return lines. Supervised classification and segmentation models return surfaces, because a surface is what the imagery shows. GRASS v.voronoi.skeleton converts one to the other.

Why do roads under tree cover come out broken?

No sensor looking down sees through a canopy, so the gap is in the data before any software touches it. Bridge the pieces by snapping the segments together in an editing session.

Can any method find unpaved tracks?

Partly. A dirt track and the field beside it share a colour, so classification usually misses them and detection models find the wider ones. OSM highway=track is the most reliable source where a mapper has been, which is the problem in the places that need them most.

What imagery resolution is enough for road extraction?

Whatever separates the road from what sits beside it. A motorway shows up in a coarse satellite scene; a residential lane under trees needs 20 cm orthophoto or better. Test your own imagery on a free tier before committing to a method.

Is road extraction free in QGIS?

Methods 1 to 5 are free to install and free to run. Only the cloud segmentation models charge, and both named here have a free allowance.

The raster to vector guide covers the polygonize half of Method 5, and the building footprints guide walks the filtering step end to end. The QGIS AI hub compares the plugins side by side.