GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
level_two.c File Reference

Vector library - topology level functions. More...

#include <stdlib.h>
#include <grass/gis.h>
#include <grass/Vect.h>
#include <grass/glocale.h>
Include dependency graph for level_two.c:

Go to the source code of this file.

Functions

int Vect_get_num_nodes (struct Map_info *map)
 Get number of nodes in vector map. More...
 
int Vect_get_num_primitives (struct Map_info *map, int type)
 Get number of primitives in vector map. More...
 
int Vect_get_num_lines (struct Map_info *map)
 Fetch number of features (points, lines, boundaries, centroids) in vector map. More...
 
int Vect_get_num_areas (struct Map_info *map)
 Get number of areas in vector map. More...
 
int Vect_get_num_kernels (struct Map_info *map)
 Fetch number of kernels in vector map. More...
 
int Vect_get_num_faces (struct Map_info *map)
 Get number of faces in vector map. More...
 
int Vect_get_num_volumes (struct Map_info *map)
 Fetch number of volumes in vector map. More...
 
int Vect_get_num_islands (struct Map_info *map)
 Get number of islands in vector map. More...
 
int Vect_get_num_holes (struct Map_info *map)
 Fetch number of holes in vector map. More...
 
int Vect_get_num_dblinks (struct Map_info *map)
 Get number of defined dblinks. More...
 
int Vect_get_num_updated_lines (struct Map_info *map)
 Get number of updated features. More...
 
int Vect_get_updated_line (struct Map_info *map, int idx)
 Get updated line by index. More...
 
int Vect_get_num_updated_nodes (struct Map_info *map)
 Get number of updated nodes. More...
 
int Vect_get_updated_node (struct Map_info *map, int idx)
 Get updated node by index. More...
 
int Vect_get_node_coor (struct Map_info *map, int num, double *x, double *y, double *z)
 Get node coordinates. More...
 
int Vect_get_line_nodes (struct Map_info *Map, int line, int *n1, int *n2)
 Get line nodes. More...
 
int Vect_get_line_areas (struct Map_info *Map, int line, int *left, int *right)
 Get area/isle ids on the left and right. More...
 
int Vect_get_node_n_lines (struct Map_info *Map, int node)
 Get number of lines for node. More...
 
int Vect_get_node_line (struct Map_info *Map, int node, int line)
 Get line id for node line index. More...
 
float Vect_get_node_line_angle (struct Map_info *Map, int node, int line)
 Angle of segment of the line connected to the node. More...
 
int Vect_get_centroid_area (struct Map_info *Map, int centroid)
 Get area id the centroid is within. More...
 

Detailed Description

Vector library - topology level functions.

(C) 2001-2008 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.

Author
Original author CERL, probably Dave Gerdes or Mike Higgins.
Update to GRASS 5.7 Radim Blazek and David D. Gray.
Date
2001-2008

Definition in file level_two.c.

Function Documentation

int Vect_get_centroid_area ( struct Map_info *  Map,
int  centroid 
)

Get area id the centroid is within.

Parameters
Mapvector map
centroidcentroid id
Returns
area id the centroid is within
0 for not in area
negative id if area/centroid (?) is duplicate

Definition at line 353 of file level_two.c.

References G_fatal_error(), and Vect_get_full_name().

Referenced by wxdigit.IVDigit::GetAreaPerimeter(), wxdigit.IVDigit::GetAreaSize(), and wxdisplay.DisplayDriver::GetRegionSelected().

int Vect_get_line_areas ( struct Map_info *  Map,
int  line,
int left,
int right 
)

Get area/isle ids on the left and right.

Parameters
Mapvector map
lineline id
[out]left,rightarea/isle id on the left and right
Returns
1

Definition at line 272 of file level_two.c.

References G_fatal_error(), NULL, and Vect_get_full_name().

Referenced by wxdigit.IVDigit::InitCats(), Vect_remove_small_areas(), and Vect_select_areas_by_polygon().

int Vect_get_line_nodes ( struct Map_info *  Map,
int  line,
int n1,
int n2 
)

Get line nodes.

Parameters
Mapvector map
lineline id
n1,n2ids of line nodes (or NULL)
Returns
1

Definition at line 247 of file level_two.c.

References G_fatal_error(), NULL, and Vect_get_full_name().

Referenced by NetA_get_node_costs(), NetA_points_to_nodes(), NetA_varray_to_nodes(), Vect_break_lines_list(), Vect_net_build_graph(), Vect_net_nearest_nodes(), Vect_net_shortest_path_coor2(), and Vedit_connect_lines().

int Vect_get_node_coor ( struct Map_info *  map,
int  num,
double *  x,
double *  y,
double *  z 
)

Get node coordinates.

Parameters
mapvector map
numnode id
x,y,zcoordinates values (for 2D coordinates z is NULL)
Returns
0

Definition at line 223 of file level_two.c.

References NULL, and num.

Referenced by IL_vector_input_data_2d(), NetA_add_point_on_node(), Vect_break_lines_list(), Vect_clean_small_angles_at_nodes(), Vect_find_node(), and Vedit_connect_lines().

int Vect_get_node_line ( struct Map_info *  Map,
int  node,
int  line 
)

Get line id for node line index.

Parameters
Mapvector map
nodenode id
lineline index (range: 0 - Vect_get_node_n_lines())
Returns
line id

Definition at line 316 of file level_two.c.

References G_fatal_error(), and Vect_get_full_name().

Referenced by IL_vector_input_data_2d(), Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), Vect_net_build_graph(), and Vect_overlay_and().

float Vect_get_node_line_angle ( struct Map_info *  Map,
int  node,
int  line 
)

Angle of segment of the line connected to the node.

Parameters
Mapvector map
nodenode number
lineline index (range: 0 - Vect_get_node_n_lines())
Returns
angle of segment of the line connected to the node

Definition at line 334 of file level_two.c.

References G_fatal_error(), and Vect_get_full_name().

Referenced by Vect_clean_small_angles_at_nodes().

int Vect_get_node_n_lines ( struct Map_info *  Map,
int  node 
)

Get number of lines for node.

Parameters
Mapvector map
nodenode id
Returns
numbers of lines

Definition at line 296 of file level_two.c.

References G_fatal_error(), and Vect_get_full_name().

Referenced by Vect_clean_small_angles_at_nodes(), Vect_merge_lines(), Vect_net_build_graph(), and Vect_overlay_and().

int Vect_get_num_areas ( struct Map_info *  map)

Get number of areas in vector map.

Parameters
mapvector map
Returns
number of areas

Definition at line 81 of file level_two.c.

Referenced by wxdisplay.DisplayDriver::GetRegionSelected(), Gv_load_vect(), Vect_build_partial(), Vect_remove_small_areas(), Vect_set_varray_from_cat_list(), and Vect_set_varray_from_db().

int Vect_get_num_dblinks ( struct Map_info *  map)

Get number of defined dblinks.

Parameters
mapvector map
Returns
number of dblinks

Definition at line 158 of file level_two.c.

Referenced by wxdigit.IVDigit::DeleteSelectedLines(), wxdigit.IVDigit::InitCats(), Vect_copy(), Vect_copy_tables(), Vect_delete(), Vect_get_column_names(), Vect_get_column_names_types(), Vect_get_column_types(), and Vect_rename().

int Vect_get_num_faces ( struct Map_info *  map)

Get number of faces in vector map.

Parameters
mapvector map
Returns
number of faces

Definition at line 106 of file level_two.c.

int Vect_get_num_holes ( struct Map_info *  map)

Fetch number of holes in vector map.

Parameters
mapvector map
Returns
number of holes

Definition at line 145 of file level_two.c.

int Vect_get_num_islands ( struct Map_info *  map)

Get number of islands in vector map.

Parameters
mapvector map
Returns
number of islands

Definition at line 132 of file level_two.c.

int Vect_get_num_kernels ( struct Map_info *  map)

Fetch number of kernels in vector map.

Parameters
mapvector map
Returns
number of kernels

Definition at line 93 of file level_two.c.

int Vect_get_num_nodes ( struct Map_info *  map)

Get number of nodes in vector map.

Parameters
Mapvector map
Returns
number of nodes

Definition at line 29 of file level_two.c.

Referenced by IL_vector_input_data_2d(), NetA_get_node_costs(), NetA_varray_to_nodes(), Vect_clean_small_angles_at_nodes(), and Vect_net_build_graph().

int Vect_get_num_primitives ( struct Map_info *  map,
int  type 
)

Get number of primitives in vector map.

Parameters
mapvector map type feature type
Returns
number of primitives

Definition at line 42 of file level_two.c.

References num.

int Vect_get_num_updated_lines ( struct Map_info *  map)

Get number of updated features.

Parameters
mapvector map
Returns
number of updated features

Definition at line 170 of file level_two.c.

int Vect_get_num_updated_nodes ( struct Map_info *  map)

Get number of updated nodes.

Parameters
mapvector map
Returns
number of updated nodes

Definition at line 195 of file level_two.c.

int Vect_get_num_volumes ( struct Map_info *  map)

Fetch number of volumes in vector map.

Parameters
mapvector map
Returns
number of volumes

Definition at line 119 of file level_two.c.

int Vect_get_updated_line ( struct Map_info *  map,
int  idx 
)

Get updated line by index.

Parameters
mapvector map
idxindex
Returns
updated line

Definition at line 183 of file level_two.c.

int Vect_get_updated_node ( struct Map_info *  map,
int  idx 
)

Get updated node by index.

Parameters
mapvector map
idxindex
Returns
updated node

Definition at line 208 of file level_two.c.