[GIS] Converting raster to vector in QGIS

qgisvectorization

I have reclassed my data so show areas were wind speed is greater than 5m/s and were it is not.

I have converted this raster file to a vector file however it showing as one single colour and not defining between the white and black separated boundaries in the raster file.

I have looked at the style menu and tried to change the colours but nothing seems to work.enter image description here

enter image description here

Best Answer

Assuming your raster cell values are now stored in the vector layer as attributes, all you need to do is style the vector layer.

  1. Select the vector layer in the Layer panel, and open the Layer Styling panel. Choose "Rule-Based" style from the dropdown menu.
  2. Add a new rule based on the attribute table field where the raster cell values are stored. Substitute the actual field name into this expression where it says rastervalue:

    "rastervalue" < 5
    

    enter image description here

  3. Add a second rule for "rastervalue" > 5

  4. Style the first rule with black fill, and the second rule with white fill. Make the boundaries 'no pen' if you don't want to see an outline around every polygon.

enter image description here

This topic is explained in more detail in the QGIS training manual, Lesson 4.3.5: Rule Based Classification.

Related Question