[GRASS-user] v.patch and cat values

Hi,

I've just patched to vector maps together, using v.patch, followed by
v.clean and v.db.addtable to add "reg_name varchar(40)". This all
worked well, so I then turned to populating reg_name using d.what.rast
-e. This also worked without problem. However, I now realize that the
table created for this new vector map has given areas from the two
different maps input to v.patch the same cat number. So when I edit
the reg_name for an area from input map 1, it also applies that
edit to an area from input map 2.

Is there a way to re-assign cat numbers to the areas in my map so that
I can give them unique names? Ideally without having to repeat the
v.patch step, as I've spent a couple hours doing d.what.rast editing!

--
Regards,

Tyler Smith

On Tuesday 06 March 2007 08:46, Tyler Smith wrote:

Hi,

I've just patched to vector maps together, using v.patch, followed by
v.clean and v.db.addtable to add "reg_name varchar(40)". This all
worked well, so I then turned to populating reg_name using d.what.rast
-e. This also worked without problem. However, I now realize that the
table created for this new vector map has given areas from the two
different maps input to v.patch the same cat number. So when I edit
the reg_name for an area from input map 1, it also applies that
edit to an area from input map 2.

Is there a way to re-assign cat numbers to the areas in my map so that
I can give them unique names? Ideally without having to repeat the
v.patch step, as I've spent a couple hours doing d.what.rast editing!

Hi Tyler,

see v.category for details on re-assigning cats.

--
Dylan Beaudette
Soils and Biogeochemistry Graduate Group
University of California at Davis
530.754.7341

Tyler Smith wrote:

Hi,

I've just patched to vector maps together, using v.patch, followed by
v.clean and v.db.addtable to add "reg_name varchar(40)". This all
worked well, so I then turned to populating reg_name using d.what.rast
-e. This also worked without problem. However, I now realize that the
table created for this new vector map has given areas from the two
different maps input to v.patch the same cat number. So when I edit
the reg_name for an area from input map 1, it also applies that
edit to an area from input map 2.

Is there a way to re-assign cat numbers to the areas in my map so that
I can give them unique names? Ideally without having to repeat the
v.patch step, as I've spent a couple hours doing d.what.rast editing!

when it patches them, does it create two layers? (no idea, but it might)

see v.reclass to reassign the cat column.
see v.to.db to populate columns from map features, also v.distance.

Hamish

On Wed, Mar 07, 2007 at 04:10:54PM +1300, Hamish wrote:

>
> Is there a way to re-assign cat numbers to the areas in my map so that
> I can give them unique names? Ideally without having to repeat the
> v.patch step, as I've spent a couple hours doing d.what.rast editing!

when it patches them, does it create two layers? (no idea, but it might)

see v.reclass to reassign the cat column.
see v.to.db to populate columns from map features, also v.distance.

Thanks both of you for your suggestions. I used v.category to add a
new cat, which I had to add in a separate layer, and then added it to
the database for the vector:

v.category input=na_ecoregions output=na_ecoregions_cats option=add
layer=3 --overwrite
v.to.db map=na_ecoregions_cats layer=3 option=cat
v.db.connect map=na_ecoregions_cats layer=3 table=na_ecoregions_cats

The output of a
typical d.what.vect is:

map: 'select_ecoregions'
mapset: 'tyler'
feature type: Centroid

Layer: 1
category: 77
driver: dbf
database: /home/tyler/grassdata/worldclim/tyler/dbf/
table: select_ecoregions_1
key column: cat
cat : 77
reg_name : Northern Lakes and Forests

Layer: 3
category: 912
driver: dbf
database: /home/tyler/grassdata/worldclim/tyler/dbf/
table: select_ecoregions_3
key column: cat
cat : 912
reg_name :

Is there a way to transfer the reg_name field from layer 1 to layer 3?
That would leave me with a handful of areas to correct manually. I
tried to use r.reclass for this:

v.reclass input=select_ecoregions output=sel_ecoreg2 column=cat
layer=3

This didn't work. The reclassed map appears to be the same as the
original map.

--
Regards,

Tyler Smith

Tyler Smith wrote:

Is there a way to transfer the reg_name field from layer 1 to layer 3?

v.category option=chlayer should do that I guess (haven't tried it,
please report whether it works, if you try it)

Maciek