Add point to vector map at given position: Difference between revisions

From GRASS-Wiki
Jump to navigation Jump to search
mNo edit summary
Line 3: Line 3:
'''A:'''
'''A:'''


; CLI
== CLI ==


==== Method 1 ====
==== Method 1 ====
Line 26: Line 26:
</source>
</source>


 
== [[wxGUI]] ==
 
; wxGUI


{{YouTube|5xBoIEpA598|desc=Add point to vector map at given position using wxGUI}}
{{YouTube|5xBoIEpA598|desc=Add point to vector map at given position using wxGUI}}


[[Category:FAQ]]
[[Category:FAQ]]

Revision as of 14:43, 24 September 2011

Q: How to add a new point to the vector map at given position?

A:

CLI

Method 1

  • Add new point to the vector map (x=100, y=100, layer=1, category=1) with v.edit:
v.edit -n map=<map> tool=add input=- << EOF
P 1 1
100 100
1 1
EOF
  • Insert new record to the attribute table of the vector map (if required) with db.execute:
echo "insert into <map> values(1, ...)" | db.execute input=-

Method 2

v.in.ascii the new point into its own new map, then use v.patch to combine the new point with the old points (attribute tables must match exactly).

   echo "100 100" | v.in.ascii input=- output=new_point_map
   v.patch input=old_point_map,new_point_map output=combined_points_map

wxGUI

Add point to vector map at given position using wxGUI