[GRASS-user] Merge polygone with same attribut of a shapefile

Nikos Alexandris nik at nikosalexandris.net
Thu May 16 06:24:05 PDT 2013


BLANDENIER Lucien wrote:

> Dear all,

Hi Lucien,

> I'm trying to merge all polygones with the same attribut of a shapefile. I
> saw it is possible to merge adjacent polygone with r.dissolve

Small correction:  it is v.dissolve (all v.* modules operate on vector maps as 
opposed to r.* modules which operate on raster maps).

> but I didn't found how to do this with polygones that are not adjacent. Is
> there a way to do this?

I don't know/I don't think so.  GRASS' vector model is a topologically aware 
system. This means that it "understands", exactly, adjacent geographic 
components.  Being so, by design, supports a clean geometry (for example, non 
duplication of features) and sound vector-based analyses.

If I get the "picture" correct, there is no possibility to topologically merge 
distinct and spatially non-related geographic features.

> My goal is to minimise the number of feature into my table in order to have
> only one feature by category, but containing several polygones.

What is the reason to worry about the number of vector features in a vector 
map?  The only way to minimise features is by eliminating them, which is 
rather unwanted.

You might want to read

- "Vector object categories and attribute management" section in the "Vector 
data processing in GRASS GIS" manual: 
<http://grass.osgeo.org/grass64/manuals/vectorintro.html>
- "Developer's Vector FAQ" <http://grass.osgeo.org/programming7/vlibFAQ.html>

Each unique vector feature holds internally (that is, not exposed to the user) 
a unique "feature id" (this is a 1:1 relationship).  The user can, however, 
use the concept of Categories (another identification number), to assign a 
vector feature to a category.  Categories are not unique and they _can_ be 
(mis-)used to link to several vector features (this is a "1 Cat":"Many vector 
features" relationship).  Note, the user can use them as being unique!  Also, 
any vector feature can be linked to several category ids (this is a "1 Vector" 
: "Many Categories" relationship).

The other interesting concept, in GRASS GIS, is the one of multiple layers.  
The user can link multiple attribute tables by using multiple layers 
(<http://grass.osgeo.org/programming7/vectorlib.html#vlibCategoriesLayers>).

So, maybe (inside GRASS GIS) you simply need to assign the same category to 
many polygons?

Best, Nikos


More information about the grass-user mailing list