Opened 9 years ago

Closed 8 years ago

#2618 closed defect (fixed)

v.category option=transfer does not copy multiple cat values

Reported by: ulf Owned by: grass-dev@…
Priority: normal Milestone: 7.0.4
Component: Vector Version: 7.0.0
Keywords: v.category transfer Cc:
CPU: x86-64 Platform: Linux

Description

v.vector with option=transfer only copies one category value when a feature has multiple category values in the same layer. An example to explain what I mean:

echo "100|100|1" | v.in.ascii output=test input=-
fid=$(v.edit --quiet layer=1 map=test tool=select cat=1)
v.edit map=test layer=1 tool=catadd ids=${fid} cats=2

Now,

v.category option=print layer=1 input=test2

outputs "1/2", but

v.category option=print layer=2 input=test2

outputs "1". I would expect "1/2"...

Change History (9)

comment:1 by ulf, 9 years ago

One row disappeared from my example - to create map test2 i did the following:

echo "100|100|1" | v.in.ascii output=test input=-
fid=$(v.edit --quiet layer=1 map=test tool=select cat=1)
v.edit map=test layer=1 tool=catadd ids=${fid} cats=2
v.category option=transfer layer=1,2 input=test output=test2

Sorry about that, Ulf

comment:2 by mmetz, 9 years ago

Summary: v.vector option=transfer does not copy multiple cat valuesv.category option=transfer does not copy multiple cat values

Fixed in r64825,6 (trunk, relbr70).

comment:3 by mlennert, 9 years ago

Can this be closed ?

comment:4 by wenzeslaus, 9 years ago

I added the commands as a Bash test case in r65485 but I actually don't understand what the output means here (why it is the same for layer=1 and layer=2?) and what option=transfer does. It would be good if somebody can review it and/or comment in the test.

Side note: The Bash script tests (test cases, test files) are really easy to create. Just look at r65485. They have a lot of problems and the solution is not scalable but it is better than no test!

comment:5 by neteler, 9 years ago

Milestone: 7.0.17.0.2

Ticket retargeted after 7.0.1 milestone closed

comment:6 by neteler, 8 years ago

Milestone: 7.0.27.0.3

Ticket retargeted after milestone closed

comment:7 by neteler, 8 years ago

Milestone: 7.0.3

Ticket retargeted after milestone closed

comment:8 by neteler, 8 years ago

Milestone: 7.0.4

Ticket retargeted after 7.0.3 milestone closed

comment:9 by mlennert, 8 years ago

Resolution: fixed
Status: newclosed

The fix seems to work and the test looks ok to me, so closing.

Note: See TracTickets for help on using tickets.