I have combined different layers (vector) in a merged layer. All layers had one specific land-use type, so now the new layer has fields called 'tree', 'paved', 'building', 'water' and 'plants'. All these fields either have value 1 or 0. (1 for when this feature has the specific land use and 0 if it doesn't). This means that all features only have one '1' (either in tree, paved, building, water or plants). The other of those fields will then just have 0.

Now I want to add those fields to a new field, so that this field has the type of land cover for each feature, (combine type of land cover into one field basically).

How do I do this?


Assuming you want a new layer of type string, you can use an expression similar to the following:

  WHEN "tree" = 1 THEN 'tree'
  WHEN "paved" = 1 THEN 'paved'
  WHEN "building" = 1 THEN 'building'
  WHEN "water" = 1 THEN 'water'
  WHEN "plants" = 1 THEN 'plants'
  ELSE 'unknown'
| improve this answer | |
  • Thank you! This helped. I think, however, that i'm facing a bigger overlapping problem. I have this map with those different kinds of land cover as earlier outlined (I have them combined in one shapefile, and also as seperatre shapefiles). I want to overlay a 50 by 50 meter grid of the cells get assigned the landcover that is most prominant. Say 60% is paved and 40% is low plants in a cell, then I want this cell to be 'paved'. How do I do this? Should I first make a raster file and apply zonal statistics? Should I use separate layers? Or use the combined shapefile? Hope you can help me! – Demi Vonk Apr 17 '18 at 16:58
  • As you suggest, zonal statistics would probably be the best way to go in my opinion (with the land cover as a raster). It should be also possible to work directly on vector layers (this post might help : Percentage of polygon in one shapefile within polygon of another). I suggest you to post a new question with all the details you mentioned (and maybe a screenshot or 2) since this quite changes the scope of the question ;) – ArMoraer Apr 17 '18 at 18:33

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