On this page:
Converting vector and raster data
In this section, we will use the Processing Toolbox to access tools, rather than using the menu bar. Ensure that the Processing Toolbox Panel is visible.
Convert vector to raster (rasterize)
Download: Dominica rainfall vector file
- Load the vector file.
- In the
Processing Toolboxsearch field, typerasterize. - Double-click
Rasterize (vector to raster). - Select
rainfallas the input layer. - Select
RAINFALLas theField to use for a burn-in value. This will ensure that the rainfall values are added to the output. - Select
Pixelsas theOutput raster size units. - Enter
100for theWidthandHeight. A higher number produces a higher resolution and better visualization. - Set
Output extent --> Calculate from Layer --> coastline.shp. - Set the new file name under
Rasterized. - Click
Runto generate the raster layer. - The new raster will be visible in the
Layers Panel. - Click
Closewhen finished.
Convert raster to vector (vectorize)
Convert the new rainfall raster back to vector format.
- In the
Processing Toolboxsearch field, typepolygonize. - Double-click
Polygonize (raster to vector). - Select the rainfall raster as the input layer.
- The rainfall values used in the vector conversion above will be added to the new vector. Type
rainfallinName of the field to create. - Set the new file name under
Vectorized. - Click
Runto generate the vector layer. - The new vector will be visible in the
Layers Panel. - Click
Closewhen finished.