[GRASS-user] Transforming raster lines to vectors with correct segment attributes

Moritz Lennert mlennert at club.worldonline.be
Mon Feb 3 04:48:30 PST 2014


On 03/02/14 11:48, Johannes Radinger wrote:
> Hi Moritz,
> hi all,
>
> sorry for my late response. I can now provide an example using the NC
> dataset.
> First I needed to generate data (rasterized line/river) similar to the
> data input I am using.
> So I transformed the streams vector into a raster using the attribute
> column FCODE as
> value for the raster (v.to.rast input=streams at PERMANENT output=r_streams
> column=FCODE)
> Thereafter I thinned the raster (r.thin input=r_streams at PERMANENT
> output=r_streams_thin). The
> output corresponds to a map similar to my original map I am using.
>
> Now I wanted to (back-)transform the raster map back to lines where the
> resulting line segments should
> correspond to the segments visible in the raster map
> (r.to.vect input=r_streams_thin at PERMANENT output=v_r_streams_thin
> feature=line). However, lines
> are broken only where different lines join.
>
> I attached a screenshot that illustrates my task. You can see the raster
> map with three
> different segments (two different values) for that single tribuatry
> (indicated by blue-yellow-blow).
> However when the raster gets transformed into a line this information
> gets lost, as lines
> are not broken where a new raster value starts. Any suggestions how to
> solve such
> a task?

Same response as last time: try the -v flag of r.to.vect.

Moritz



More information about the grass-user mailing list