GRASS Programmer's Manual  6.4.2(2012)
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.
int Vect_get_num_primitives (struct Map_info *map, int type)
 Get number of primitives in vector map.
int Vect_get_num_lines (struct Map_info *map)
 Fetch number of features (points, lines, boundaries, centroids) in vector map.
int Vect_get_num_areas (struct Map_info *map)
 Get number of areas in vector map.
int Vect_get_num_kernels (struct Map_info *map)
 Fetch number of kernels in vector map.
int Vect_get_num_faces (struct Map_info *map)
 Get number of faces in vector map.
int Vect_get_num_volumes (struct Map_info *map)
 Fetch number of volumes in vector map.
int Vect_get_num_islands (struct Map_info *map)
 Get number of islands 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.
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 node by index.
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/isle ids on the left and right.
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.

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 336 of file level_two.c.

References G_fatal_error(), and Vect_get_full_name().

Referenced by gui_modules.wxvdigit.IVDigit::GetAreaPerimeter(), and gui_modules.wxvdigit.IVDigit::GetAreaSize().

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 255 of file level_two.c.

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

Referenced by gui_modules.wxvdigit.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 230 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 206 of file level_two.c.

References NULL.

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 299 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 317 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 279 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 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)
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 105 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 129 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.

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 153 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 178 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 117 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 166 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 191 of file level_two.c.

 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines