Add point to vector map at given position: Difference between revisions
Jump to navigation
Jump to search
mNo edit summary |
(v.patch method, add links to help pages) |
||
Line 5: | Line 5: | ||
; CLI | ; CLI | ||
* Add new point to the vector map <tt>(x=100, y=100, layer=1, category=1)</tt>: | ==== Method 1 ==== | ||
* Add new point to the vector map <tt>(x=100, y=100, layer=1, category=1)</tt> with {{cmd|v.edit}}: | |||
v.edit -n map=<map> tool=add input=- << EOF | v.edit -n map=<map> tool=add input=- << EOF | ||
Line 13: | Line 14: | ||
EOF | EOF | ||
* Insert new record to the attribute table of the vector map (if required): | * Insert new record to the attribute table of the vector map (if required) with {{cmd|db.execute}}: | ||
echo "insert into <map> values(1, ...)" | db.execute input=- | echo "insert into <map> values(1, ...)" | db.execute input=- | ||
==== Method 2 ==== | |||
{{cmd|v.in.ascii}} the new point into its own new map, then use {{cmd|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 | ; wxGUI |
Revision as of 12:20, 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