|
GRASS 8 Programmer's Manual 8.6.0dev(2026)-ddeab64dbf
|
Vector library - topology level functions. More...

Go to the source code of this file.
Functions | |
| plus_t | Vect_get_num_nodes (struct Map_info *Map) |
| Get number of nodes in vector map. | |
| plus_t | Vect_get_num_primitives (struct Map_info *Map, int type) |
| Get number of primitives in vector map. | |
| plus_t | Vect_get_num_lines (struct Map_info *Map) |
| Fetch number of features (points, lines, boundaries, centroids) in vector map. | |
| plus_t | Vect_get_num_areas (struct Map_info *Map) |
| Get number of areas in vector map. | |
| plus_t | Vect_get_num_kernels (struct Map_info *Map) |
| Fetch number of kernels in vector map. | |
| plus_t | Vect_get_num_faces (struct Map_info *Map) |
| Get number of faces in vector map. | |
| plus_t | Vect_get_num_volumes (struct Map_info *Map) |
| Fetch number of volumes in vector map. | |
| plus_t | Vect_get_num_islands (struct Map_info *Map) |
| Get number of islands in vector map. | |
| plus_t | Vect_get_num_holes (struct Map_info *Map) |
| Fetch number of holes in vector map. | |
| int | Vect_get_num_dblinks (struct Map_info *Map) |
| Get number of defined dblinks. | |
| int | Vect_get_num_updated_lines (struct Map_info *Map) |
| Get number of updated features. | |
| int | Vect_get_updated_line (struct Map_info *Map, int idx) |
| Get updated line by index. | |
| off_t | Vect_get_updated_line_offset (struct Map_info *Map, int idx) |
| Get updated line offset by index. | |
| int | Vect_get_num_updated_nodes (struct Map_info *Map) |
| Get number of updated nodes. | |
| int | Vect_get_updated_node (struct Map_info *Map, int idx) |
| Get updated (modified) node by index. | |
| int | Vect_get_line_type (struct Map_info *Map, int line) |
| Get line type. | |
| int | Vect_get_node_coor (struct Map_info *Map, int num, double *x, double *y, double *z) |
| Get node coordinates. | |
| int | Vect_get_line_nodes (struct Map_info *Map, int line, int *n1, int *n2) |
| Get line nodes. | |
| int | Vect_get_line_areas (struct Map_info *Map, int line, int *left, int *right) |
| Get area id on the left and right side of the boundary. | |
| int | Vect_get_node_n_lines (struct Map_info *Map, int node) |
| Get number of lines for node. | |
| int | Vect_get_node_line (struct Map_info *Map, int node, int line) |
| Get line id for node line index. | |
| float | Vect_get_node_line_angle (struct Map_info *Map, int node, int line) |
| Angle of segment of the line connected to the node. | |
| int | Vect_get_centroid_area (struct Map_info *Map, int centroid) |
| Get area id the centroid is within. | |
| void | Vect_set_updated (struct Map_info *Map, int enable) |
| Enable/disable maintenance of list of updated lines/nodes. | |
| void | Vect_reset_updated (struct Map_info *Map) |
| Reset list of updated lines/nodes. | |
Vector library - topology level functions.
(C) 2001-2009, 2011-2012 by the GRASS Development Team
This program is free software under the GNU General Public License (>=v2). Read the file COPYING that comes with GRASS for details.
Definition in file level_two.c.
Get area id the centroid is within.
| Map | pointer to Map_info struct |
| centroid | centroid id |
Definition at line 430 of file level_two.c.
References _, P_topo_c::area, G_fatal_error(), and GV_CENTROID.
Referenced by Vedit_delete_area_centroid().
Get area id on the left and right side of the boundary.
Negative area id indicates an isle.
| Map | pointer to Map_info struct | |
| line | line id | |
| [out] | left,right | area id on the left and right side |
Definition at line 347 of file level_two.c.
References _, G_warning(), GV_BOUNDARY, P_topo_b::left, NULL, P_topo_b::right, and Vect_get_line_type().
Referenced by Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), Vect_select_areas_by_polygon(), Vect_topo_check(), Vect_write_ascii(), and Vedit_delete_area().
Get line nodes.
| Map | pointer to Map_info struct |
| line | line id |
| n1 | (start node), ids of line nodes (or NULL) |
| n2 | (end node) ids of line nodes (or NULL) |
Definition at line 304 of file level_two.c.
References _, G_fatal_error(), GV_BOUNDARY, GV_LINE, GV_LINES, P_topo_l::N1, P_topo_b::N1, P_topo_l::N2, P_topo_b::N2, NULL, and Vect_get_line_type().
Referenced by NetA_get_node_costs(), NetA_varray_to_nodes(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_nearest_nodes(), Vect_net_ttb_build_graph(), Vect_remove_duplicates(), Vedit_connect_lines(), and Vedit_extend_lines().
Get line type.
| Map | pointer to Map_info struct |
| line | line id |
Definition at line 254 of file level_two.c.
References Vect_line_alive().
Referenced by Vect_get_line_areas(), Vect_get_line_nodes(), Vect_remove_duplicates(), Vect_topo_check(), Vedit_connect_lines(), and Vedit_extend_lines().
Get node coordinates.
| Map | pointer to Map_info struct | |
| num | node id (starts at 1) | |
| [out] | x,y,z | coordinates values (for 2D coordinates z is NULL) |
Definition at line 274 of file level_two.c.
References _, G_warning(), NULL, P_node::x, P_node::y, and P_node::z.
Referenced by NetA_add_point_on_node(), Vect_clean_small_angles_at_nodes(), Vect_find_node(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_net_ttb_shortest_path(), Vedit_connect_lines(), and Vedit_extend_lines().
Get line id for node line index.
| Map | pointer to Map_info struct |
| node | node id |
| line | line index (range: 0 - Vect_get_node_n_lines()) |
Definition at line 397 of file level_two.c.
Referenced by Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), Vect_net_ttb_build_graph(), and Vect_remove_duplicates().
Angle of segment of the line connected to the node.
| Map | pointer to Map_info struct |
| node | node number |
| line | line index (range: 0 - Vect_get_node_n_lines()) |
Definition at line 413 of file level_two.c.
Referenced by Vect_clean_small_angles_at_nodes().
Get number of lines for node.
| Map | pointer to Map_info struct |
| node | node id |
Definition at line 381 of file level_two.c.
Referenced by Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), Vect_net_ttb_build_graph(), and Vect_remove_duplicates().
Get number of areas in vector map.
| Map | pointer to Map_info struct |
Definition at line 87 of file level_two.c.
Referenced by Gv_load_vect(), Vect__copy_areas(), Vect_build_partial(), Vect_remove_small_areas_ext(), Vect_remove_small_areas_nat(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), Vect_topo_check(), Vect_write_ascii(), vector2perimeters(), and Vedit_delete_areas_cat().
Get number of defined dblinks.
| Map | pointer to Map_info struct |
Definition at line 159 of file level_two.c.
Referenced by V1_close_nat(), Vect__delete(), Vect_copy_map_dblinks(), Vect_copy_tables(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), Vect_get_field2(), Vect_get_field_number(), and Vect_rename().
Get number of faces in vector map.
| Map | pointer to Map_info struct |
Definition at line 111 of file level_two.c.
Fetch number of holes in vector map.
| Map | pointer to Map_info struct |
Definition at line 147 of file level_two.c.
Get number of islands in vector map.
| Map | pointer to Map_info struct |
Definition at line 135 of file level_two.c.
Fetch number of kernels in vector map.
| Map | pointer to Map_info struct |
Definition at line 99 of file level_two.c.
Fetch number of features (points, lines, boundaries, centroids) in vector map.
| Map | pointer to Map_info struct |
Definition at line 75 of file level_two.c.
Referenced by NetA_get_node_costs(), NetA_initialise_varray(), NetA_varray_to_nodes(), Vect_break_polygons_file(), Vect_break_polygons_mem(), Vect_build_partial(), Vect_fidx_dump(), Vect_merge_lines(), Vect_net_build_graph(), Vect_net_ttb_build_graph(), Vect_overlay_and(), Vect_remove_duplicates(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), Vect_snap_lines(), Vect_topo_check(), Vedit_merge_lines(), and Vedit_select_by_query().
Get number of nodes in vector map.
| Map | pointer to Map_info struct |
Definition at line 34 of file level_two.c.
Referenced by NetA_get_node_costs(), NetA_varray_to_nodes(), Vect_clean_small_angles_at_nodes(), Vect_net_build_graph(), and Vect_net_ttb_build_graph().
Get number of primitives in vector map.
| Map | pointer to Map_info struct |
| type | feature type |
Definition at line 47 of file level_two.c.
References GV_BOUNDARY, GV_CENTROID, GV_FACE, GV_KERNEL, GV_LINE, and GV_POINT.
Referenced by Vect_topo_check().
Get number of updated features.
Note: Vect_set_updated() must be called to maintain list of updated features
| Map | pointer to Map_info struct |
Definition at line 175 of file level_two.c.
Get number of updated nodes.
| Map | pointer to Map_info struct |
Definition at line 219 of file level_two.c.
Fetch number of volumes in vector map.
| Map | pointer to Map_info struct |
Definition at line 123 of file level_two.c.
Get updated line by index.
Note: Vect_set_updated() must be called to maintain list of updated features
| Map | pointer to Map_info struct |
| idx | index |
Definition at line 191 of file level_two.c.
Get updated line offset by index.
Note: Vect_set_updated() must be called to maintain list of updated features
| Map | pointer to Map_info struct |
| idx | index |
Definition at line 207 of file level_two.c.
Get updated (modified) node by index.
Note: Vect_set_updated() must be called to maintain list of updated features
Negative id:
| Map | pointer to Map_info struct |
| idx | index |
Definition at line 241 of file level_two.c.
Reset list of updated lines/nodes.
| Map | pointer to Map_info struct |
Definition at line 470 of file level_two.c.
References dig_line_reset_updated(), and dig_node_reset_updated().
Enable/disable maintenance of list of updated lines/nodes.
See Plus_head.uplist for details.
| Map | pointer to Map_info struct |
| enable | TRUE/FALSE to enable/disable |
Definition at line 455 of file level_two.c.
References FALSE, G_debug(), AMI_STREAM< T >::name(), and TRUE.