GRASS Digitizing tool: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
(+template OutDated)
m (show new digitizer first)
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{OutDated}}
__TOC__
=v.digit=
GRASS digitizing tool should be
* written in '''wxPython''' Programming language or Tcl
* it should extend functionality of map display just like new Georeferencing tool does:
** (like ArcGIS does) only new "Digitizing Toolbox" would appear, after digitizing tool is started
** Vector file editing will happen in current map display, with all it's functions for zooming, quering and so on
* There should be graphical tool for database management, at least for adding (?and removing?) columns, adding new features and editing existing ones.


While digitising, edited vector file would be drawed to map display. ''Only currently edited or selected features would be stored in memory.'' This should spead up digitising and redrawing process significantly.
== GUI vector digitizer ==


=v.edit=
=== New digitizer ===
GRASS graphical digitising tool should be graphical front-end for new v.edit module. v.edit should be CML tool for
* creating new vector file, eventualy overwrite existing ones '''create'''
* adding new features (points, lines, polylines, centroids) '''add'''
* removenig old features (with database record) '''delete'''
* moving whole feature '''move'''
* moving specified vertex '''vertex'''
* adding new vertext to line/boundary '''break'''
* spliting line/boundary completely '''split'''
* removing vertex '''straight'''
* selecting features '''select'''
* merging two lines/boundaries together '''merge'''
* IMHO funtionality for adding 'z' values to vector contour lines should be back too


v.edit should accept feature selection by:
Quick overview:
* bbox '''bbox'''
* Editing of vector objects:
* catlist '''cats'''
** Add, Break, Copy, Connect, Convert Type, Delete, Flip direction, Merge, Move, Select lines by query, Snap, Split
* single coordinates '''coords'''
* Cats:
** Copy, Delete, Z-Bulk Labeling
* Vertex:
** Insert, Delete, Move


==Examples of actions==
* '''For details, see [[WxGUI#Vector_digitizer|Vector digitizer]] in [[wxGUI]]'''


(see also [http://grass.itc.it/grass63/manuals/html63_user/v.edit.html v.edit manual page])


* Create new vector file
[[Image:WxGUI-vdigit-win0.png|thumb|400px|center]]
v.edit tool=create map=vectfile
creates new vector map, eventualy will read data from standard inputs in default format (standard/point)
v.edit tool=create map=vectfile input=file.txt
creates new vector map and reads data from file file.txt in default format


* Add new feature to existing vector
=== Old digitizer ===
cat points | v.edit tool=add map=vectfile
* TCL/TK-based old fashioned [http://grass.osgeo.org/grass63/manuals/html63_user/v.digit.html v.digit] module
Read data from standard inputs in standard format
* no longer maintained


[[Image:V digit tcltk.png|thumb|400px|center]]


* Remove feature from vector file
== Command Line (CLI) vector digitizer ==
v.edit tool=delete map=vectfile cat=34,24
Remove features with category 34 and 24 from file vectfile
v.edit tool=delete map=vectfile coords=344556.23,23445.2345
Remove feature located on coordinates 344556.23,23445.2345
v.edit tool=delete map=vectfile bbox=344556.23,234455.2345,567566.34,456455.34
Remove features defined by bounding box 344556.23,234455.2345,567566.34,456455.34


* Move feature
See manual page of {{cmd|v.edit}}.
v.edit tool=move map=vectfile coords=344556.23,23445.2345 move=100000,-100000
Move feature located on coordinates 344556.23,23445.2345 to coordinates 644556.23,43445.2345
v.edit tool=move map=vectfile cat=45 move=1000,-1000
Move all points of feature of category 45 to coordinates about 1000 map units to the west and 1000 map units to the south
v.edit tool=move map=vectfile bbox=344556.23,234455.2345,567566.34,456455.34 to=1000,-1000
Move all points of features defined by bounding box 344556.23,234455.2345,567566.34,456455.34 about 1000 map units to the west and 1000 map units to the south


* Moving vertex
== Raster digitizer ==
v.edit tool=vertex map=vectfile coords=344556.23,23445.2345 move=1000,-1000
Move vertex on coordinates 344556.23,23445.2345 to 545556.23,22445.2345


* Breaking line
The {{cmd|r.in.poly}} ASCII format is almost the same as the standard vector ASCII format. So the new digitizer should be able to output for both, and then we have a replacement for {{cmd|r.digit}} too!
v.edit tool=break map=vectfile coords=344556.23,23445.2345
Break line on coordinates 344556.23,23445.2345 at coords 345433.3,34567.32
v.edit tool=break map=vectfile cat=45 coords=345433.3,34567.32
Break line of category 45 at coords 345433.3,34567.32
 
* Remove vertex -- straight line
v.edit tool=straight map=vectfile coords=344556.23,23445.2345
Remove vertex at coordinates 344556.23,23445.2345
 
* Splitting line
v.edit tool=split map=vectfile coords=344556.23,23445.2345
Split line on coordinates 344556.23,23445.2345 at coords 345433.3,34567.32
v.edit tool=split map=vectfile cat=45 coords=345433.3,34567.32
Split line of category 45 at coords 345433.3,34567.32
 
* Merging two lines
v.edit tool=merge map=vectfile coords=606853.875,4921332,603216.75,4922763
Merge first line defined by coordinates 606853.875,4921332 with second line, defined by coordinates 603216.75,4922763. Define nearest distance between line first and last points and move first (last) point of second line to first line -- First line will remain untached.
v.edit tool=merge map=vectfile bbox=344556.23,23445.2345
Merge two lines defined by bounding box
v.edit tool=merge map=vectfile cat=43,45
Merge two lines defined by category
 
* Selecting features
Print line id's selected by coords, bbox or cat. Example:
v.edit map=soils@PERMANENT tool=select bbox=595733.8125,4919781.75,598536.1875,4917396.75
Example with d.vect:
d.vect col=red width=2 -i cat="`v.edit map=soils@PERMANENT tool=select bbox=595733.8125,4919781.75,598536.1875,4917396.75`" map=soils
 
==Summary==
 
v.edit --help
 
Description:
Edits a vector map - allows adding, deleting and modifying objects in a vector map.
 
Keywords:
vector, editing, geometry
 
Usage:
v.edit [-tin] map=name [layer=value] [type=string[,string,...]]
  tool=string [input=name] [move=x,y] [thresh=value] [cats=range]
  [ids=range] [coords=x,y[,x,y,...]] [bbox=x1,y1,x2,y2]
  [polygon=x,y[,x,y,...]] [where=sql_query] [--verbose] [--quiet]
 
Flags:
  -t  Do not build topology
  -i  Print ID's of edited features
  -n  Do not expect header of input data
--v  Verbose module output
--q  Quiet module output
 
Parameters:
      map  Name of input vector map
    layer  Layer number
            A single vector map can be connected to multiple database tables. This number determines which table to use.
            default: 1
    type  Type
            Feature type(s)
            options: point,line,boundary,centroid
            default: point,line,boundary,centroid
    tool  Editing tool
            options: create,add,delete,copy,move,flip,catadd,catdel,merge,
                    break,snap,vertexadd,vertexdel,vertexmove,select
            create: Create new (empty) vector map
            add: Add new feature(s) to existing vector map
            delete: Delete selected feature(s) from vector map
            copy: Copy selected features
            move: Move selected feature(s) in vector map
            flip: Flip direction of selected vector lines
            catadd: Set new category(ies) to selected vector feature(s) for defined layer
            catdel: Delete category(ies) from selected vector feature(s) for defined layer
            merge: Merge selected vector lines
            break: Break (split) vector line into two separate lines
            snap: Snap one vector line to another
            vertexadd: Add new vertex to selected vector lines
            vertexdel: Remove vertex from selected vector lines
            vertexmove: Move vertex of selected vector lines
            select: Select lines and print their ID's
    input  ASCII file to be converted to binary vector map, if not given (or "-") reads from standard input
    move  Difference in x,y direction for moving feature or vertex
  thresh  Threshold distance
            default: 0
    cats  Category values
            Example: 1,3,7-9,13
      ids  ID values
            Example: 1,3,7-9,13
  coords  List of point coordinates
    bbox  Bounding box for selecting features
  polygon  Polygon for selecting features
    where  WHERE conditions of SQL statement without 'where' keyword
            Example: income < 1000 and inhab >= 10000
= r.digit =
 
The r.in.poly ascii format is almost the same as the standard vector ascii format. So the new digitizer should be able to output for both, and then we have a replacement for r.digit too!


[[Category:Development]]
[[Category:Development]]
[[Category:Vector]]

Latest revision as of 15:33, 8 October 2012

GUI vector digitizer

New digitizer

Quick overview:

  • Editing of vector objects:
    • Add, Break, Copy, Connect, Convert Type, Delete, Flip direction, Merge, Move, Select lines by query, Snap, Split
  • Cats:
    • Copy, Delete, Z-Bulk Labeling
  • Vertex:
    • Insert, Delete, Move


Old digitizer

  • TCL/TK-based old fashioned v.digit module
  • no longer maintained

Command Line (CLI) vector digitizer

See manual page of v.edit.

Raster digitizer

The r.in.poly ASCII format is almost the same as the standard vector ASCII format. So the new digitizer should be able to output for both, and then we have a replacement for r.digit too!