Converting rasters to vectors
Sometimes, you need to convert data that is originally in raster format to a vector format in order to perform vector-based analysis methods. Generally speaking, as rasters are continuous datasets, converting them to polygons is more common than converting them to lines or points.
Getting ready
You need a raster layer, preferably one with groups of the same valued pixels next to each other. For this example, we'll use geology_30m.tif
, as a 30 meter x 30 meter pixel should give decent results.
Tip
The smaller the pixels, the smoother looking the resulting vector will appear when zoomed out.
How to do it…
Load
geology_30m.tif
.Go to Raster | Conversion | Polygonize:
Name the output
geology_30m.shp
.(Optional) Name the output column
geology
,class
orvalue
.Press OK to run the process.
Compare the results (colors are in a similar but different scale):
How it works…
For each pixel, the value is compared to its neighbors (there are different neighbor algorithms). When two pixels...