|
NAMEv.edit - Edits a vector map, allows adding, deleting and modifying selected vector features.KEYWORDSvector, geometry, editing, line, node, point, vertex, level1SYNOPSISv.editv.edit --help v.edit [-rcnb1p] map=name [layer=string] [type=string[,string,...]] tool=string [input=name] [move=x,y,z] [threshold=float[,float,...]] [ids=range] [cats=range] [coords=x,y[,x,y,...]] [bbox=x1,y1,x2,y2] [polygon=x,y[,x,y,...]] [where=sql_query] [query=string] [bgmap=name[,name,...]] [snap=string] [zbulk=value,step] [--overwrite] [--help] [--verbose] [--quiet] [--ui] Flags:
Parameters:
DESCRIPTIONThe module v.edit allows the user to edit a vector map via command line interface.v.edit supports only "simple" vector features: points, centroids, lines and boundaries. Currently, only 2D vector features (except of tool=zbulk) are supported. Provides editing features’ geometry. Attribute data connected to the vector map are not modified at all. Vector features can be selected either by internal id,
category number cats, coordinates coords, bounding box
bbox, polygon, where statement (attribute data) or by
query. Selecting features by coordinates is affected by the current
2D resolution or by the threshold distance given by threshold. The
options are orthogonal, i.e. can be used in various combinations. For
example:
v.edit map=roads tool=select \ coord=599505,4921010,603389.0625,4918292.1875 \ threshold=10000 where="label=’interstate’"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’. NOTESIf no vector features are selected or the flag -b is used, topology is not build at the end.USAGEFeature selectionVector features can be selected in several ways:
Tool description
EXAMPLESCreate new vector mapCreate new (empty) vector map:v.edit tool=create map=vectmapCreate new vector map and read data from file ’roads.txt’: v.out.ascii in=roads format=standard > roads.txt; v.edit tool=create map=vectmap input=roads.txtor alternatively cat roads.txt | v.edit tool=create map=vectmap input=- Add new features to existing vector mapAdd a new point to the vector map (without header):echo "P 1 1 640794 214874 1 1" | v.edit -n tool=add map=vectmap input=- # insert new row for each category in attribute table if doesn’t exist yet v.to.db map=vectmap option=catThe input must be in GRASS ASCII vector format. Add new features read from standard input:
v.out.ascii in=railroads format=standard | v.edit tool=add map=vectmap input=- Delete selected features from vector map layerRemove all vector features with category number 1 or 2:v.edit tool=delete map=roads cats=1,2Remove all vector features except of those with category number 1 or 2 (reverse selection): v.edit -r tool=delete map=roads cats=1,2Remove features with category 1 or 2 located on coordinates 600952.625,4926107 (bounding box based on the current 2D resolution): g.region -d; v.edit tool=delete map=roads cats=1,2 coords=600952.625,4926107Remove all features with category 1 and 2 covered by two bounding boxes (center coordinates 592542.892,4924766.996 and 603389.062,4918292.187, size 1000 map units): v.edit map=roads tool=delete \ coord=592542.892,4924766.996,603389.062,4918292.187 \ threshold=1000 cat=1,2 Copy selected features from background mapCopy all features with category number 1 from background map:v.edit map=roads tool=copy bgmap=archsites cat=1 Move featuresMove feature (vector point) located on coordinates 602580,4918480 to coordinates 603580,4919480:v.edit tool=move map=archsites coord=602580,4918480 th=1e-2 move=1000,1000Move 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: v.edit tool=move map=roads cat=1 move=1000,-1000 snap=node threshold=-1,10Move 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: v.edit tool=move map=roads bbox=601530,4921560,602520,4922310 move=-1000,1000 Flip direction of vector linesFlip direction of all vector lines:v.edit tool=flip map=streams cats=1-9999 type=line Add / delete layer category numberAdd new layer/category 2/1, 2/3, 2/4, 2/5 to features covered by given polygon:v.edit tool=catadd map=roads \ polygon=599877.75,4925088.375,597164.812,4922524.5,601338.562,4920914.625 \ layer=2 cat=1,3-5Delete layer/category 1/1, line id 1: v.edit tool=catdel map=roads id=1 cats=5 Merge linesMerge two lines with given category number:v.edit map=roads tool=merge cat=4 Split line on given pointSplit line id 810 on coordinates 604268,4923570 in threshold 50 map units:v.edit map=roads tool=break coords=604268,4923570 id=810 threshold=50 Break selected lines at each intersectionBreak selected lines (with category number 1) at each intersection:v.edit map=roads tool=break cat=1 Snap linesSnap all lines using threshold distance 20 map units:v.edit map=roads id=1-9999 tool=snap threshold=-1,20 type=line Connect linesConnect line id 48 to line id 565:v.edit map=roads tool=connect id=48,565Connect line id 48 to line id 565; line id 60 to line id 50. Maximum threshold distance is 700 map units: v.edit map=roads tool=connect id=48,565,60,50 threshold=-1,700 Add vertexAdd new vertex to the line located at 600952,4926107, threshold is set to 1 map unit:v.edit tool=vertexadd map=roads coords=600952,4926107 threshold=1 Delete verticesDelete vertex located at 593191.608,4925684.849 (threshold set to 0.1 map units). Modify only lines with category 1:v.edit tool=vertexdel map=roads coord=593191.608,4925684.849 \ threshold=1-e1 cats=1 Move verticesMove vertices located at 604441,4921088 (threshold set to 100 map units). Modify only lines with categories 1-10:v.edit tool=vertexmove map=roads cats=1-10 coord=604441,4921088 \ threshold=100 move=1000,1000 Select features and print their id’sPrint id’s of selected features, e.g.:v.edit map=soils@PERMANENT tool=select \ bbox=595733.8125,4919781.75,598536.1875,4917396.75 --qExample with d.vect: 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 \ threshold=1000 --q` col=redSelect all lines shorter (or equal) than 10 map units: v.edit map=roads tool=select query=length threshold=-1,0,-10Select from given bounding box all lines longer then 200 map units: v.edit map=roads tool=select bbox=598260,4919730,605100,4926240 query=length threshold=-1,0,200 Fix height of contoursInput vector map contains 2D lines representing contours. Height can be assign to the contours using tool=zbulk. First of all 2D lines need to be converted to 3D lines:v.extrude input=line2 output=line3 height=0 type=lineAll 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. v.edit a2 tool=zbulk bbox=586121.25049368,4911970.21547109,603092.60466035,4927071.25713776 \ zbulk=1000,10 SEE ALSOv.in.ascii, v.info, v.build, v.build.polylines, v.clean, v.extrude, v.splitSee also wxGUI vector digitizer. AUTHORSOriginal author: Wolf Bergenheim - independent developerInitial updates: Jachym Cepicky, Mendel University of Agriculture and Forestry in Brno, Czech Republic Major update by Martin Landa, FBK-irst (formerly ITC-irst), Trento, Italy Extend tools by Huidae Cho SOURCE CODEAvailable at: v.edit source code (history)Main index | Vector index | Topics index | Keywords index | Graphical index | Full index © 2003-2021 GRASS Development Team, GRASS GIS 7.8.6 Reference Manual
Visit the GSP FreeBSD Man Page Interface. |