[GIS] How to combine polygons in a vector with GRASS

geoprocessinggrassvector

I need to combine polygons of similar geological classes which are stored in a vector file called geology. I was looking for somethiing like "union selected features" or similar. In the GRASS Book 3ed I found that v.overlay could be useful, however I did not manage to merge/union my classes.

To illustrate it, here an example: I have a polygon with class (column MAIN_LITHO) 'biotite granite' but also 'biotite granite (foliated) and others. These should be all combined into one single multipolygon 'biotite granite'. Later, I want to turn that vector into a raster map but that should be easy.

here is also an image of that example

enter image description here

thank you in advance!

Best Answer

The combination of the polygons is fairly easy to obtain in three steps:

  • add a new column (v.db.addcol), copy over the values from either the cat column or the textual column (v.db.update);
  • Update the new column again with a selection of either the categories of interest or string selection (where="MAIN_LITHO LIKE 'biotite%'" ; requires a real SQL backend like SQLite or PostgreSQL) in order to obtain the same value for all biotite entries;
  • Finally run v.dissolve on this new column.

Then you will have the task solved (there is no need to rasterize).