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

BLANDENIER Lucien lucien.blandenier at unine.ch
Thu May 16 07:13:40 PDT 2013


Thank you Vincent and Nikos for your answers,

Of course I mean v.dissolve and not r.dissolve...

Maybe I'm not clear enough wiht my problem... 

To explain what I want to obtain : 
I've created such a shapfile in qgis using the tool "add part". I have then one feature with two polygone (see attached files).
Then I've imported this shapfile into GRASS and I also see one feature with two polygones.

Is it possible to create such files with GRASS and in my case to merge different non-adjacent polygone into one polygone?

The reason of this is I have to do statistics (v.rast.stats) with this shp and I want to consider all the features of a category for calculating the stats and the feature separated. (e.g. I want to have the mean of all pixels contained in the polygones of the same category and for each polygones separately)

regards


________________________________________
De : grass-user-bounces at lists.osgeo.org [grass-user-bounces at lists.osgeo.org] de la part de Nikos Alexandris [nik at nikosalexandris.net]
Date d'envoi : jeudi 16 mai 2013 15:24
À : grass-user at lists.osgeo.org
Objet : Re: [GRASS-user] Merge polygone with same attribut of a shapefile

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
_______________________________________________
grass-user mailing list
grass-user at lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polygones.dbf
Type: application/octet-stream
Size: 188 bytes
Desc: test_polygones.dbf
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130516/cdb4199c/attachment-0003.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polygones.prj
Type: application/octet-stream
Size: 143 bytes
Desc: test_polygones.prj
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130516/cdb4199c/attachment-0004.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polygones.qpj
Type: application/octet-stream
Size: 257 bytes
Desc: test_polygones.qpj
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130516/cdb4199c/attachment-0005.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polygones.shp
Type: application/x-qgis
Size: 484 bytes
Desc: test_polygones.shp
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130516/cdb4199c/attachment-0001.shp>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test_polygones.shx
Type: application/x-qgis
Size: 108 bytes
Desc: test_polygones.shx
URL: <http://lists.osgeo.org/pipermail/grass-user/attachments/20130516/cdb4199c/attachment-0001.shx>


More information about the grass-user mailing list