<div dir="ltr">Hi Moritz,<div><br></div><div>The two-step v.category approach (del + add) and an additional v.to.db()  was the</div><div>right way. Now I have the problem that there are 3 categories reported for</div><div>one single line that got split into to (1 old cat + 2 new cats). The old category is still</div><div>associated with attributes but the two new rows are empty. How can</div><div>I get an attribute table that contains only rows for the new cats with the attribute information</div><div>of the old category?</div><div><br></div><div>Here a working example (in the NC location) for illustrating my problem:</div><div>### Import test line to GRASS GIS<br></div><div><div>echo "ORGANIZATION: GRASS Development Team</div><div>DIGIT DATE:   03/12/2015</div><div>DIGIT NAME:   -</div><div>MAP NAME:     test_lines</div><div>MAP DATE:     2015</div><div>MAP SCALE:    10000</div><div>OTHER INFO:   test lines</div><div>ZONE:  0</div><div>MAP THRESH:   0.500000</div><div>VERTI:</div><div>L  3 1</div><div> 641045.70521951 218398.66077254</div><div> 641049.6221644 218261.56770124</div><div> 641026.12049504 218155.8101891</div><div> 1     5" | v.in.ascii --o format=standard input=- output=test_lines</div><div><br></div><div># Add attribute table to imported line</div><div>v.db.addtable map=test_lines</div><div><br></div><div># Add some attributes to table including the original cat as attribute</div><div>v.db.addcolumn map=test_lines@fidimo_test columns="col1 INT, old_cat INT"</div><div>v.db.update map=test_lines@fidimo_test column=col1 value=42</div><div>v.db.update map=test_lines@fidimo_test column=old_cat query_column=cat</div><div> </div><div># Import Point</div><div>echo "100|641045.940579|218320.669742" | v.in.ascii --o input=- output=mypoints x=2 y=3 cat=1</div><div><br></div><div># Create network</div><div><a href="http://v.net">v.net</a> -s --overwrite input=test_lines \</div><div>points=mypoints output=test_net operation=connect threshold=25</div><div><br></div><div># Remove existing cats</div><div>v.category --overwrite input=test_net type=line cat=-1 output=test_net_nocat option=del</div><div><br></div><div># Add new cats</div><div>v.category --overwrite input=test_net_nocat type=line output=test_net_newcat option=add</div><div>v.to.db map=test_net_newcat type=line option=cat columns=cat</div></div><div>#############</div><div><br></div><div>The attribute table of the final vector (test_net_newcat) should contain only two rows for</div><div>cat 1 and 2 with the original attribute information for both rows. Is that somehow possible</div><div>in GRASS?</div><div><br></div><div>/Johannes</div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Dec 2, 2015 at 4:55 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 02/12/15 15:40, Johannes Radinger wrote:<br>
</span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi all,<br>
<br>
I built a GRASS7 network using <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>>:<span class=""><br>
<br>
First, I used the 'connect' option to snap some points to my network<br>
(using the -s flag)<br>
Second, I used that first network and also added all nodes with the<br>
'nodes' option to get a final network.<br>
<br></span>
With the 'report' option of <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>> I can report all edges<span class=""><br>
with their start and end end points. However, these edges of the final<br>
network are based on the initial category values of the input vector.<br>
How can I get the network split into single lines with unique IDs<br>
between each node of the final network. In other words I want a report<br></span>
of <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>> that contains only unique edge categories? I'd<br>
like to write the output of <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>> into a new table and<span class=""><br>
assign lengths to each edge.<br>
<br>
For example, at the moment, a line with cat=300 is confined by a start<br></span>
node cat=1 and an end node cat=2. For that case <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>><span class=""><br>
reports:<br>
300 1 2<br>
<br>
If I connect a new node with cat=3 along that line and calculate <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a><br></span>
<<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>>, it reports:<span class=""><br>
300 1 3<br>
300 3 2<br>
<br>
Any ideas/suggestions? Maybe I need to 'break' the network lines at each<br></span>
node before running <a href="http://v.net" rel="noreferrer" target="_blank">v.net</a> <<a href="http://v.net" rel="noreferrer" target="_blank">http://v.net</a>>?<br>
</blockquote>
<br>
How about v.category op=delete type=line followed by v.category op=add type=line ?<span class="HOEnZb"><font color="#888888"><br>
<br>
Moritz<br>
</font></span></blockquote></div><br></div>