v.segment.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132
  1. <h2>DESCRIPTION</h2>
  2. <em>v.segment</em> generates segments or points from input lines and from
  3. positions read from a text file or '<tt>stdin</tt>'.
  4. <P>
  5. The format is:
  6. <div class="code"><pre>
  7. P &lt;point id&gt; &lt;line cat&gt; &lt;offset&gt; [&lt;side offset&gt;]
  8. L &lt;segment id&gt; &lt;line cat&gt; &lt;start offset&gt; &lt;end offset&gt; [&lt;side offset&gt;]
  9. </pre></div>
  10. <h3>EXAMPLE</h3>
  11. The user could send to <tt>stdin</tt> something like:
  12. <div class="code"><pre>
  13. P 1 356 24.56
  14. P 2 495 12.31
  15. ...
  16. </pre></div>
  17. (pipe or redirect from file into the command).<br>
  18. <H2>NOTES</H2>
  19. A segment is only created for the first line found of the specified category.
  20. <P>
  21. Points are generated along the lines at the given distance(s) from the
  22. beginning of the vector line.
  23. <p>
  24. The side offset is the orthogonal distance from the line. Positive side
  25. offsets are to the right side of the line going forward, negative offsets
  26. are to the left (<em>d.vect</em> with <em>display=shape,dir</em> shows
  27. the direction of vector lines). As the segment distance is measured along the
  28. original line, side-offset lines will be longer than the start-end segment distance
  29. for outside corners of curving lines, and shorter for inside corners.
  30. <P>
  31. All offsets are measured in map units (see "<em>g.proj -p</em>").
  32. <P>
  33. To place a point in the middle of a line, the <em>v.to.db</em> module may be
  34. used to find the line's length. Then half of that distance can be used as the
  35. along-line offset.
  36. <h2>EXAMPLES</h2>
  37. Spearfish location:
  38. <div class="code"><pre>
  39. # extract lines from railroad map:
  40. v.extract railroads out=myrr list=1
  41. # join segments into polyline and reassign category numbers
  42. v.build.polylines myrr out=myrr_pol
  43. v.category myrr_pol out=myrailroads option=add
  44. # zoom to an area of interest
  45. g.region n=4928200 s=4921100 w=605600 e=613200
  46. # show line, category, direction (to find the beginning)
  47. d.vect myrailroads disp=shape,cat,dir lsize=12
  48. # extract line segment from 400m to 5000m from beginning of line 1
  49. echo "L 1 1 400 5000" | v.segment myrailroads out=myrailroads_segl
  50. d.erase
  51. d.vect myrailroads
  52. d.vect myrailroads_segl col=green width=2
  53. # set node at 5000m from beginning of line 1
  54. echo "P 1 1 5000" | v.segment myrailroads out=myrailroads_segp
  55. d.vect myrailroads_segp icon=basic/circle color=red fcolor=red size=5
  56. # get points from a text file
  57. cat mypoints.txt | v.segment myrailroads out=myrailroads_mypoints
  58. # create parallel 1km long line segments along first 8km of track,
  59. # offset 500m to the left of the tracks.
  60. v.segment myrailroads out=myrailroads_segl_side << EOF
  61. L 1 1 1000 2000 -500
  62. L 2 1 3000 4000 -500
  63. L 3 1 5000 6000 -500
  64. L 4 1 7000 8000 -500
  65. EOF
  66. d.erase
  67. d.vect myrailroads disp=shape,dir
  68. d.vect -c myrailroads_segl_side width=2
  69. # A series of points, spaced every 2km along the tracks
  70. v.segment myrailroads out=myrailroads_pt2km << EOF
  71. P 1 1 1000
  72. P 2 1 3000
  73. P 3 1 5000
  74. P 4 1 7000
  75. EOF
  76. d.vect myrailroads_pt2km icon=basic/circle color=blue fcolor=blue size=5
  77. # A series of points, spaced every 2km along the tracks, offset 500m to the right
  78. v.segment myrailroads out=myrailroads_pt2kmO500m << EOF
  79. P 1 1 1000 500
  80. P 2 1 3000 500
  81. P 3 1 5000 500
  82. P 4 1 7000 500
  83. EOF
  84. d.vect myrailroads_pt2kmO500m icon=basic/circle color=aqua fcolor=aqua size=5
  85. </pre></div>
  86. <h2>BUGS</h2>
  87. There is a problem with side-offset parallel line generation for inside corners.
  88. <!-- in Vect_line_parallel(), v.parallel is also affected -->
  89. <h2>SEE ALSO</h2>
  90. <em>
  91. <a href="lrs.html">LRS tutorial</a> (Linear Referencing System),<BR>
  92. <a href="d.vect.html">d.vect</a>,
  93. <a href="v.build.polylines.html">v.build.polylines</a>,
  94. <a href="v.lrs.segment.html">v.lrs.segment</a>,
  95. <a href="v.parallel.html">v.parallel</a>,
  96. <a href="v.split.html">v.split</a>,
  97. <a HREF="v.to.db.html">v.to.db</a>,
  98. <a HREF="v.to.points.html">v.to.points</a>
  99. </em>
  100. <h2>AUTHOR</h2>
  101. Radim Blazek, ITC-Irst, Trento, Italy
  102. <p>
  103. <i>Last changed: $Date$</i>