1v.segment(1) Grass User's Manual v.segment(1)
2
3
4
6 v.segment - Create points/segments from input lines and and positions.
7
9 vector, geometry
10
12 v.segment
13 v.segment help
14 v.segment input=name output=name [llayer=integer] [--overwrite]
15
16 Flags:
17 --overwrite
18
19 Parameters:
20 input=name
21 Input map containing lines
22
23 output=name
24 Output map where segments will be written
25
26 llayer=integer
27 Line layer Default: 1
28
30 v.segment generates segments or points from input lines and from posi‐
31 tions read from 'stdin'.
32
33 The format is:
34 P <point id> <line cat> <;offset>; [<;side offset>;]
35 L <segment id> <line cat> <;start offset>; <;end offset>; [<;side off‐
36 set>;]
37
38
39 EXAMPLE
40 The user must send to stdin something like:
41 P 1 356 24.56
42 P 2 495 12.31
43 (pipe or redirect from file into the command).
44
46 A segment is only created for the first line found of the specified
47 category.
48
49 Points are generated along the lines at the given distance(s) from the
50 beginning of the vector line.
51
52 The side offset is the orthogonal distance from the line. Positive side
53 offsets are to the right side of the line going forward, negative off‐
54 sets are to the left. As the segment distance is measured along the
55 original line, side-offset lines will be longer than the start-end seg‐
56 ment distance for outside corners of curving lines, and shorter for
57 inside corners.
58
59 All offsets are measured in map units (see "g.proj -p").
60
61 To place a point in the middle of a line, the v.to.db module may be
62 used to find the line's length. Then half of that distance can be used
63 as the along-line offset.
64
66 Spearfish location:
67 # extract lines from railroad map:
68 v.extract railroads out=myrr list=1
69 # join segments into polyline and reassign category numbers
70 v.build.polylines myrr out=myrr_pol
71 v.category myrr_pol out=myrailroads option=add
72 # zoom to an area of interest
73 g.region n=4928200 s=4921100 w=605600 e=613200
74 # show line, category, direction (to find the beginning)
75 d.vect myrailroads disp=shape,cat,dir lsize=12
76 # extract line segment from 400m to 5000m from beginning of line 1
77 echo "L 1 1 400 5000" | v.segment myrailroads out=myrailroads_segl
78 d.erase
79 d.vect myrailroads
80 d.vect myrailroads_segl col=green width=2
81 # set node at 5000m from beginning of line 1
82 echo "P 1 1 5000" | v.segment myrailroads out=myrailroads_segp
83 d.vect myrailroads_segp icon=basic/circle color=red fcolor=red size=5
84 # get points from a text file
85 cat mypoints.txt | v.segment myrailroads out=myrailroads_mypoints
86 # create parallel 1km long line segments along first 8km of track,
87 # offset 500m to the left of the tracks.
88 v.segment myrailroads out=myrailroads_segl_side << EOF
89 L 1 1 1000 2000 -500
90 L 2 1 3000 4000 -500
91 L 3 1 5000 6000 -500
92 L 4 1 7000 8000 -500
93 EOF
94 d.erase
95 d.vect myrailroads disp=shape,dir
96 d.vect -c myrailroads_segl_side width=2
97 # A series of points, spaced every 2km along the tracks
98 v.segment myrailroads out=myrailroads_pt2km << EOF
99 P 1 1 1000
100 P 2 1 3000
101 P 3 1 5000
102 P 4 1 7000
103 EOF
104 d.vect myrailroads_pt2km icon=basic/circle color=blue fcolor=blue
105 size=5
106 # A series of points, spaced every 2km along the tracks, offset 500m to
107 the right
108 v.segment myrailroads out=myrailroads_pt2kmO500m << EOF
109 P 1 1 1000 500
110 P 2 1 3000 500
111 P 3 1 5000 500
112 P 4 1 7000 500
113 EOF
114 d.vect myrailroads_pt2kmO500m icon=basic/circle color=aqua fcolor=aqua
115 size=5
116
117
119 There is a problem with side-offset parallel line generation for inside
120 corners.
121
123 LRS tutorial (Linear Reference System),
124 v.build.polylines, v.lrs.segment, v.parallel, v.split, v.to.db,
125 v.to.points
126
128 Radim Blazek, ITC-Irst, Trento, Italy
129
130 Last changed: $Date: 2007/05/04 05:33:50 $
131
132 Full index
133
134
135
136GRASS 6.2.2 v.segment(1)