[GRASS5] 5.7 how to merge polygons with same attribute ?

Hello,

How do I merge polygons with the same value for a given attribute in the
attribute table ?

For example: if I have a map of the world by countries, and for each country
an attribute "continent" in the database table with values such as "Europe",
"North America", etc, how could I create a map showing only the outlines of
the continents ?

Moritz

How do I merge polygons with the same value for a given attribute in
the attribute table ?

For example: if I have a map of the world by countries, and for each
country an attribute "continent" in the database table with values
such as "Europe","North America", etc, how could I create a map
showing only the outlines of the continents ?

maybe

v.extract out=eur -d where="continent='Europe'"
v.extract out=nam -d where="continent='North America'"
v.patch in=eur,nam

?

for a larger number of items (eg country='Grand Fenwick') I guess you'd
need a script containing a loop.

Hamish

Moritz Lennert wrote:

Hello,

How do I merge polygons with the same value for a given attribute in the
attribute table ?

For example: if I have a map of the world by countries, and for each country
an attribute "continent" in the database table with values such as "Europe",
"North America", etc, how could I create a map showing only the outlines of
the continents ?

v.reclass.

Radim

Radim and Hamish,

On Mon, December 13, 2004 9:40, Radim Blazek said:

Moritz Lennert wrote:

Hello,

How do I merge polygons with the same value for a given attribute in the
attribute table ?

For example: if I have a map of the world by countries, and for each country
an attribute "continent" in the database table with values such as "Europe",
"North America", etc, how could I create a map showing only the outlines of
the continents ?

v.reclass.

Is there a "dissolve common boundaries" flag in v.reclass ?

On Mon, December 13, 2004 2:26, Hamish said:

How do I merge polygons with the same value for a given attribute in
the attribute table ?

For example: if I have a map of the world by countries, and for each
country an attribute "continent" in the database table with values
such as "Europe","North America", etc, how could I create a map
showing only the outlines of the continents ?

maybe

v.extract out=eur -d where="continent='Europe'"
v.extract out=nam -d where="continent='North America'"
v.patch in=eur,nam

Thank you Hamish that does the trick, even though it is a bit tedious when you
have many categories...

A -d flag in v.reclass would probably be the easiest solution.

Moritz