GRASS Programmer's Manual 6.4.1(2011)
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_faces (struct Map_info *map)
 Get number of faces 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 312 of file level_two.c.

References Vect_get_full_name().

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

References Vect_get_full_name().

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

References Vect_get_full_name().

Referenced by Vect_break_lines_list(), Vect_net_build_graph(), Vect_net_nearest_nodes(), 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 182 of file level_two.c.

Referenced by 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 275 of file level_two.c.

References Vect_get_full_name().

Referenced by 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 293 of file level_two.c.

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

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

Referenced by 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 93 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 105 of file level_two.c.

int Vect_get_num_lines ( struct Map_info *  map)

Fetch number of features (points, lines, boundaries, centroids) in vector map.

Parameters:
mapvector map
Returns:
number of features

Definition at line 69 of file level_two.c.

Referenced by Vect_break_lines_list(), Vect_break_polygons(), Vect_build_nat(), Vect_build_partial(), Vect_copy_map_lines(), Vect_merge_lines(), Vect_net_build_graph(), Vect_overlay_and(), Vect_remove_duplicates(), Vect_set_varray_from_cat_list(), Vect_set_varray_from_db(), Vect_snap_lines(), Vedit_merge_lines(), and Vedit_select_by_query().

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 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 129 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 154 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 142 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 167 of file level_two.c.

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines