<div dir="ltr">Hi Dylan!<div><br></div><div>(I'm about to start a new position — more on that later). This may help…</div><div><br></div><div>I had a problem somewhat analogous to this a little while ago, where I needed to create a text file that, among a couple of other things, needed to identify the 'downstream' pixel for all grid cells within a basin area. I was able to do that with help here, but an issue I had was that the integer IDs needed to be numbered from 0-N in basically upstream to downstream order, but after my GRASS analysis I had IDs with some large number ranging to some other very large number for the IDs and the 'downstream IDs' (with values skipped and not in order). I got help writing a Perl script that uses hashes for a lookup table to relate the old ID to the new ID.</div><div><br></div><div>Perhaps you could do something like this, starting with a new vector map (copy) where you could simply update the attributes using an SQL query? Some coding would be needed, obviously…</div><div><br></div><div>Just my 2 cents…</div><div><br></div><div>Cheers!</div><div>Tom</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Apr 2, 2015 at 6:31 PM, Dylan Beaudette <span dir="ltr"><<a href="mailto:dylan.beaudette@gmail.com" target="_blank">dylan.beaudette@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi,<br>
<br>
Once again, I am reminded that complex spatial analysis in other software<br>
can usually be reduced to a couple of lines of code in GRASS-- thanks!<br>
<br>
Here is a fun question. Suppose you have a set of line segments, or<br>
boundaries that are the result of a digitizing process that generated<br>
segments out of "order":<br>
<br>
      2             4              1           3<br>
O---------+-----------------+------------+------O<br>
<br>
'O' = start / end point<br>
'+' = vertex<br>
<br>
... in this case "order" is associated with order in which records appear<br>
in the attribute table and the order in which segments are drawn on the<br>
screen.<br>
<br>
Is there a module, or set of modules that could be used to re-order the<br>
segments so that the order of records in the attribute table and drawing<br>
order is:<br>
<br>
      1             2              3           4<br>
O---------+-----------------+------------+------O<br>
<br>
Note that I do not wan't to shuffle the linkages between geometry and<br>
attributes, rather, I would like to re-order the segments and attribute<br>
table according to the linear position within the set of contiguous<br>
boundaries or polyline.<br>
<br>
Here is an example set of lines in ASCII format, WGS84 GCS.<br>
<br>
ORGANIZATION:<br>
DIGIT DATE:<br>
DIGIT NAME:   dylan<br>
MAP NAME:<br>
MAP DATE:     Thu Apr  2 11:46:34 2015<br>
MAP SCALE:    1<br>
OTHER INFO:<br>
ZONE:         0<br>
MAP THRESH:   0.000000<br>
VERTI:<br>
B  6 1<br>
 -118.71960108 36.71846736<br>
 -118.71946261 36.71783146<br>
 -118.71905508 36.71717314<br>
 -118.71863837 36.71610377<br>
 -118.71807413 36.71546352<br>
 -118.71786286 36.71527706<br>
 2     132<br>
B  3 1<br>
 -118.7153795 36.73403608<br>
 -118.71537992 36.73272737<br>
 -118.71538933 36.73177277<br>
 2     133<br>
B  3 1<br>
 -118.71536851 36.76205202<br>
 -118.7153724 36.7609144<br>
 -118.71537619 36.75980591<br>
 2     150<br>
B  2 1<br>
 -118.73128842 36.69749903<br>
 -118.73130166 36.69760244<br>
 2     175<br>
B  5 1<br>
 -118.71538933 36.73177277<br>
 -118.7153944 36.73125742<br>
 -118.71573607 36.73044156<br>
 -118.71618977 36.72875872<br>
 -118.71651025 36.72811846<br>
 2     581<br>
B  15 1<br>
 -118.71651025 36.72811846<br>
 -118.71661716 36.72766138<br>
 -118.71660977 36.7273294<br>
 -118.71645785 36.72668322<br>
 -118.71689758 36.7261392<br>
 -118.71724087 36.72567564<br>
 -118.71747107 36.7248177<br>
 -118.71753527 36.72390024<br>
 -118.71787045 36.72307308<br>
 -118.71797278 36.72237579<br>
 -118.71781832 36.72073331<br>
 -118.71825483 36.72004703<br>
 -118.71908689 36.71948153<br>
 -118.71963768 36.71863545<br>
 -118.71960108 36.71846736<br>
 2     602<br>
B  8 1<br>
 -118.7180943 36.70872005<br>
 -118.71827421 36.7083356<br>
 -118.71841915 36.7080259<br>
 -118.7190169 36.70752707<br>
 -118.72008403 36.70694237<br>
 -118.72042476 36.70636815<br>
 -118.72049695 36.70608245<br>
 -118.7212077 36.70547966<br>
 2     604<br>
B  15 1<br>
 -118.7212077 36.70547966<br>
 -118.721692  36.70506892<br>
 -118.72256889 36.70442599<br>
 -118.72372477 36.702873<br>
 -118.72417965 36.70213899<br>
 -118.72496002 36.70190631<br>
 -118.72660809 36.70183505<br>
 -118.72765407 36.70118732<br>
 -118.72831767 36.70100376<br>
 -118.72866574 36.7007615<br>
 -118.72887421 36.70026501<br>
 -118.72998965 36.69849669<br>
 -118.73066541 36.69798083<br>
 -118.73118943 36.69770441<br>
 -118.73130166 36.69760244<br>
 2     609<br>
B  8 1<br>
 -118.7153867 36.75138736<br>
 -118.7153804 36.7500365<br>
 -118.7153634 36.7464107<br>
 -118.7153465 36.742785<br>
 -118.7153296 36.7391593<br>
 -118.71533791 36.73753527<br>
 -118.7153438 36.7363838<br>
 -118.7153795 36.73403608<br>
 2     610<br>
B  13 1<br>
 -118.71786286 36.71527706<br>
 -118.71763335 36.71507451<br>
 -118.71748992 36.71480774<br>
 -118.71754381 36.71369999<br>
 -118.71750723 36.7131568<br>
 -118.71786592 36.71228789<br>
 -118.71745106 36.71129755<br>
 -118.71716489 36.71079564<br>
 -118.71709787 36.71043286<br>
 -118.71712906 36.71006868<br>
 -118.71740871 36.70978478<br>
 -118.717644  36.709369<br>
 -118.7180943 36.70872005<br>
 2     612<br>
B  7 1<br>
 -118.71411256 36.77582538<br>
 -118.71445897 36.77550631<br>
 -118.71478471 36.77508229<br>
 -118.7149828 36.77446623<br>
 -118.71532537 36.77406797<br>
 -118.7153339 36.7717931<br>
 -118.71534777 36.76808916<br>
 2     613<br>
B  3 1<br>
 -118.71534777 36.76808916<br>
 -118.71536   36.7645405<br>
 -118.71536851 36.76205202<br>
 2     622<br>
B  4 1<br>
 -118.71537619 36.75980591<br>
 -118.7153848 36.7572883<br>
 -118.7153973 36.7536622<br>
 -118.7153867 36.75138736<br>
 2     623<br>
<br>
<br>
I have been able to convert these segments into polylines, however, I am<br>
not sure how one would go about computing the position along the polylines.<br>
Perhaps a linear referencing system?<br>
<br>
<br>
<br>
Thanks!<br>
Dylan<br>
_______________________________________________<br>
grass-user mailing list<br>
<a href="mailto:grass-user@lists.osgeo.org">grass-user@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/grass-user" target="_blank">http://lists.osgeo.org/mailman/listinfo/grass-user</a><br>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div class="gmail_signature">Thomas E Adams, III<div>718 McBurney Drive</div><div>Lebanon, OH 45036</div><div><br></div><div>1 (513) 739-9512 (cell)</div><div><br></div></div>
</div>