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

2014-12-01 Thread Moritz Lennert

On 30/11/14 06:28, Michael Barton wrote:



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




Thanks César,

This is pretty much what I’m doing. However, it is not that simple, it
turns out.

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.

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


As MarkusN said: you have to use v.build.polylines with cats=first, but 
then it is easy to get total length with v.to.db or v.to.points if that 
is what you need (or many other options (get end node coordinates and 
use v.distance 'to_along' or MarkusM's suggestion: v.net.distance from 
start to end node along the stream).


Here's an example in the NC dataset, using r.stream.order to approximate 
the main stream:


g.region n=227440 s=221640 w=630220 e=637220 res=10
r.watershed --overwrite elevation=elevation@PERMANENT threshold=1 
accumulation=accum drainage=direction stream=streams
r.stream.order --overwrite stream_rast=streams@user1 
direction=direction@user1 elevation=elevation@PERMANENT 
accumulation=accum@user1 stream_vect=streams horton=horton

v.extract --overwrite input=streams@user1 where=horton=3 output=main_stream
v.build.polylines --overwrite input=main_stream@user1 
output=main_stream_poly cats=first


then: v.to.db  (result=11312.5) or

v.to.points input=main_stream@user1 output=main_stream_points dmax=1

db.select sql=select round(max(along)) from main_stream_points_2
round(max(along))
11312.5


Moritz
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2014-12-01 Thread Michael Barton
v.build.polylines is indeed part of what is needed. But it is not enough to be 
able to use v.to.points in the data I have—and this is not a weirdly meandering 
stream, just a Mediterranean barranco. 

A major part of the problem is in the raster to vector conversion. I’ve been 
using r.to.vect. But it breaks the resulting line into multiple segments and 
assigns different cat numbers to the segments. If the segments all connect 
cleanly, v.build.polylines may combine the segments. But I’ve tried using 
cat=first and it continues to assign multiple cats to the segments. To get a 
single line, what I have to do currently is:

v.clean
v.build.polylines with cats=no 
v.category with option=del ## may not be necessary but I’ve had enough 
inconsistent results to want to make sure on this
v.category with option=add cat=1 step=0 ## this gets me a vector with cat=1 for 
all parts.

repeat the above a 2nd time

This gives a sufficiently clean single-object line with a single cat number 
that I can run v.to.points on.

Maybe r.stream.order does a cleaner job in raster to vector conversion. It’s 
worth a try. Unfortunately, I can’t use the stream order info to extract a 
stream since I want the stream from its headwaters (stream order = 1) to its 
outlet (stream order  1).

Ideally, there would be a module where I could enter the coordinates of the 
upstream end of a stream, it would extract the entire watercourse as a single 
object to its downstream end, edge of map, or a defined outlet stop point. Then 
I could run v.to.points and v.what.rast to get profile data. OR in a a stream 
profile module, it would run these for me. I could do it in Python if I could 
extract a clean vector (one object, one cat, no loops or self-crossing) of a 
single stream from a stream network created with r.watershed or 
r.stream.extract. AFAICT, there is nothing available in GRASS that can do this. 
Kind of surprising.

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



On Dec 1, 2014, at 9:31 AM, Moritz Lennert mlenn...@club.worldonline.be wrote:

 On 30/11/14 06:28, Michael Barton wrote:
 
 
 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
 
 
 
 
 Thanks César,
 
 This is pretty much what I’m doing. However, it is not that simple, it
 turns out.
 
 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.
 
 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
 
 As MarkusN said: you have to use v.build.polylines with cats=first, but then 
 it is easy to get total length with v.to.db or v.to.points if that is what 
 you need (or many other options (get end node coordinates and use v.distance 
 'to_along' or MarkusM's suggestion: v.net.distance from start to end node 
 along the stream).
 
 Here's an example in the NC dataset, using r.stream.order to approximate the 
 main stream:
 
 g.region n=227440 s=221640 w=630220 e=637220 res=10
 r.watershed --overwrite elevation=elevation@PERMANENT threshold=1 
 accumulation=accum drainage=direction stream=streams
 r.stream.order --overwrite stream_rast=streams@user1 
 direction=direction@user1 elevation=elevation@PERMANENT 
 accumulation=accum@user1 stream_vect=streams horton=horton
 v.extract --overwrite input=streams@user1 where=horton=3 output=main_stream
 v.build.polylines --overwrite input=main_stream@user1 output=main_stream_poly 
 cats=first
 
 then: v.to.db  (result=11312.5) or
 
 v.to.points input=main_stream@user1 output=main_stream_points dmax=1
 

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

2014-12-01 Thread Johannes Radinger
Hi Michael,

I have not read the entire thread, but maybe follwowing might work
if you want to extract this upstream-downstream watercourse in raster
format:

1) Use r.cost with your outlet as starting point and your cell resolution as
cost surface. So the output is a pseudo-elevation
map with increasing values in upstream direction

2) use r.drain to extract the main course in downstream direction based on a
defined upstream end and the pseudo-elevation map created by r.cost.

3) Than you can use r.to.vect to convert your raster cells to vectors and
extract your distance per point (cummulative cost) and your elevation.

Maybe this might help in on or the other way.

best,
Johannes

On Mon, Dec 1, 2014 at 7:21 PM, Michael Barton michael.bar...@asu.edu
wrote:

 v.build.polylines is indeed part of what is needed. But it is not enough
 to be able to use v.to.points in the data I have—and this is not a weirdly
 meandering stream, just a Mediterranean barranco.

 A major part of the problem is in the raster to vector conversion. I’ve
 been using r.to.vect. But it breaks the resulting line into multiple
 segments and assigns different cat numbers to the segments. If the segments
 all connect cleanly, v.build.polylines may combine the segments. But I’ve
 tried using cat=first and it continues to assign multiple cats to the
 segments. To get a single line, what I have to do currently is:

 v.clean
 v.build.polylines with cats=no
 v.category with option=del ## may not be necessary but I’ve had enough
 inconsistent results to want to make sure on this
 v.category with option=add cat=1 step=0 ## this gets me a vector with
 cat=1 for all parts.

 repeat the above a 2nd time

 This gives a sufficiently clean single-object line with a single cat
 number that I can run v.to.points on.

 Maybe r.stream.order does a cleaner job in raster to vector conversion.
 It’s worth a try. Unfortunately, I can’t use the stream order info to
 extract a stream since I want the stream from its headwaters (stream order
 = 1) to its outlet (stream order  1).

 Ideally, there would be a module where I could enter the coordinates of
 the upstream end of a stream, it would extract the entire watercourse as a
 single object to its downstream end, edge of map, or a defined outlet stop
 point. Then I could run v.to.points and v.what.rast to get profile data. OR
 in a a stream profile module, it would run these for me. I could do it in
 Python if I could extract a clean vector (one object, one cat, no loops or
 self-crossing) of a single stream from a stream network created with
 r.watershed or r.stream.extract. AFAICT, there is nothing available in
 GRASS that can do this. Kind of surprising.

 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



 On Dec 1, 2014, at 9:31 AM, Moritz Lennert mlenn...@club.worldonline.be
 wrote:

  On 30/11/14 06:28, Michael Barton wrote:
 
  
  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
 
 
 
 
  Thanks César,
 
  This is pretty much what I’m doing. However, it is not that simple, it
  turns out.
 
  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.
 
  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
 
  As MarkusN said: you have to use v.build.polylines with cats=first, but
 then it is easy to get total length with v.to.db or v.to.points if that is
 what you need (or many other options (get end node coordinates and use
 v.distance 

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

2014-12-01 Thread Michael Barton
This is exactly what I’m doing. The problems come when I want to sample the 
vector stream at regular intervals. r.to.vect splits the resulting vector line 
into multiple segments with different cats for some reason.

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















On Dec 1, 2014, at 11:51 AM, Johannes Radinger 
johannesradin...@gmail.commailto:johannesradin...@gmail.com wrote:

Hi Michael,

I have not read the entire thread, but maybe follwowing might work
if you want to extract this upstream-downstream watercourse in raster format:

1) Use r.cost with your outlet as starting point and your cell resolution as
cost surface. So the output is a pseudo-elevation
map with increasing values in upstream direction

2) use r.drain to extract the main course in downstream direction based on a
defined upstream end and the pseudo-elevation map created by r.cost.

3) Than you can use r.to.vect to convert your raster cells to vectors and
extract your distance per point (cummulative cost) and your elevation.

Maybe this might help in on or the other way.

best,
Johannes

On Mon, Dec 1, 2014 at 7:21 PM, Michael Barton 
michael.bar...@asu.edumailto:michael.bar...@asu.edu wrote:
v.build.polylines is indeed part of what is needed. But it is not enough to be 
able to use v.to.points in the data I have—and this is not a weirdly meandering 
stream, just a Mediterranean barranco.

A major part of the problem is in the raster to vector conversion. I’ve been 
using r.to.vect. But it breaks the resulting line into multiple segments and 
assigns different cat numbers to the segments. If the segments all connect 
cleanly, v.build.polylines may combine the segments. But I’ve tried using 
cat=first and it continues to assign multiple cats to the segments. To get a 
single line, what I have to do currently is:

v.clean
v.build.polylines with cats=no
v.category with option=del ## may not be necessary but I’ve had enough 
inconsistent results to want to make sure on this
v.category with option=add cat=1 step=0 ## this gets me a vector with cat=1 for 
all parts.

repeat the above a 2nd time

This gives a sufficiently clean single-object line with a single cat number 
that I can run v.to.points on.

Maybe r.stream.order does a cleaner job in raster to vector conversion. It’s 
worth a try. Unfortunately, I can’t use the stream order info to extract a 
stream since I want the stream from its headwaters (stream order = 1) to its 
outlet (stream order  1).

Ideally, there would be a module where I could enter the coordinates of the 
upstream end of a stream, it would extract the entire watercourse as a single 
object to its downstream end, edge of map, or a defined outlet stop point. Then 
I could run v.to.points and v.what.rast to get profile data. OR in a a stream 
profile module, it would run these for me. I could do it in Python if I could 
extract a clean vector (one object, one cat, no loops or self-crossing) of a 
single stream from a stream network created with r.watershed or 
r.stream.extract. AFAICT, there is nothing available in GRASS that can do this. 
Kind of surprising.

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.eduhttp://csdc.asu.edu/



On Dec 1, 2014, at 9:31 AM, Moritz Lennert 
mlenn...@club.worldonline.bemailto:mlenn...@club.worldonline.be wrote:

 On 30/11/14 06:28, Michael Barton wrote:

 
 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.eduhttp://csdc.asu.edu/




 Thanks César,

 This is pretty much what I’m doing. However, it is not that simple, it
 turns out.

 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 

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

2014-12-01 Thread Michael Barton
Thanks to all who replied to this vexing problem. My postdoc Isaac Ullah found 
what seems to be a good solution to part of this. 

v.net.path appears to extract a single object, single cat vector line from a 
stream network if we can give it a starting and ending point.

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




On Dec 1, 2014, at 11:21 AM, Michael Barton michael.bar...@asu.edu wrote:

 v.build.polylines is indeed part of what is needed. But it is not enough to 
 be able to use v.to.points in the data I have—and this is not a weirdly 
 meandering stream, just a Mediterranean barranco. 
 
 A major part of the problem is in the raster to vector conversion. I’ve been 
 using r.to.vect. But it breaks the resulting line into multiple segments and 
 assigns different cat numbers to the segments. If the segments all connect 
 cleanly, v.build.polylines may combine the segments. But I’ve tried using 
 cat=first and it continues to assign multiple cats to the segments. To get a 
 single line, what I have to do currently is:
 
 v.clean
 v.build.polylines with cats=no 
 v.category with option=del ## may not be necessary but I’ve had enough 
 inconsistent results to want to make sure on this
 v.category with option=add cat=1 step=0 ## this gets me a vector with cat=1 
 for all parts.
 
 repeat the above a 2nd time
 
 This gives a sufficiently clean single-object line with a single cat number 
 that I can run v.to.points on.
 
 Maybe r.stream.order does a cleaner job in raster to vector conversion. It’s 
 worth a try. Unfortunately, I can’t use the stream order info to extract a 
 stream since I want the stream from its headwaters (stream order = 1) to its 
 outlet (stream order  1).
 
 Ideally, there would be a module where I could enter the coordinates of the 
 upstream end of a stream, it would extract the entire watercourse as a single 
 object to its downstream end, edge of map, or a defined outlet stop point. 
 Then I could run v.to.points and v.what.rast to get profile data. OR in a a 
 stream profile module, it would run these for me. I could do it in Python if 
 I could extract a clean vector (one object, one cat, no loops or 
 self-crossing) of a single stream from a stream network created with 
 r.watershed or r.stream.extract. AFAICT, there is nothing available in GRASS 
 that can do this. Kind of surprising.
 
 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
 
 
 
 On Dec 1, 2014, at 9:31 AM, Moritz Lennert mlenn...@club.worldonline.be 
 wrote:
 
 On 30/11/14 06:28, Michael Barton wrote:
 
 
 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
 
 
 
 
 Thanks César,
 
 This is pretty much what I’m doing. However, it is not that simple, it
 turns out.
 
 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.
 
 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
 
 As MarkusN said: you have to use v.build.polylines with cats=first, but then 
 it is easy to get total length with v.to.db or v.to.points if that is what 
 you need (or many other options (get end node coordinates and use 

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

2014-12-01 Thread Helmut Kudrnovsky
But I’ve tried using cat=first and it continues to assign multiple cats to
the segments. 

tested here on my side.

from the manual:

cats=no - No category number is assigned to a polyline. Also attributes
tables linked to the input vector map are not copied to the output vector
map.
cats=first - Assign to a polyline category number of the first line. All
linked attributes tables are copied to the output vector map.
cats=multi - If the lines that make up a polyline have different
category numbers then v.build.polylines will set the multiple catetory
numbers to a polyline. Also all linked attributes tables are copied to the
output vector map.

none of this options seems to work, as always all cats are copied to the
attribute table.

bug in v.build.polylines?



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175849.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-30 Thread Michael Barton
You’re right of course. I was getting it confused with v.profile (I’ve gone 
through a lot of different modules searching for something that works recently).

But v.fixed.segmentpoints appears to only create points for a single cat. For 
the kinds of lines that represent stream courses and which are generated by  
r.to.vect on the cells created by v.stream.extract, r.watershed, or even 
r.drain, this won’t work. It only creates points for part of the stream course.

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




On Nov 30, 2014, at 1:22 AM, 
grass-user-requ...@lists.osgeo.orgmailto:grass-user-requ...@lists.osgeo.org 
wrote:


From: Helmut Kudrnovsky hel...@web.demailto:hel...@web.de
To: grass-user@lists.osgeo.orgmailto:grass-user@lists.osgeo.org
Date: November 30, 2014 at 12:01:49 AM MST
Subject: Re: [GRASS-user] how to change all cats in a vector line


I saw this but apparently it is not available for GRASS 7.

it is as I wrote it for grass 7.

doesn't g.extension do the job?




___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-30 Thread Helmut Kudrnovsky
v.fixed.segmentpoints is just a wrapper script of v.Segment

http://grass.osgeo.org/grass71/manuals/v.segment.html

v.segment is very flexible.

you have to define rules (e.g. lines with different cats). IMHO it's the way
to go if the river segments have different cats.

in v.fixed.segmentpoints I've implemented that the attribute table contains
the distance from source, but that's not implemented in v.segment.



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175693.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user


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

2014-11-30 Thread Michael Barton
Thanks for mentioning v.segment Helmut.

If I read the docs correctly, it is necessary to send v.segment a text string 
or file with one line for each point to be created, indicating which cat in the 
line object is being referenced. I’m trying to automate this for different 
streams where there can be a variable number of cats, representing line 
segments of different lengths. And I’m trying to create somewhere between 
several hundred to several thousand points. So a wrapper like 
v.fixed.segmentpoint makes more sense, but would need to work for an entire 
line object or for a set of cats (rather than a single cat).

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















On Nov 30, 2014, at 12:21 PM, 
grass-user-requ...@lists.osgeo.orgmailto:grass-user-requ...@lists.osgeo.org 
wrote:

From: Helmut Kudrnovsky hel...@web.demailto:hel...@web.de
To: grass-user@lists.osgeo.orgmailto:grass-user@lists.osgeo.org
Date: November 30, 2014 at 12:04:09 PM MST
Subject: Re: [GRASS-user] how to change all cats in a vector line


v.fixed.segmentpoints is just a wrapper script of v.Segment

http://grass.osgeo.org/grass71/manuals/v.segment.html

v.segment is very flexible.

you have to define rules (e.g. lines with different cats). IMHO it's the way
to go if the river segments have different cats.

in v.fixed.segmentpoints I've implemented that the attribute table contains
the distance from source, but that's not implemented in v.segment.



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175693.html
Sent from the Grass - Users mailing list archive at 
Nabble.comhttp://nabble.com/.


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-30 Thread Helmut Kudrnovsky
Michael Barton wrote
 Thanks for mentioning v.segment Helmut.
 
 If I read the docs correctly, it is necessary to send v.segment a text
 string or file with one line for each point to be created, indicating
 which cat in the line object is being referenced. I’m trying to automate
 this for different streams where there can be a variable number of cats,
 representing line segments of different lengths. And I’m trying to create
 somewhere between several hundred to several thousand points. So a wrapper
 like v.fixed.segmentpoint makes more sense, but would need to work for an
 entire line object or for a set of cats (rather than a single cat).
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 On Nov 30, 2014, at 12:21 PM, 

 grass-user-request@.osgeo

 lt;mailto:

 grass-user-request@.osgeo

 gt; wrote:
 
 From: Helmut Kudrnovsky lt;

 hellik@

 lt;mailto:

 hellik@

 gt;
 To: lt;

 grass-user@.osgeo

 lt;mailto:

 grass-user@.osgeo

 gt;
 Date: November 30, 2014 at 12:04:09 PM MST
 Subject: Re: [GRASS-user] how to change all cats in a vector line
 
 
 v.fixed.segmentpoints is just a wrapper script of v.Segment
 
 http://grass.osgeo.org/grass71/manuals/v.segment.html
 
 v.segment is very flexible.
 
 you have to define rules (e.g. lines with different cats). IMHO it's the
 way
 to go if the river segments have different cats.
 
 in v.fixed.segmentpoints I've implemented that the attribute table
 contains
 the distance from source, but that's not implemented in v.segment.
 
 
 
 -
 best regards
 Helmut
 --
 View this message in context:
 http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175693.html
 Sent from the Grass - Users mailing list archive at
 Nabble.comlt;http://nabble.com/gt;.
 
 
 
 ___
 grass-user mailing list

 grass-user@.osgeo

 http://lists.osgeo.org/mailman/listinfo/grass-user

what about a script with a loop through all line cats by using
v.fixed.segmentpoints?

in v.fixed.segmentpoints I've implemented that only distance between the
points (e.g. every 5 meter) has to be given, the calculation for any length
is done automatically.



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175728.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-30 Thread Markus Metz
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-requ...@lists.osgeo.org wrote:

 From: César Augusto Ramírez Franco caesar...@gmail.com
 To: GRASS User List grass-user@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
 hel...@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@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Markus Neteler
On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton michael.bar...@asu.edu wrote:
 I have a vector line that is divided into 12 cat values. I’d like all of the
 line to have a single cat value. I’ve tried v.category to no avail. If I
 delete all categories and then add new categories, I get 12 cats again. And
 I can find no other way to get a single cat for the entire line. Hopefully
 someone can tell what I’m missing here.

Please try to use
http://grass.osgeo.org/grass70/manuals/v.build.polylines.html

Markus
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Michael Barton
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




 On Nov 29, 2014, at 10:20 AM, Michael Barton michael.bar...@asu.edu wrote:
 
 Thanks. This helped.
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 On Nov 29, 2014, at 1:23 AM, Markus Neteler nete...@osgeo.org wrote:
 
 On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton michael.bar...@asu.edu 
 wrote:
 I have a vector line that is divided into 12 cat values. I’d like all of the
 line to have a single cat value. I’ve tried v.category to no avail. If I
 delete all categories and then add new categories, I get 12 cats again. And
 I can find no other way to get a single cat for the entire line. Hopefully
 someone can tell what I’m missing here.
 
 Please try to use
 http://grass.osgeo.org/grass70/manuals/v.build.polylines.html
 
 Markus
 

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Helmut Kudrnovsky
Michael Barton wrote
 Hi Markus, 
 
 What I'm trying to do is start
 http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/vector#v.fixed.segmentpointsa
 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
 
 
 
 
 On Nov 29, 2014, at 10:20 AM, Michael Barton lt;

 Michael.Barton@

 gt; wrote:
 
 Thanks. This helped.
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 On Nov 29, 2014, at 1:23 AM, Markus Neteler lt;

 neteler@

 gt; wrote:
 
 On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton lt;

 Michael.Barton@

 gt; wrote:
 I have a vector line that is divided into 12 cat values. I’d like all
 of the
 line to have a single cat value. I’ve tried v.category to no avail. If
 I
 delete all categories and then add new categories, I get 12 cats again.
 And
 I can find no other way to get a single cat for the entire line.
 Hopefully
 someone can tell what I’m missing here.
 
 Please try to use
 http://grass.osgeo.org/grass70/manuals/v.build.polylines.html
 
 Markus
 
 
 ___
 grass-user mailing list

 grass-user@.osgeo

 http://lists.osgeo.org/mailman/listinfo/grass-user

for points along a vector with a fixed distance between the points, see the
addon

 http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/vector#v.fixed.segmentpoints




-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175633.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Helmut Kudrnovsky
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
 
 
 
 
 On Nov 29, 2014, at 10:20 AM, Michael Barton lt;

 Michael.Barton@

 gt; wrote:
 
 Thanks. This helped.
 
 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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 On Nov 29, 2014, at 1:23 AM, Markus Neteler lt;

 neteler@

 gt; wrote:
 
 On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton lt;

 Michael.Barton@

 gt; wrote:
 I have a vector line that is divided into 12 cat values. I’d like all
 of the
 line to have a single cat value. I’ve tried v.category to no avail. If
 I
 delete all categories and then add new categories, I get 12 cats again.
 And
 I can find no other way to get a single cat for the entire line.
 Hopefully
 someone can tell what I’m missing here.
 
 Please try to use
 http://grass.osgeo.org/grass70/manuals/v.build.polylines.html
 
 Markus
 
 
 ___
 grass-user mailing list

 grass-user@.osgeo

 http://lists.osgeo.org/mailman/listinfo/grass-user

http://grass.osgeo.org/grass71/manuals/r.stream.extract.html ?



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175634.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread César Augusto Ramírez Franco
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 hel...@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
 
 
 
 
  On Nov 29, 2014, at 10:20 AM, Michael Barton lt;

  Michael.Barton@

  gt; wrote:
 
  Thanks. This helped.
 
  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
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
  On Nov 29, 2014, at 1:23 AM, Markus Neteler lt;

  neteler@

  gt; wrote:
 
  On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton lt;

  Michael.Barton@

  gt; wrote:
  I have a vector line that is divided into 12 cat values. I’d like all
  of the
  line to have a single cat value. I’ve tried v.category to no avail. If
  I
  delete all categories and then add new categories, I get 12 cats
 again.
  And
  I can find no other way to get a single cat for the entire line.
  Hopefully
  someone can tell what I’m missing here.
 
  Please try to use
  http://grass.osgeo.org/grass70/manuals/v.build.polylines.html
 
  Markus
 
 
  ___
  grass-user mailing list

  grass-user@.osgeo

  http://lists.osgeo.org/mailman/listinfo/grass-user

 http://grass.osgeo.org/grass71/manuals/r.stream.extract.html ?



 -
 best regards
 Helmut
 --
 View this message in context: http://osgeo-org.1560.x6.
 nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175634.html
 Sent from the Grass - Users mailing list archive at Nabble.com.
 ___
 grass-user mailing list
 grass-user@lists.osgeo.org
 http://lists.osgeo.org/mailman/listinfo/grass-user
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Michael Barton
I saw this but apparently it is not available for GRASS 7.

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



On Nov 29, 2014, at 4:40 PM, 
grass-user-requ...@lists.osgeo.orgmailto:grass-user-requ...@lists.osgeo.org 
wrote:


for points along a vector with a fixed distance between the points, see the
addon

http://grasswiki.osgeo.org/wiki/AddOns/GRASS7/vector#v.fixed.segmentpoints




-
best regards
Helmut

___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Michael Barton


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




Thanks César,

This is pretty much what I’m doing. However, it is not that simple, it turns 
out.

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.

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-requ...@lists.osgeo.orgmailto:grass-user-requ...@lists.osgeo.org 
wrote:

From: César Augusto Ramírez Franco 
caesar...@gmail.commailto:caesar...@gmail.com
To: GRASS User List 
grass-user@lists.osgeo.orgmailto:grass-user@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 
hel...@web.demailto:hel...@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.eduhttp://csdc.asu.edu/


___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user

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

2014-11-29 Thread Michael Barton
I tried to install v.profile under GRASS 6.4.4 to see if it would work but it 
failed to compile.

Michael

Here are the errors



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















 On Nov 29, 2014, at 10:29 AM, Michael Barton michael.bar...@asu.edu 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




 On Nov 29, 2014, at 10:20 AM, Michael Barton michael.bar...@asu.edu wrote:

 Thanks. This helped.

 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















 On Nov 29, 2014, at 1:23 AM, Markus Neteler nete...@osgeo.org wrote:

 On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton michael.bar...@asu.edu 
 wrote:
 I have a vector line that is divided into 12 cat values. I’d like all of 
 the
 line to have a single cat value. I’ve tried v.category to no avail. If I
 delete all categories and then add new categories, I get 12 cats again. And
 I can find no other way to get a single cat for the entire line. Hopefully
 someone can tell what I’m missing here.

 Please try to use
 http://grass.osgeo.org/grass70/manuals/v.build.polylines.html

 Markus



GRASS 6.4.5svn (Penaguila):~  g.extension extension=v.profile operation=add

Fetching v.profile from GRASS-Addons SVN (be patient)...
Av.profile/main.c
Av.profile/v.profile.html
Av.profile/Makefile
Av.profile/README
 U   v.profile
Checked out revision 63296.
Compiling v.profile...
/Applications/GRASS/GRASS-6.4.app/Contents/MacOS/include/Make/Grass.make:423: 
warning: overriding commands for target 
`/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/bin'
/Applications/GRASS/GRASS-6.4.app/Contents/MacOS/include/Make/Grass.make:414: 
warning: ignoring old commands for target 
`/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/bin'
mkdir -p 
/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/bin
mkdir -p 
/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/include/grass
mkdir -p 
/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/etc
mkdir -p 
/Users/cmbarton/Dropbox/GRASS_dropbox/grassdata_dropbox/Penaguila/analysis/.tmp/Michaels-MacBook-Air-3.local/20552.0/dist.x86_64-apple-darwin14/driver
mkdir -p 

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

2014-11-29 Thread Helmut Kudrnovsky
I saw this but apparently it is not available for GRASS 7.

it is as I wrote it for grass 7. 

doesn't g.extension do the job?



-
best regards
Helmut
--
View this message in context: 
http://osgeo-org.1560.x6.nabble.com/how-to-change-all-cats-in-a-vector-line-tp5175575p5175648.html
Sent from the Grass - Users mailing list archive at Nabble.com.
___
grass-user mailing list
grass-user@lists.osgeo.org
http://lists.osgeo.org/mailman/listinfo/grass-user