[GRASSLIST:2657] v.patch (category IDs and descriptions) - supplement

I have some additional information (see my last posting):
When I convert the vector maps with v.to.rast to raster maps (map1.v to map1.r, map2.v to map2.r, map3.v to map3.r), I can see that the category descriptions of the grid cells from the original map2.v data in map3.r are overwritten with the descriptions of map1.v.

Any help is appreciated.

Christof

From: Christof Bigler <christof.bigler@colorado.edu>
Date: 16. Februar 2004 13:19:52 GMT-07:00
To: Grasslist <GRASSLIST@baylor.edu>
Subject: v.patch (category IDs and descriptions)

I merged two vector maps with v.patch in=map1.v,map2.v out=map3.v

map1.v has 988 categories, map2.v 362, and map3.v again 988 categories, apparently with the first 362 categories having the same ID.

v.report map1.v type=area:
# | description | count
2 1 1
3 2 1
4 1 1
5 3 1
...

v.report map2.v type=area:
# | description | count
2 1 1
3 2 1
4 2 1
5 3 1
...

v.report map3.v type=area:
# | description | count
2 1 2
3 2 2
4 1 2
5 3 2
...

This is quite confusing for new Grass users. It looks, as if there are non-unique category IDs in map3.v. And it looks that in map3.v the category descriptions of map2.v are overwritten by category descriptions of map1.v.

But since Grass uses an internal ID, I assume that the category descriptions of map2.v are (internally) not overwritten.

Can anybody enlighten me?

Christof

On Mon, 16 Feb 2004, Christof Bigler wrote:

I have some additional information (see my last posting):
When I convert the vector maps with v.to.rast to raster maps (map1.v to
map1.r, map2.v to map2.r, map3.v to map3.r), I can see that the
category descriptions of the grid cells from the original map2.v data
in map3.r are overwritten with the descriptions of map1.v.

Well I think that's just the way the program (v.patch) works...it's not a
bug...if you are patching two vector maps together you must first make sure
that the categories have the same meaning in both of them. If this is not
meaningful in your case then a simple 'patching' of the files is not what
you need and you need to edit your vector data or do something more
advanced.

Editing the dig_att and dig_cats file with a text processing program to
add some number to all the attribute numbers might be something to look
at.