<div dir="ltr">Moritz,<div>thank you! Your proposed approach solved my problem! <br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Dec 3, 2015 at 3:04 PM, Moritz Lennert <span dir="ltr"><<a href="mailto:mlennert@club.worldonline.be" target="_blank">mlennert@club.worldonline.be</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On 03/12/15 14:19, Johannes Radinger wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Moritz,<br>
<br>
The two-step v.category approach (del + add) and an additional v.to.db()<br>
was the<br>
right way. Now I have the problem that there are 3 categories reported for<br>
one single line that got split into to (1 old cat + 2 new cats). The old<br>
category is still<br>
associated with attributes but the two new rows are empty. How can<br>
I get an attribute table that contains only rows for the new cats with<br>
the attribute information<br>
of the old category?<br>
<br>
</blockquote></span>
[...]<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# Remove existing cats<br>
v.category --overwrite input=test_net type=line cat=-1<br>
output=test_net_nocat option=del<br>
</blockquote></span>
[...]<span class=""><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
# Add new cats<br>
v.category --overwrite input=test_net_nocat type=line<br>
output=test_net_newcat option=add<br>
v.to.db map=test_net_newcat type=line option=cat columns=cat<br>
#############<br>
</blockquote>
<br></span>
Instead of removing the existing cats, add new cats in a new layer and transfer the info into that layer's attribute table:<br>
<br>
<br>
v.category --overwrite input=test_net type=line output=test_net_newcat option=add layer=3<br>
v.db.addtable test_new_newcat layer=3<br>
v.db.addcolumn test_net_newcat lay=3 col="col1 int, old_cat int"<br>
v.to.db test_net_newcat layer=3 op=query col=col1 query_layer=1 query_colum=col1<br>
v.to.db test_net_newcat layer=3 op=query col=old_cat query_layer=1 query_colum=cat<br>
<br>
Just make sure to set arc_layer=3 in the network analysis modules.<br>
<br>
If you really want to have arcs in layer 1, you can use v.category op=transfer, but you will also have to change table connections of the layers with v.db.connect.<span class="HOEnZb"><font color="#888888"><br>
<br>
Moritz<br>
<br>
<br>
</font></span></blockquote></div><br></div>