Sophie

Sophie

distrib > Fedora > 13 > i386 > by-pkgid > 413e0bdb3c48563b2d8d9038d07d5533 > files > 2261

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: v.segment</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link rel="stylesheet" href="grassdocs.css" type="text/css">
</head>
<body bgcolor="white">

<img src="grass_logo.png" alt="GRASS logo"><hr align=center size=6 noshade>

<h2>NAME</h2>
<em><b>v.segment</b></em>  - Creates points/segments from input vector lines and positions.
<h2>KEYWORDS</h2>
vector, geometry
<h2>SYNOPSIS</h2>
<b>v.segment</b><br>
<b>v.segment help</b><br>
<b>v.segment</b> <b>input</b>=<em>name</em> <b>output</b>=<em>name</em>  [<b>llayer</b>=<em>integer</em>]   [<b>file</b>=<em>name</em>]   [--<b>overwrite</b>]  [--<b>verbose</b>]  [--<b>quiet</b>] 

<h3>Flags:</h3>
<DL>
<DT><b>--overwrite</b></DT>
<DD>Allow output files to overwrite existing files</DD>
<DT><b>--verbose</b></DT>
<DD>Verbose module output</DD>
<DT><b>--quiet</b></DT>
<DD>Quiet module output</DD>
</DL>

<h3>Parameters:</h3>
<DL>
<DT><b>input</b>=<em>name</em></DT>
<DD>Name of input vector map containing lines</DD>

<DT><b>output</b>=<em>name</em></DT>
<DD>Name for output vector map where segments will be written</DD>

<DT><b>llayer</b>=<em>integer</em></DT>
<DD>Line layer</DD>
<DD>A single vector map can be connected to multiple database tables. This number determines which table to use.</DD>
<DD>Default: <em>1</em></DD>

<DT><b>file</b>=<em>name</em></DT>
<DD>Name of file containing segment rules. If not given, read from stdin.</DD>

</DL>
<h2>DESCRIPTION</h2>

<em>v.segment</em> generates segments or points from input lines and from
positions read from a text file or '<tt>stdin</tt>'.

<P>
The format is:
<div class="code"><pre>
P &lt;point id&gt;   &lt;line cat&gt; &lt;offset&gt; [&lt;side offset&gt;]
L &lt;segment id&gt; &lt;line cat&gt; &lt;start offset&gt; &lt;end offset&gt; [&lt;side offset&gt;]
</pre></div>

<h4>EXAMPLE</h4>

The user could send to <tt>stdin</tt> something like:
<div class="code"><pre>
P 1 356 24.56
P 2 495 12.31
...
</pre></div>
(pipe or redirect from file into the command).<br>


<H2>NOTES</H2>

A segment is only created for the first line found of the specified category.
<P>
Points are generated along the lines at the given distance(s) from the
beginning of the vector line.
<p>
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 (<em>d.vect</em> with <em>display=shape,dir</em> 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.
<P>
All offsets are measured in map units (see "<em>g.proj -p</em>").
<P>
To place a point in the middle of a line, the <em>v.to.db</em> module may be
used to find the line's length. Then half of that distance can be used as the
along-line offset.


<h2>EXAMPLES</h2>

Spearfish location:

<div class="code"><pre>
# extract lines from railroad map:
v.extract railroads out=myrr list=1

# join segments into polyline and reassign category numbers
v.build.polylines myrr out=myrr_pol
v.category myrr_pol out=myrailroads option=add

# zoom to an area of interest
g.region n=4928200 s=4921100 w=605600 e=613200

# show line, category, direction (to find the beginning)
d.vect myrailroads disp=shape,cat,dir lsize=12

# extract line segment from 400m to 5000m from beginning of line 1
echo "L 1 1 400 5000" | v.segment myrailroads out=myrailroads_segl
d.erase
d.vect myrailroads
d.vect myrailroads_segl col=green width=2

# set node at 5000m from beginning of line 1
echo "P 1 1 5000" | v.segment myrailroads out=myrailroads_segp
d.vect myrailroads_segp icon=basic/circle color=red fcolor=red size=5

# get points from a text file
cat mypoints.txt | v.segment myrailroads out=myrailroads_mypoints

# create parallel 1km long line segments along first 8km of track,
# offset 500m to the left of the tracks.
v.segment myrailroads out=myrailroads_segl_side << EOF
L 1 1 1000 2000 -500
L 2 1 3000 4000 -500
L 3 1 5000 6000 -500
L 4 1 7000 8000 -500
EOF
d.erase
d.vect myrailroads disp=shape,dir
d.vect -c myrailroads_segl_side width=2

# A series of points, spaced every 2km along the tracks
v.segment myrailroads out=myrailroads_pt2km << EOF
P 1 1 1000
P 2 1 3000
P 3 1 5000
P 4 1 7000
EOF
d.vect myrailroads_pt2km icon=basic/circle color=blue fcolor=blue size=5

# A series of points, spaced every 2km along the tracks, offset 500m to the right
v.segment myrailroads out=myrailroads_pt2kmO500m << EOF
P 1 1 1000 500
P 2 1 3000 500
P 3 1 5000 500
P 4 1 7000 500
EOF
d.vect myrailroads_pt2kmO500m icon=basic/circle color=aqua fcolor=aqua size=5
</pre></div>


<h2>BUGS</h2>
There is a problem with side-offset parallel line generation for inside corners.
<!-- in Vect_line_parallel(), v.parallel is also affected -->


<h2>SEE ALSO</h2>

<em>
<a href="lrs.html">LRS tutorial</a> (Linear Referencing System),<BR>
<a href="d.vect.html">d.vect</a>,
<a href="v.build.polylines.html">v.build.polylines</a>,
<a href="v.lrs.segment.html">v.lrs.segment</a>,
<a href="v.parallel.html">v.parallel</a>,
<a href="v.split.html">v.split</a>,
<a HREF="v.to.db.html">v.to.db</a>,
<a HREF="v.to.points.html">v.to.points</a>
</em>

<h2>AUTHOR</h2>

Radim Blazek, ITC-Irst, Trento, Italy

<p>
<i>Last changed: $Date: 2007-12-17 14:45:01 +0100 (Mon, 17 Dec 2007) $</i>
<HR>
<P><a href="index.html">Main index</a> - <a href="vector.html">vector index</a> - <a href="full_index.html">Full index</a></P>
<P>&copy; 2003-2008 <a href="http://grass.osgeo.org">GRASS Development Team</a></p>
</body>
</html>