<div dir="ltr"><div><div><div>Hi Moritz,<br></div>hi all,<br><br>sorry for my late response. I can now provide an example using the NC dataset.<br></div>First I needed to generate data (rasterized line/river) similar to the data input I am using.<br>
</div><div>So I transformed the streams vector into a raster using the attribute column FCODE as<br></div><div>value for the raster (v.to.rast input=streams@PERMANENT output=r_streams column=FCODE)<br></div><div>Thereafter I thinned the raster (r.thin input=r_streams@PERMANENT output=r_streams_thin). The<br>
output corresponds to a map similar to my original map I am using.<br><br></div><div>Now I wanted to (back-)transform the raster map back to lines where the resulting line segments should<br>correspond to the segments visible in the raster map <br>
(r.to.vect input=r_streams_thin@PERMANENT output=v_r_streams_thin feature=line). However, lines<br></div><div>are broken only where different lines join. <br><br>I attached a screenshot that illustrates my task. You can see the raster map with three <br>
different segments (two different values) for that single tribuatry  (indicated by blue-yellow-blow). <br>However when the raster gets transformed into a line this information gets lost, as lines <br>are not broken where a new raster value starts. Any suggestions how to solve such<br>
</div><div>a task?<br><br></div><div>cheers,<br>Johannes<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Tue, Jan 28, 2014 at 9:31 AM, 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"><div class="HOEnZb"><div class="h5">On 27/01/14 11:27, Johannes Radinger wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
I have a raster river (processed with r.thin) which I want to transfrom<br>
to a vector.<br>
Therefore I use r.to.vect with the lines option. However, the raster has<br>
two different<br>
values representing e.g. habitat quality (good/bad) for single segments<br>
(group of raster cells). This information is written strangely to the<br>
vector attribute table as the lines<br>
are not broken at changes of habitat quality which is a reasonable<br>
behaviour of r.to.vect.<br>
<br>
As I need the attributes in my vector table I thought about splitting<br>
the vector into<br>
small segments (<raster resolution) and updating the attribute table<br>
with v.what.rast. However when I use v.split the attribute table of the<br>
created map still has the same number of entries than before. So what do<br>
I miss here to get single rows and thus categories for the single<br>
created lines from v.split?<br>
<br>
Or is there any other/better way for such transformation of raster lines<br>
to vector lines incl. an update of the attribute table?<br>
</blockquote>
<br></div></div>
I'm not sure I totally understand your problem (an example with the NC data would probably help), but have you tried the '-v' flag (Use raster values as categories instead of unique sequence) of r.to.vect ?<span class="HOEnZb"><font color="#888888"><br>

<br>
Moritz<br>
</font></span></blockquote></div><br></div>