[GRASS-user] v.patch and keeping the attributes

Mira Kattwinkel kattwinkel-mira at uni-landau.de
Mon Oct 29 10:03:13 PDT 2018


Dear list,

I would like to patch two vector maps together and keep their attributes 
(with the same columns but not in identical order) using v.patch with 
flag -e.

Both maps have cats starting with 1. Hence, I thought I use v.category, 
option 'add' to add a fixed (large enough value) to the categories and 
creating a second layer to keep the attribute values like this:
v.category input=map1 layer=2 type=line output=map1_cat option=add 
cat=100001

Then I add a table to layer 2 with a column for the old cat:
v.db.addtable map=map1_cat layer=2 columns="cat_lyr1 integer"

Next, I fill this column (I want to use this column to be able to later 
join the attributes from the original maps):
v.to.db map=map1_cat layer=2 type=line option=query columns=cat_lyr1 
query_column=cat

Finally, I would like to use v.patch with flag e. However, this works 
only for the table in layer 1. Hence, I wanted to use v.categroy to 
change the layer numbers:
v.category input=map1_cat layer=2,1 type=line output=map1_cat2 
option=chlayer

And get the warning: WARNING: Database connection and attribute tables 
for concerned layers are not changed

I tried to first drop the table in layer 1 with:
v.db.droptable -f map=map1_cat
and then use v.category but that results in the same warning as before. 
Layer 2 is still layer 2.

Can anybody please explain to me what is wrong? I am still struggling to 
get my head around categories and layers but I thought I found a way to 
do it correctly.

Thanks a lot,
Mira


-- 
Dr. Mira Kattwinkel
Quantitative Landscape Ecology
Institute for Environmental Sciences
University of Koblenz-Landau
Fortstra├če 7
76829 Landau
Germany
Phone: + 49 6341 280-31553
Office: Building I, Room 2.02



More information about the grass-user mailing list