Download Grass Tutorial
Transcript
Chapter 39. Raster to Vector
There are three modules you can use to convert a raster to a vector map, depending
on the type of objects you wish to convert.
Lines
If you want to convert raster lines to vector lines, you first have to make sure that the
raster lines are thin enough to be transformed into only one vector line respectively,
and not into several parallel lines. "Thin enough" actually means having a width of
only one cell. The module to use for this operation is r.thin1.
Once you have thinned the raster lines, you can use r.line2 to transform the raster
data into vector data. Don’t forget to run v.support3 after r.line. The quality of the
resulting vector lines depends on the resolution of the original raster data.
Areas
For transformation of raster areas into vector area lines you can use r.poly4. If you use
the "-l" option, the module will smooth the corners to avoid the blocky appearance of
raster areas. Be aware that, depending on the resolution of the raster map and of the
original data, this smoothing might induce a certain error. Again, don’t forget to run
v.support5 after the transformation. The cell category values for the raster map layer
will be used to create attribute information for the resultant vector areas.
Contours
You can transform a raster surface into vector isolines (or contours) with the
r.contour6 module. If you just give it the interval between lines ("step" command line
option), it automatically determines the other values. You can also define a fixed
series of levels at which you would like to see isolines ("levels" option). The module
automatically runs v.support for you, so you don’t have to worry about that.
Notes
1. http://grass.itc.it/gdp/html_grass5/html/r.thin.html
2. http://grass.itc.it/gdp/html_grass5/html/r.line.html
3. http://grass.itc.it/gdp/html_grass5/html/v.support.html
4. http://grass.itc.it/gdp/html_grass5/html/r.poly.html
5. http://grass.itc.it/gdp/html_grass5/html/v.support.html
6. http://grass.itc.it/gdp/html_grass5/html/r.contour.html
97