|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-1d1e47ad9d
|

Go to the source code of this file.
| int Vedit_add_vertex | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| struct line_pnts * | coord, | ||
| double | thresh | ||
| ) |
Add new vertex to line.
Shape of line is not changed.
| Map | pointer to Map_info |
| List | list of lines |
| coord | points location |
| thresh | find line in given threshold |
Definition at line 189 of file vertex.c.
References FALSE, G_debug(), GV_LINES, NULL, TRUE, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_distance(), Vect_line_insert_point(), Vect_line_prune(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_points_distance(), Vect_read_line(), Vect_rewrite_line(), WITHOUT_Z, line_pnts::x, x, line_pnts::y, and line_pnts::z.
| int Vedit_bulk_labeling | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| double | x1, | ||
| double | y1, | ||
| double | x2, | ||
| double | y2, | ||
| double | start, | ||
| double | step | ||
| ) |
Lines z-bulk labeling.
Automated labeling (z coordinate assignment) of vector lines (iso-lines).
| Map | pointer to Map_info |
| List | list of selected lines |
| x1,y1,x2,y2 | staring and ending point |
| start | starting value |
| step | step value |
Definition at line 32 of file zbulk.c.
References dbCatVal::cat, dbCatValArray::ctype, DB_C_TYPE_DOUBLE, db_CatValArray_alloc(), db_CatValArray_free(), db_CatValArray_sort_by_value(), GV_LINE, line_pnts::n_points, dbCatValArray::n_values, NULL, PORT_DOUBLE_MAX, dbCatVal::val, dbCatValArray::value, Vect_append_point(), Vect_delete_line(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_box(), Vect_line_check_intersection(), Vect_line_intersection(), Vect_line_length(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_rewrite_line(), Vect_write_line(), WITH_Z, WITHOUT_Z, and line_pnts::z.
Change primitive type.
Supported conversions:
| Map | pointer to Map_info |
| List | list of selected primitives |
Definition at line 29 of file chtype.c.
References G_debug(), GV_BOUNDARY, GV_CENTROID, GV_LINE, GV_POINT, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), and Vect_rewrite_line().
Connect lines in given threshold.
If two lines are selected and thresh is -1, no limit is applied.
| Map | pointer to Map_info |
| List | list of selected lines |
| thresh | threshold value |
Definition at line 158 of file break.c.
References G_debug(), GV_LINES, GV_POINTS, Vect_destroy_list(), Vect_find_line_list(), Vect_get_line_nodes(), Vect_get_line_type(), Vect_get_node_coor(), Vect_line_alive(), Vect_list_append(), Vect_new_list(), Vect_reset_list(), WITHOUT_Z, and x.
Copy selected primitives.
| Map | pointer to Map_info copy to |
| FromMap | vector map copy from (if not given use Map) |
| List | list of selected primitives (to be copied) |
Definition at line 27 of file vector/vedit/copy.c.
References G_debug(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), and Vect_write_line().
Delete area (centroid + set of boundaries) by id.
| Map | pointer to Map_info struct |
| area | id |
Definition at line 92 of file vector/vedit/delete.c.
References _, G_debug(), G_warning(), Vect_delete_line(), Vect_destroy_list(), Vect_get_area_boundaries(), Vect_get_area_centroid(), Vect_get_line_areas(), and Vect_new_list().
Referenced by Vedit_delete_area_centroid(), and Vedit_delete_areas_cat().
Delete area (centroid and set of boundaries) by centroid.
| Map | pointer to Map_info struct |
| centroid |
Definition at line 64 of file vector/vedit/delete.c.
References _, G_debug(), G_warning(), Vect_get_centroid_area(), and Vedit_delete_area().
Delete vector areas of given category.
| Map | pointer to Map_info struct |
| field | layer number |
| cat | category number |
Definition at line 139 of file vector/vedit/delete.c.
References G_debug(), Vect_area_alive(), Vect_get_area_cat(), Vect_get_num_areas(), and Vedit_delete_area().
Delete selected features.
| Map | pointer to Map_info |
| List | list of features to be deleted |
Definition at line 29 of file vector/vedit/delete.c.
References _, G_debug(), G_warning(), Vect_delete_line(), and Vect_line_alive().
| int Vedit_extend_lines | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| int | nodes, | ||
| int | parallel, | ||
| double | thresh | ||
| ) |
Extend lines in given threshold.
| Map | pointer to Map_info |
| List | list of selected lines |
| nodes | 1 for start node, 2 for end node, other for both |
| parallel | connect parallel lines |
| thresh | threshold value |
Definition at line 68 of file extend.c.
References G_debug(), GV_LINES, GV_POINTS, Vect_destroy_list(), Vect_find_line_list(), Vect_get_line_nodes(), Vect_get_line_type(), Vect_get_node_coor(), Vect_line_alive(), Vect_list_append(), Vect_new_list(), Vect_reset_list(), WITHOUT_Z, and x.
Flip direction of selected lines.
| Map | pointer to Map_info |
| List | list of selected lines |
Definition at line 25 of file flip.c.
References G_debug(), GV_LINES, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_reverse(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), and Vect_rewrite_line().
| double Vedit_get_min_distance | ( | struct line_pnts * | Points1, |
| struct line_pnts * | Points2, | ||
| int | with_z, | ||
| int * | mindistidx | ||
| ) |
Calculate distances between two lines.
| Points1 | first line geometry | |
| Points2 | second line geometry | |
| with_z | WITH_Z for 3D data | |
| [out] | mindistidx | index of minimal distance |
Definition at line 28 of file vector/vedit/distance.c.
References G_debug(), and Vect_points_distance().
Merge lines/boundaries.
At least two lines need to be given.
| Map | pointer to Map_info |
| List | list of selected lines |
Definition at line 47 of file merge.c.
References Cats2, G_debug(), G_ilist_add(), GV_LINES, line_pnts::n_points, NULL, Vect_append_point(), Vect_delete_line(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_find_line_list(), Vect_get_num_lines(), Vect_line_alive(), Vect_line_prune(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_read_line(), Vect_reset_line(), Vect_reset_list(), Vect_rewrite_line(), and Vect_val_in_list().
| int Vedit_modify_cats | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| int | layer, | ||
| int | del, | ||
| struct cat_list * | Clist | ||
| ) |
Add / remove categories.
| Map | pointer to Map_info |
| List | list of selected primitives |
| layer | layer number |
| del | action (non-zero for delete otherwise add) |
| Clist | list of category numbers |
Definition at line 30 of file vector/vedit/cats.c.
References _, G_warning(), Vect_cat_set(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_field_cat_del(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), and Vect_rewrite_line().
| int Vedit_move_lines | ( | struct Map_info * | Map, |
| struct Map_info ** | BgMap, | ||
| int | nbgmaps, | ||
| struct ilist * | List, | ||
| double | move_x, | ||
| double | move_y, | ||
| double | move_z, | ||
| int | snap, | ||
| double | thresh | ||
| ) |
Move selected primitives.
| Map | pointer to Map_info |
| BgMap | list of background vector maps used for snapping |
| nbgmaps | Number of background vector maps in BgMap |
| List | list of primitives to be moved |
| move_x,move_y,move_z | direction (move_z used only if map is 3D) |
| snap | enable snapping (see globals.h) |
| thresh | snapping threshold (>0) |
Definition at line 31 of file vector/vedit/move.c.
References G_debug(), line_pnts::n_points, NO_SNAP, SNAPVERTEX, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_is_3d(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_rewrite_line(), Vedit_snap_point(), line_pnts::x, x, line_pnts::y, and line_pnts::z.
| int Vedit_move_vertex | ( | struct Map_info * | Map, |
| struct Map_info ** | BgMap, | ||
| int | nbgmaps, | ||
| struct ilist * | List, | ||
| struct line_pnts * | coord, | ||
| double | thresh_coords, | ||
| double | thresh_snap, | ||
| double | move_x, | ||
| double | move_y, | ||
| double | move_z, | ||
| int | move_first, | ||
| int | snap | ||
| ) |
Move all vertices in bounding box(es)
| Map | pointer to Map_info |
| BgMap,nbgmaps | list of background vector maps for snapping |
| List | list of selected lines |
| coord | points location |
| thresh_coords | threshold value for selecting lines |
| thresh_snap | threshold value used for snapping |
| move_x,move_y,move_z | direction (move_z is used when map is 3D) |
| move_first | move only first vertex found in the bounding box |
| snap | snapping mode (see vedit.h) |
Definition at line 33 of file vertex.c.
References G_debug(), G_free(), G_realloc, G_zero(), GV_LINES, line_pnts::n_points, NO_SNAP, NULL, SNAPVERTEX, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_is_3d(), Vect_line_alive(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_points_distance(), Vect_read_line(), Vect_rewrite_line(), Vedit_snap_point(), WITHOUT_Z, line_pnts::x, x, line_pnts::y, and line_pnts::z.
| int Vedit_remove_vertex | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| struct line_pnts * | coord, | ||
| double | thresh | ||
| ) |
Remove vertex from line.
| Map | pointer to Map_info |
| List | list of selected lines |
| coord | points location |
| thresh | threshold value to find a line |
Definition at line 276 of file vertex.c.
References G_debug(), GV_LINES, line_pnts::n_points, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_delete_point(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_points_distance(), Vect_read_line(), Vect_rewrite_line(), WITHOUT_Z, line_pnts::x, x, line_pnts::y, and line_pnts::z.
| struct robject_list * Vedit_render_map | ( | struct Map_info * | Map, |
| struct bound_box * | box, | ||
| int | draw_flag, | ||
| double | center_easting, | ||
| double | center_northing, | ||
| int | map_width, | ||
| int | map_height, | ||
| double | map_res | ||
| ) |
Render vector features into list.
| Map | pointer to Map_info structure |
| box | bounding box of region to be rendered |
| draw_flag | types of objects to be rendered (see vedit.h) |
| center_easing,center_northing,map_width,map_height,map_res | values used for conversion en->xy |
Definition at line 59 of file vector/vedit/render.c.
References DRAW_AREA, DRAW_DIRECTION, DRAW_NODEONE, DRAW_NODETWO, DRAW_VERTEX, bound_box::E, robject::fid, G_debug(), G_malloc, G_realloc, GV_LINES, GV_POINTS, bound_box::N, NULL, bound_box::S, state, Vect_destroy_boxlist(), Vect_new_boxlist(), Vect_select_areas_by_box(), Vect_select_lines_by_box(), and bound_box::W.
| int Vedit_select_by_query | ( | struct Map_info * | Map, |
| int | type, | ||
| int | layer, | ||
| double | thresh, | ||
| int | query, | ||
| struct ilist * | List | ||
| ) |
Select primitives by query (based on geometry properties)
Currently supported:
Perform global query if List is empty otherwise query only selected vector objects.
| Map | pointer to Map_info | |
| type | feature type | |
| layer | layer number (unused) | |
| thresh | threshold value (< 0 for 'shorter', > 0 for 'longer') | |
| query | query (length, dangle, ...) | |
| [in,out] | List | list of selected features |
Definition at line 44 of file vector/vedit/select.c.
References G_debug(), QUERY_DANGLE, QUERY_LENGTH, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_get_num_lines(), Vect_list_append(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_select_dangles(), and Vect_val_in_list().
| int Vedit_snap_line | ( | struct Map_info * | Map, |
| struct Map_info ** | BgMap, | ||
| int | nbgmaps, | ||
| int | line, | ||
| struct line_pnts * | Points, | ||
| double | thresh, | ||
| int | to_vertex | ||
| ) |
Snap selected primitive to its nearest primitive.
| Map | pointer to Map_info |
| BgMap,nbgmaps | list of background maps used for snapping |
| line | line id to be snapped (if already written, otherwise -1) |
| Points | line geometry |
| layer | layer number |
| thresh | threshold value used for snapping (>0) |
| to_vertex | allow snapping also to vertex |
Definition at line 97 of file vedit/snap.c.
References G_debug(), line_pnts::n_points, Vect_destroy_cats_struct(), Vect_line_alive(), Vect_new_cats_struct(), Vect_points_distance(), Vedit_snap_point(), WITHOUT_Z, line_pnts::x, x, line_pnts::y, and line_pnts::z.
Referenced by Vedit_snap_lines().
| int Vedit_snap_lines | ( | struct Map_info * | Map, |
| struct Map_info ** | BgMap, | ||
| int | nbgmaps, | ||
| struct ilist * | List, | ||
| double | thresh, | ||
| int | to_vertex | ||
| ) |
Snap lines/boundaries.
| Map | pointer to Map_info |
| BgMap,nbgmaps | list of background maps used for snapping |
| List | list of lines to be snapped |
| layer | layer number |
| thresh | threshold value used for snapping (>0) |
| to_vertex | allow snapping also to vertex |
Definition at line 170 of file vedit/snap.c.
References GV_LINES, GV_POINT, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_rewrite_line(), and Vedit_snap_line().
| int Vedit_snap_point | ( | struct Map_info * | Map, |
| int | line, | ||
| double * | x, | ||
| double * | y, | ||
| double * | z, | ||
| double | thresh, | ||
| int | vertex | ||
| ) |
Snap given point to the nearest primitive.
| Map | pointer to Map_info |
| line | line to be excluded (point on line) |
| x,y,z | point on line to be snapped |
| thresh | snapping threshold (>0) |
| vertex | snap also to vertex (non-zero) |
Definition at line 28 of file vedit/snap.c.
References G_debug(), line_pnts::n_points, AMI_STREAM< T >::name(), NULL, Vect_destroy_line_struct(), Vect_find_line(), Vect_line_alive(), Vect_new_line_struct(), Vect_points_distance(), Vect_read_line(), WITHOUT_Z, line_pnts::x, line_pnts::y, and line_pnts::z.
Referenced by Vedit_move_lines(), Vedit_move_vertex(), and Vedit_snap_line().
| int Vedit_split_lines | ( | struct Map_info * | Map, |
| struct ilist * | List, | ||
| struct line_pnts * | coord, | ||
| double | thresh, | ||
| struct ilist * | List_updated | ||
| ) |
Split selected lines on given position.
| Map | pointer to Map_info | |
| List | list of selected lines | |
| coord | points location | |
| thresh | threshold | |
| [out] | List_updated | list of rewritten features (or NULL) |
Definition at line 32 of file break.c.
References G_debug(), GV_LINES, l, line_pnts::n_points, NULL, Vect_append_point(), Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_line_alive(), Vect_line_distance(), Vect_line_length(), Vect_list_append(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_read_line(), Vect_reset_line(), Vect_rewrite_line(), Vect_write_line(), WITHOUT_Z, line_pnts::x, x, line_pnts::y, and line_pnts::z.