.TH v.segment 1grass "" "GRASS 6.4.2" "Grass User's Manual" .SH NAME \fI\fBv.segment\fR\fR - Creates points/segments from input vector lines and positions. .SH KEYWORDS vector, geometry .SH SYNOPSIS \fBv.segment\fR .br \fBv.segment help\fR .br \fBv.segment input\fR=\fIname\fR \fBoutput\fR=\fIname\fR [\fBllayer\fR=\fIinteger\fR] [\fBfile\fR=\fIname\fR] [--\fBoverwrite\fR] [--\fBverbose\fR] [--\fBquiet\fR] .SS Flags: .IP "\fB--overwrite\fR" 4m .br Allow output files to overwrite existing files .IP "\fB--verbose\fR" 4m .br Verbose module output .IP "\fB--quiet\fR" 4m .br Quiet module output .PP .SS Parameters: .IP "\fBinput\fR=\fIname\fR" 4m .br Name of input vector map containing lines .IP "\fBoutput\fR=\fIname\fR" 4m .br Name for output vector map where segments will be written .IP "\fBllayer\fR=\fIinteger\fR" 4m .br Line layer .br A single vector map can be connected to multiple database tables. This number determines which table to use. .br Default: \fI1\fR .IP "\fBfile\fR=\fIname\fR" 4m .br Name of file containing segment rules. If not given, read from stdin. .PP .SH DESCRIPTION \fIv.segment\fR generates segments or points from input lines and from positions read from a text file or 'stdin'. .PP The format is: \fC .DS .br P [] .br L [<;side offset>;] .br .DE \fR .SS EXAMPLE The user could send to stdin something like: \fC .DS .br P 1 356 24.56 .br P 2 495 12.31 .br ... .br .DE \fR (pipe or redirect from file into the command). .br .SH NOTES A segment is only created for the first line found of the specified category. .PP Points are generated along the lines at the given distance(s) from the beginning of the vector line. .PP The side offset is the orthogonal distance from the line. Positive side offsets are to the right side of the line going forward, negative offsets are to the left (\fId.vect\fR with \fIdisplay=shape,dir\fR shows the direction of vector lines). As the segment distance is measured along the original line, side-offset lines will be longer than the start-end segment distance for outside corners of curving lines, and shorter for inside corners. .PP All offsets are measured in map units (see "\fIg.proj -p\fR"). .PP To place a point in the middle of a line, the \fIv.to.db\fR module may be used to find the line's length. Then half of that distance can be used as the along-line offset. .SH EXAMPLES Spearfish location: \fC .DS .br # extract lines from railroad map: .br v.extract railroads out=myrr list=1 .br .br # join segments into polyline and reassign category numbers .br v.build.polylines myrr out=myrr_pol .br v.category myrr_pol out=myrailroads option=add .br .br # zoom to an area of interest .br g.region n=4928200 s=4921100 w=605600 e=613200 .br .br # show line, category, direction (to find the beginning) .br d.vect myrailroads disp=shape,cat,dir lsize=12 .br .br # extract line segment from 400m to 5000m from beginning of line 1 .br echo "L 1 1 400 5000" | v.segment myrailroads out=myrailroads_segl .br d.erase .br d.vect myrailroads .br d.vect myrailroads_segl col=green width=2 .br .br # set node at 5000m from beginning of line 1 .br echo "P 1 1 5000" | v.segment myrailroads out=myrailroads_segp .br d.vect myrailroads_segp icon=basic/circle color=red fcolor=red size=5 .br .br # get points from a text file .br cat mypoints.txt | v.segment myrailroads out=myrailroads_mypoints .br .br # create parallel 1km long line segments along first 8km of track, .br # offset 500m to the left of the tracks. .br v.segment myrailroads out=myrailroads_segl_side << EOF .br L 1 1 1000 2000 -500 .br L 2 1 3000 4000 -500 .br L 3 1 5000 6000 -500 .br L 4 1 7000 8000 -500 .br EOF .br d.erase .br d.vect myrailroads disp=shape,dir .br d.vect -c myrailroads_segl_side width=2 .br .br # A series of points, spaced every 2km along the tracks .br v.segment myrailroads out=myrailroads_pt2km << EOF .br P 1 1 1000 .br P 2 1 3000 .br P 3 1 5000 .br P 4 1 7000 .br EOF .br d.vect myrailroads_pt2km icon=basic/circle color=blue fcolor=blue size=5 .br .br # A series of points, spaced every 2km along the tracks, offset 500m to the right .br v.segment myrailroads out=myrailroads_pt2kmO500m << EOF .br P 1 1 1000 500 .br P 2 1 3000 500 .br P 3 1 5000 500 .br P 4 1 7000 500 .br EOF .br d.vect myrailroads_pt2kmO500m icon=basic/circle color=aqua fcolor=aqua size=5 .br .DE \fR .SH BUGS There is a problem with side-offset parallel line generation for inside corners. .SH SEE ALSO \fI LRS tutorial (Linear Referencing System), .br d.vect, v.build.polylines, v.lrs.segment, v.parallel, v.split, v.to.db, v.to.points \fR .SH AUTHOR Radim Blazek, ITC-Irst, Trento, Italy .PP \fILast changed: $Date: 2011-11-08 12:29:50 +0100 (Tue, 08 Nov 2011) $\fR .PP Full index .PP © 2003-2011 GRASS Development Team