Sophie

Sophie

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

grass-6.3.0-15.fc13.i686.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>GRASS GIS: v.edit</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.edit</b></em>  - Edits a vector map, allows adding, deleting and modifying selected vector features.
<h2>KEYWORDS</h2>
vector, editing, geometry
<h2>SYNOPSIS</h2>
<b>v.edit</b><br>
<b>v.edit help</b><br>
<b>v.edit</b> [-<b>rcnt1</b>] <b>map</b>=<em>name</em>  [<b>layer</b>=<em>integer</em>]   [<b>type</b>=<em>string</em>[,<i>string</i>,...]]  <b>tool</b>=<em>string</em>  [<b>input</b>=<em>name</em>]   [<b>move</b>=<em>x,y</em>]   [<b>thresh</b>=<em>float</em>[,<i>float</i>,...]]   [<b>ids</b>=<em>range</em>]   [<b>cats</b>=<em>range</em>]   [<b>coords</b>=<em>x,y</em>[,<i>x,y</i>,...]]   [<b>bbox</b>=<em>x1,y1,x2,y2</em>]   [<b>polygon</b>=<em>x,y</em>[,<i>x,y</i>,...]]   [<b>where</b>=<em>sql_query</em>]   [<b>query</b>=<em>string</em>]   [<b>bgmap</b>=<em>name</em>[,<i>name</i>,...]]   [<b>snap</b>=<em>string</em>]   [<b>zbulk</b>=<em>value,step</em>]   [--<b>verbose</b>]  [--<b>quiet</b>] 

<h3>Flags:</h3>
<DL>
<DT><b>-r</b></DT>
<DD>Reverse selection</DD>

<DT><b>-c</b></DT>
<DD>Close added boundaries (using threshold distance)</DD>

<DT><b>-n</b></DT>
<DD>Do not expect header of input data</DD>

<DT><b>-t</b></DT>
<DD>Do not build topology</DD>

<DT><b>-1</b></DT>
<DD>Modify only first found feature in bounding box</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>map</b>=<em>name</em></DT>
<DD>Name of vector map to edit</DD>

<DT><b>layer</b>=<em>integer</em></DT>
<DD>Layer number</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>type</b>=<em>string[,<i>string</i>,...]</em></DT>
<DD>Type</DD>
<DD>Feature type(s)</DD>
<DD>Options: <em>point,line,boundary,centroid</em></DD>
<DD>Default: <em>point,line,boundary,centroid</em></DD>

<DT><b>tool</b>=<em>string</em></DT>
<DD>Tool</DD>
<DD>Options: <em>create,add,delete,copy,move,flip,catadd,catdel,merge,break,snap,connect,chtype,vertexadd,vertexdel,vertexmove,zbulk,select</em></DD>
<DD><b>create</b>: Create new (empty) vector map</DD>
<DD><b>add</b>: Add new features to existing vector map</DD>
<DD><b>delete</b>: Delete selected features from vector map</DD>
<DD><b>copy</b>: Copy selected features</DD>
<DD><b>move</b>: Move selected features in vector map</DD>
<DD><b>flip</b>: Flip direction of selected vector lines</DD>
<DD><b>catadd</b>: Set new categories to selected vector features for defined layer</DD>
<DD><b>catdel</b>: Delete categories from selected vector features for defined layer</DD>
<DD><b>merge</b>: Merge selected vector lines</DD>
<DD><b>break</b>: Break/split vector lines</DD>
<DD><b>snap</b>: Snap vector features in given threshold</DD>
<DD><b>connect</b>: Connect two lines</DD>
<DD><b>chtype</b>: Change feature type (point<->centroid, line<->boundary)</DD>
<DD><b>vertexadd</b>: Add new vertex to selected vector lines</DD>
<DD><b>vertexdel</b>: Remove vertex from selected vector lines</DD>
<DD><b>vertexmove</b>: Move vertex of selected vector lines</DD>
<DD><b>zbulk</b>: Z bulk-labeling (automated assignment of z coordinate to vector lines)</DD>
<DD><b>select</b>: Select lines and print their ID's</DD>

<DT><b>input</b>=<em>name</em></DT>
<DD>ASCII file to be converted to binary vector map</DD>
<DD>If not given (or "-") reads from standard input</DD>

<DT><b>move</b>=<em>x,y</em></DT>
<DD>Difference in x,y direction for moving feature or vertex</DD>

<DT><b>thresh</b>=<em>float[,<i>float</i>,...]</em></DT>
<DD>Threshold distance (coords,snap,query)</DD>
<DD>'-1' for threshold based on the current resolution settings</DD>
<DD>Default: <em>-1,0,0</em></DD>

<DT><b>ids</b>=<em>range</em></DT>
<DD>ID values</DD>
<DD>Example: 1,3,7-9,13</DD>

<DT><b>cats</b>=<em>range</em></DT>
<DD>Category values</DD>
<DD>Example: 1,3,7-9,13</DD>

<DT><b>coords</b>=<em>x,y[,<i>x,y</i>,...]</em></DT>
<DD>List of point coordinates</DD>

<DT><b>bbox</b>=<em>x1,y1,x2,y2</em></DT>
<DD>Bounding box for selecting features</DD>

<DT><b>polygon</b>=<em>x,y[,<i>x,y</i>,...]</em></DT>
<DD>Polygon for selecting features</DD>

<DT><b>where</b>=<em>sql_query</em></DT>
<DD>WHERE conditions of SQL statement without 'where' keyword</DD>
<DD>Example: income &lt; 1000 and inhab &gt;= 10000</DD>

<DT><b>query</b>=<em>string</em></DT>
<DD>Query tool</DD>
<DD>For 'shorter' use negative threshold value, positive value for 'longer'</DD>
<DD>Options: <em>length,dangle</em></DD>
<DD><b>length</b>: Select only lines or boudaries shorter/longer than threshold distance</DD>
<DD><b>dangle</b>: Select dangles shorter/longer than threshold distance</DD>

<DT><b>bgmap</b>=<em>name[,<i>name</i>,...]</em></DT>
<DD>Name of background vector map(s)</DD>

<DT><b>snap</b>=<em>string</em></DT>
<DD>Snap added or modified features in the given threshold to the nearest existing feature</DD>
<DD>Options: <em>no,node,vertex</em></DD>
<DD>Default: <em>no</em></DD>
<DD><b>no</b>: Not apply snapping</DD>
<DD><b>node</b>: Snap only to node</DD>
<DD><b>vertex</b>: Allow snapping also to vertex</DD>

<DT><b>zbulk</b>=<em>value,step</em></DT>
<DD>Starting value and step for z bulk-labeling</DD>
<DD>Pair: value,step (e.g. 1100,10)</DD>

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

The module <em>v.edit</em> allows the user to edit a vector map
via command line interface. 

<p>
<em>v.edit</em> supports only "simple" vector features: points,
centroids, lines and boundaries. Currently, only 2D vector features
(except of tool <b>zbulk</b>) are supported.

<p>
Provides editing features' geometry. Attribute data connected to the
vector map are not modified at all.

<p>
Vector features can be selected either by internal <b>id</b>, category
number <b>cats</b>, coordinates <b>coords</b>, bounding
box <b>bbox</b>, <b>polygon</b>, <b>where</b> statement (attribute
data) or by <b>query</b>. Selecting features by coordinates is
affected by the current 2D resolution or by the threshold distance
given by <b>thresh</b>. The options are <em>orthogonal</em>, i.e. can
be used in various combinations. For example:

<div class="code"><pre>
v.edit map=roads tool=select \
  coord=599505,4921010,603389.0625,4918292.1875 \
  thresh=10000 where="label='interstate'"
</pre></div>

selects all features (and prints their id's to standard output)
covered by two bounding boxes (center at 599505,4921010 and
603389.0625,4918292.1875, size 2*10000) with attribute
label='interstate'.

<h2>NOTES</h2>

If no vector features are selected or the flag <b>-t</b> is
used, topology is not build at the end.

<h2>USAGE</h2>

<h3>Feature selection</h3>

Vector features can be selected in several ways:
<ul>
    <li><b>ids</b> - using internal (unique) feature id's</li>
    <li><b>cats</b> - using category numbers</li>
    <li><b>coords</b> - using x,y coordinate pairs (center of bounding
    box, size defined by <b>thresh</b>)</li>
    <li><b>bbox</b> - using bounding box</li>
    <li><b>polygon</b> - using polygon (at least 3 coordinate pairs have to be set)</li>
    <li><b>where</b> - using where statement (attribute data)
    <li><b>query</b> - special query (e.g. minimal vector line length)
</ul>

Additional parameters for vector feature specification are:
<ul>
    <li><b>layer</b> - layer number (currently used only
    with <b>cats</b> or <b>where</b> option)</li>
    <li><b>thresh</b> - threshold distance used for selecting vector
    features by coordinates</li>
</ul>

<h3>Tool description</h3>

<ul>
    <li><b>create</b> - Create new (empty) vector map
    (see <em><a href="v.in.ascii.html">v.in.ascii</a></em>). Optionally vector
    features (in GRASS ASCII standard format) can be read from
    standard input (<b>input=-</b>) or from the text file given by
    the <b>input</b> option.</li>

    <li><b>add</b> - Add new vector features (defined in GRASS ASCII
    standard format) to existing vector map. Features can be read from
    standard input or from the given text file (<b>input</b>
    option). If no header is given, the <b>-n</b> flag must be
    used. Added features can be snapped (defined by <b>snap</b>
    parameter) to nodes or vertices based on threshold
    distance <b>thresh</b>.</li>

    <li><b>delete</b> - Delete selected vector features from existing
    vector map.</li>
   
    <li><b>copy</b> - Make identical copy of selected vector
    features. If background map <b>bgmap</b> is given copy features
    from background map, not from currently modified vector map.</li>

    <li><b>move</b> - Move selected features of existing vector map
    relatively to their current location. This tool requires
    <b>move</b> option. The option defines coordinates of the movement
    direction. Moved features can be snapped (defined by <b>snap</b>
    parameter) to nodes or vertices based on threshold
    distance <b>thresh</b>.</li>

    <li><b>flip</b> - Flip direction of selected vector lines
    (lines or boundaries).</li>

    <li><b>catadd</b> - Add new layer category(ies) to selected vector
    feature(s). Category can be later used for new database
    entry.</li>

    <li><b>catdel</b> - Delete layer category(ies) of selected vector
    feature(s).</li>

    <li><b>merge</b> - Merge (at least two) selected vector lines or
    boundaries. The geometry of the merged vector lines can be
    changed. If the second line from two selected lines is in opposite
    direction to the first, it will be flipped. See also
    module <em><a href="v.build.polylines.html">v.build.polylines</a></em>.</li>

    <li><b>break</b> - Split given vector line or boundary into two
    lines on location given by <b>coords</b>. If <b>coords</b> not
    given, breaks all selected lines at each intersection (based
    on <em><a href="v.clean.html">v.clean</a></em>, tool=break).</li>
    
    <li><b>snap</b> - Snap vector features in given threshold. See
    also module <em><a href="v.clean.html">v.clean</a></em>. Note that this
    tool supports only snapping to nodes. Parameters <b>snap</b> and
    <b>bgmap</b> are ignored.</li>

    <li><b>connect</b> - Connect selected lines or boundaries, the
    first given line is connected to the second one. The second line
    is broken if necessary. The lines are connected only if distance
    between them is not greater than snapping threshold
    distance <b>thresh</b>.</li>

    <li><b>chtype</b> - Change feature type of selected geometry
    objects. Points are converted to centroids, centroids to points,
    lines to boundaries and boundaries to lines.

    <li><b>vertexadd</b> - Add vertex(ces) to the given vector lines
    or boundaries. Location of the new vertex is given by <b>coord</b>
    option. If <b>-1</b> is given only first found line or boundary in bounding
    box is modified.</li>

    <li><b>vertexdel</b> - Remove vertex(ces) specified by
    <b>coords</b> option. If <b>-1</b> is given only first found line or
    boundary in bounding box is modified.</li>

    <li><b>vertexmove</b> - Move vertex(ces) specified
    by <b>coords</b> option. Direction of the movement is specified by
    the <b>move</b> option. If <b>-1</b> is given only first found
    line or boundary in bounding box is modified. Moved vertex can be
    snapped (defined <b>snap</b>) to nodes or vertices based on
    threshold distance <b>thresh</b>.</li>
    
    <li><b>zbulk</b> - Assign z coordinate to 3D vector lines in given
    bounding box. The first found line will get z coordinate based on
    value given by <b>zbulk</b> parameter. Z coordinate of other
    selected lines will be increased by step given by <b>zbulk</b>
    parameter. This tool strictly requires <b>bbox</b>
    and <b>zbulk</b> parameter. Also input vector map must be 3D.</li>

    <li><b>select</b> - Print comma separated list of selected line
      id's. No editing is done.
</ul>

<h2>EXAMPLES</h2>

<h3>Create new vector map</h3>

Create new (empty) vector map:

<div class="code"><pre>
v.edit tool=create map=vectmap
</pre></div>

Create new vector map and read data from file 'roads.txt':

<div class="code"><pre>
v.out.ascii in=roads format=standard > roads.txt;
v.edit tool=create map=vectmap input=roads.txt
</pre></div>

or alternatively

<div class="code"><pre>
cat roads.txt | v.edit tool=create map=vectmap input=-
</pre></div>

<h3>Add new features to existing vector map</h3>

Add point to the vector map (without header):

<div class="code"><pre>
echo "P 1 1
 640794 214874
 1 1" | v.edit -n tool=add map=vectmap
</pre></div>

Add new features read from standard input:

<div class="code"><pre>
v.out.ascii in=railroads format=standard | v.edit tool=add map=vectmap
</pre></div>

<h3>Delete selected features from vector map layer</h3>

Remove all vector features with category number 1 or 2:

<div class="code"><pre>
v.edit tool=delete map=roads cats=1,2
</pre></div>

Remove all vector features except of those with category number 1 or 2
(reverse selection):

<div class="code"><pre>
v.edit -r tool=delete map=roads cats=1,2
</pre></div>

Remove features with category 1 or 2 located on coordinates
600952.625,4926107 (bounding box based on the current 2D resolution):

<div class="code"><pre>
g.region -d;
v.edit tool=delete map=roads cats=1,2 coords=600952.625,4926107
</pre></div>

Remove all features with category 1 and 2 covered by two bounding boxes
(center coordinates 592542.892,4924766.996 and 603389.062,4918292.187, 
size 2000 map units):

<div class="code"><pre>
v.edit map=roads tool=delete \
  coord=592542.892,4924766.996,603389.062,4918292.187 \
  thresh=1000 cat=1,2
</pre></div>

<h3>Copy selected features from background map</h3>

Copy all features with category number 1 from background map:

<div class="code"><pre>
v.edit map=roads tool=copy bgmap=archsites cat=1
</pre></div>

<h3>Move features</h3>

Move feature (vector point) located on coordinates 602580,4918480 to
coordinates 603580,4919480:

<div class="code"><pre>
v.edit tool=move map=archsites coord=602580,4918480 th=1e-2 move=1000,1000
</pre></div>

Move all features with category 1 1000 map units to the west and 1000
map units to the south. Moved features snap to nodes in threshold
distance 10 map units:

<div class="code"><pre>
v.edit tool=move map=roads cat=1 move=1000,-1000 snap=node thresh=-1,10
</pre></div>

Move all features defined by bounding box
601530,4921560,602520,4922310 (W,S,E,N) 1000 map units to the
east and 1000 map units to the north:

<div class="code"><pre>
v.edit tool=move map=roads bbox=601530,4921560,602520,4922310 move=-1000,1000
</pre></div>

<h3>Flip direction of vector lines</h3>

Flip direction of all vector lines:

<div class="code"><pre>
v.edit tool=flip map=streams cats=1-9999 type=line
</pre></div>

<h3>Add / delete layer category number</h3>

Add new layer/category 2/1, 2/3, 2/4, 2/5 to features covered by given polygon:

<div class="code"><pre>
v.edit tool=catadd map=roads \
  polygon=599877.75,4925088.375,597164.812,4922524.5,601338.562,4920914.625 \
  layer=2 cat=1,3-5
</pre></div>

Delete layer/category 1/1, line id 1:

<div class="code"><pre>
v.edit tool=catdel map=roads id=1 cats=5
</pre></div>

<h3>Merge lines</h3>

Merge two lines with given category number:

<div class="code"><pre>
v.edit map=roads tool=merge cat=4
</pre></div>

<h3>Split line on given point</h3>

Split line id 810 on coordinates 604268,4923570 in threshold 50 map units:

<div class="code"><pre>
v.edit map=roads tool=break coords=604268,4923570 id=810 thresh=50
</pre></div>

<h3>Break selected lines at each intersection</h3>

Break selected lines (with category number 1) at each intersection:

<div class="code"><pre>
v.edit map=roads tool=break cat=1
</pre></div>

<h3>Snap lines</h3>

Snap all lines using threshold distance 20 map units:

<div class="code"><pre>
v.edit map=roads id=1-9999 tool=snap thresh=-1,20 type=line
</pre></div>

<h3>Connect lines</h3>

Connect line id 48 to line id 565:

<div class="code"><pre>
v.edit map=roads tool=connect id=48,565
</pre></div>

Connect line id 48 to line id 565; line id 60 to line id
50. Maximum threshold distance is 700 map units:

<div class="code"><pre>
v.edit map=roads tool=connect id=48,565,60,50 thresh=-1,700
</pre></div>

<h3>Add vertex</h3>

Add new vertex to the line located at 600952,4926107, threshold is
set to 1 map unit:

<div class="code"><pre>
v.edit tool=vertexadd map=roads coords=600952,4926107 thresh=1
</pre></div>

<h3>Delete vertices</h3>

Delete vertex located at 593191.608,4925684.849 (threshold set to 0.1 map units).
Modify only lines with category 1:

<div class="code"><pre>
v.edit tool=vertexdel map=roads coord=593191.608,4925684.849 \
  thresh=1-e1 cats=1
</pre></div>

<h3>Move vertices</h3>

Move vertices located at 604441,4921088 (threshold set to 100 map units).
Modify only lines with categories 1-10:

<div class="code"><pre>
v.edit tool=vertexmove map=roads cats=1-10 coord=604441,4921088 \
  thresh=100 move=1000,1000
</pre></div>

<h3>Select features and print their id's</h3>

Print id's of selected features, e.g.:

<div class="code"><pre>
v.edit map=soils@PERMANENT tool=select \
  bbox=595733.8125,4919781.75,598536.1875,4917396.75 --q
</pre></div>

Example with <em><a href="d.vect.html">d.vect</a></em>:

<div class="code"><pre>
d.erase;
d.vect roads;
d.vect -i map=roads cats=`v.edit map=roads tool=select \
  coord=592542.89243878,4924766.99622811,603389.0625,4918292.1875 \
  thresh=1000 --q` col=red
</pre></div>

Select all lines shorter (or equal) than 10 map units:

<div class="code"><pre>
v.edit map=roads tool=select query=length thresh=-1,0,-10
</pre></div>

Select from given bounding box all lines longer then 200 map units:

<div class="code"><pre>
v.edit map=roads tool=select bbox=598260,4919730,605100,4926240 query=length thresh=-1,0,1000
</pre></div>

<h3>Fix height of contours</h3>

Intput vector map contains 2D lines representing contours. Height can
be assign to the contours using tool <b>zbulk</b>. First of all 2D
lines need to be converted to 3D lines:

<div class="code"><pre>
v.extrude input=line2 output=line3 height=0 type=line
</pre></div>

All lines which intersect with the line given by coordinates will be
modified. First found line will get height 1000 map units, height of
other selected lines will be increased by 10 map units.

<div class="code"><pre>
v.edit a2 tool=zbulk bbox=586121.25049368,4911970.21547109,603092.60466035,4927071.25713776 \
   zbulk=1000,10
</pre></div>


<h2>SEE ALSO</h2>

<em>
<a HREF="v.in.ascii.html">v.in.ascii</a>,
<a HREF="v.info.html">v.info</a>,
<a HREF="v.build.html">v.build</a>,
<a HREF="v.clean.html">v.clean</a>,
<a HREF="v.digit.html">v.digit</a>,
<a HREF="v.extrude.html">v.extrude</a>
</em>

<h2>AUTHOR</h2>

Original author: Wolf Bergenheim - independent developer<br>
Various updates: Jachym Cepicky, Mendel University of Agriculture and Forestry in Brno, Czech Republic<br>
Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy

<p>
<i>Last changed: $Date: 2008-03-13 00:06:47 +0100 (Thu, 13 Mar 2008) $</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>