[GRASS-user] how to change all cats in a vector line

Markus Metz markus.metz.giswork at gmail.com
Sun Nov 30 23:51:45 PST 2014


Michael Barton wrote:
>
> First, for a stream profile, you want to isolate a single watercourse.
> r.stream.extract creates a stream network. Getting stream order does not
> help with profiling, however.
>
> I looked at r.stream.distance. But this calculates distance from each stream
> junction. I want it for the entire course of the selected stream—from
> headwaters to outlet. That is the only way to graph a stream profile for the
> entire stream.

You could use v.net + v.net.path to extract a single line from a given
headwaters to a given outlet. r.stream.distance should then use the
entire course of the selected stream. With a little loop this can be
done for all streams of interest.

Markus M

>
> Once I have a set of points with the distance from the beginning or the end
> of the line stored as an attribute for each point, the rest is easy. It is
> getting to this step that is hard.
>
> If a line is composed of multiple segments—as is the case for any line
> created with r.stream.extract or r.watershed, and also with r.drain
> surprisingly—there is nothing that will ignore all of these segments and
> just give me the distance along the line from one end to the other. This is
> the case with v.to.points and v.fixed.segmentpoints. v.profile might do the
> job but it is not available for GRASS 7.
>
> Michael
>
>
>
>
>
>
>
>
>
>
> On Nov 29, 2014, at 10:02 PM, grass-user-request at lists.osgeo.org wrote:
>
> From: César Augusto Ramírez Franco <caesarivs at gmail.com>
> To: GRASS User List <grass-user at lists.osgeo.org>
> Date: November 29, 2014 at 9:13:43 PM MST
> Subject: Re: [GRASS-user] how to change all cats in a vector line
>
>
> Hello Michael
> You could use r.stream.order after r.stream.extract to get your stream
> network ordered, and then, after running r.thin on the ordered stream
> network, convert it to vector using r.to.vect with the -v flag, that way,
> each order is a cat, you can them use v.to.points or the add-on suggested
> below to get topologically-correct points along the stream network, you
> could also use r.stream.distance and upload distance and elevation to each
> point using v.what.rast
> I usually run R from within GRASS and use the spgrass6 library to read the
> vector map and analyze the data there
> Regards
> César.
>
> El sáb, 29 de noviembre de 2014 06:29 p.m., Helmut Kudrnovsky
> <hellik at web.de> escribió:
>>
>> Michael Barton wrote
>> > Hi Markus,
>> >
>> > What I'm trying to do is start with a raster stream map from r.drain and
>> > convert it to a sequence of vector points, where each point has
>> > information as to its position along the stream. I then use the points
>> > for
>> > sampling a stream profile and related information. Oddly enough, with
>> > all
>> > of the very useful stream analysis modules, there is nothing I could
>> > find
>> > to generate the data for a stream profile (distance from outlet or from
>> > headwaters vs. elevation).
>> >
>> > v.to.points does a nice job of creating a sequence of evenly spaced
>> > points
>> > with information about their location along a line (the "along" field).
>> > BUT, if the line is composed of multiple segments or even if it has an
>> > irregularity in it, the "along" values start over again from 0. The only
>> > way I can use it is if I have a very clean and continuous vector line
>> > with
>> > only a single cat.
>> >
>> > This has proven surprisingly difficult to obtain reliably from my raster
>> > stream map. So far, the only way has been to do a two sequences of
>> > v.clean
>> > (with thresholds 1.5 X the raster resolution) and v.build.polylines. If
>> > you have any better suggestion, I'd love to hear it.
>> >
>> > Thanks again for the polylines idea. That was a big help.
>> >
>> > Michael
>> > ____________________
>> > C. Michael Barton
>> > Director, Center for Social Dynamics & Complexity
>> > Professor of Anthropology, School of Human Evolution & Social Change
>> > Head, Graduate Faculty in Complex Adaptive Systems Science
>> > Arizona State University
>> >
>> > voice:  480-965-6262 (SHESC), 480-965-8130/727-9746 (CSDC)
>> > fax: 480-965-7671 (SHESC),  480-727-0709 (CSDC)
>> > www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>> >
>
>
>
> _______________________________________________
> grass-user mailing list
> grass-user at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/grass-user


More information about the grass-user mailing list