I want to digitize the roads of a raster map to vector format using QGIS and GDAL preferably. By using the Raster Calculator I have been able to extract the roads and contour-lines from the raster to another raster by selecting pixels of the right color. The problem now is that I don't want the contour-lines, just the roads. The difference here is that the contour-lines are much thinner than the roads.

I have been trying to use Sieve and Proximity without much luck. I think I want something similar to Shrink in ArcGIS or maybe use different settings. Here is my start image which has gone through Raster calculation and a Proximity filter.Extracted roads and contours

1 Answer 1


you could use morphological mathematics for that (opening will extract objects larger than the structuring element )

in QGIS 2.2 Add the toolbox window (processing > toolbox)

then use Orfeo Toolbox > Image filtering > Binary morpholigical operation

Note that you could also use closing to connect your line segments.

With QGIS 2.1, OTB is available from sextante

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.