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

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.

Thanks
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 Sat, Nov 29, 2014 at 6:16 AM, Michael Barton <Michael.Barton@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

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.Barton@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 <neteler@osgeo.org> wrote:

On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton <Michael.Barton@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

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.

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.

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@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 <

Michael.Barton@

> 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 <

neteler@

> wrote:

On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton <

Michael.Barton@

> 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

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.barton@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.Barton@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 neteler@osgeo.org wrote:

On Sat, Nov 29, 2014 at 6:16 AM, Michael Barton Michael.Barton@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

(attachments)

v.profile_errors.txt (7.05 KB)