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!

  • Do you need the merged polygons for anything else but coverting them to raster? – underdark Aug 19 '11 at 13:59
  • 1
    At present there are 208 classes and I need something around 20 to have something to work with. I found the solution already. reclass would be the magic word. sadly I cannot answer yet my own questions, otherwise I could explain a bit more. What I needed wass either r.reclass or v.reclass. I found it after skimming again through the GRASS book. Sorry for my confusing terminology earlier. – Jens Oldeland Aug 19 '11 at 18:46

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).

| improve this answer | |

You could select your polygons and then calculate a new field to use to dissolve on. Or, as underdark says, if you only need them to create the raster, just export your selection to a new file, and convert that to raster.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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