GRASS Programmer's Manual  6.5.svn(2014)-r66266
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
vector/Vlib/find.c File Reference
#include <math.h>
#include <grass/gis.h>
#include <grass/Vect.h>
Include dependency graph for vector/Vlib/find.c:

Go to the source code of this file.

Macros

#define HUGE_VAL   9999999999999.0
 

Functions

int Vect_find_node (struct Map_info *Map, double ux, double uy, double uz, double maxdist, int with_z)
 Find the nearest node. More...
 
int Vect_find_line (struct Map_info *map, double ux, double uy, double uz, int type, double maxdist, int with_z, int exclude)
 Find the nearest line. More...
 
int Vect_find_line_list (struct Map_info *map, double ux, double uy, double uz, int type, double maxdist, int with_z, struct ilist *exclude, struct ilist *found)
 Find the nearest line(s). More...
 
int Vect_find_area (struct Map_info *Map, double x, double y)
 Find the nearest area. More...
 
int Vect_find_island (struct Map_info *Map, double x, double y)
 Find the nearest island. More...
 

Macro Definition Documentation

#define HUGE_VAL   9999999999999.0

Definition at line 23 of file vector/Vlib/find.c.

Referenced by Vect_find_line_list(), and Vect_find_node().

Function Documentation

int Vect_find_area ( struct Map_info *  Map,
double  x,
double  y 
)

Find the nearest area.

Parameters
[in]Mapvector map
[in]x,ypoint coordinates
Returns
area number
0 if not found

Definition at line 248 of file vector/Vlib/find.c.

References tools::box, first, G_debug(), Vect_new_list(), Vect_point_in_area(), Vect_select_areas_by_box(), and y.

Referenced by Vect_attach_centroids(), Vect_build_nat(), Vect_overlay_and(), Vect_select_areas_by_polygon(), and Vect_tin_get_z().

int Vect_find_island ( struct Map_info *  Map,
double  x,
double  y 
)

Find the nearest island.

Parameters
[in]Mapvector map
[in]x,ypoints coordinates
Returns
island number,
0 if not found

Definition at line 295 of file vector/Vlib/find.c.

References tools::box, first, G_area_of_polygon(), G_begin_polygon_area_calculations(), G_debug(), tools::size, Vect_get_isle_points(), Vect_new_line_struct(), Vect_new_list(), Vect_point_in_island(), Vect_select_isles_by_box(), and y.

int Vect_find_line ( struct Map_info *  map,
double  ux,
double  uy,
double  uz,
int  type,
double  maxdist,
int  with_z,
int  exclude 
)

Find the nearest line.

Parameters
[in]mapvector map
[in]ux,uy,uzpoints coordinates
[in]typefeature type (GV_LINE, GV_POINT, GV_BOUNDARY or GV_CENTROID) if only want to search certain types of lines or -1 if search all lines
[in]maxdistmax distance from the line
[in]with_z3D (WITH_Z, WITHOUT_Z)
[in]excludeif > 0 number of line which should be excluded from selection. May be useful if we need line nearest to other one.
Returns
number of nearest line
0 if not found

Definition at line 110 of file vector/Vlib/find.c.

References NULL, Vect_destroy_list(), Vect_find_line_list(), Vect_list_append(), and Vect_new_list().

Referenced by Vect_net_nearest_nodes(), and Vedit_snap_point().

int Vect_find_line_list ( struct Map_info *  map,
double  ux,
double  uy,
double  uz,
int  type,
double  maxdist,
int  with_z,
struct ilist *  exclude,
struct ilist *  found 
)

Find the nearest line(s).

Parameters
[in]mapvector map
[in]ux,uy,uzpoints coordinates
[in]typefeature type (GV_LINE, GV_POINT, GV_BOUNDARY or GV_CENTROID) if only want to search certain types of lines or -1 if search all lines
[in]maxdistmax distance from the line
[in]with_z3D (WITH_Z, WITHOUT_Z)
[in]excludelist of lines which should be excluded from selection
[in]foundlist of found lines (or NULL)
Returns
number of nearest line
0 if not found

Definition at line 145 of file vector/Vlib/find.c.

References tools::box, G_debug(), HUGE_VAL, NULL, Vect_destroy_list(), Vect_line_distance(), Vect_list_append(), Vect_new_line_struct(), Vect_new_list(), Vect_read_line(), Vect_reset_list(), Vect_select_lines_by_box(), and Vect_val_in_list().

Referenced by wxdisplay.DisplayDriver::SelectLineByPoint(), Vect_find_line(), and Vedit_connect_lines().

int Vect_find_node ( struct Map_info *  Map,
double  ux,
double  uy,
double  uz,
double  maxdist,
int  with_z 
)

Find the nearest node.

Parameters
[in]Mapvector map
[in]ux,uy,uzpoint coordinates
[in]maxdistmax distance from the line
[in]with_z3D (WITH_Z, WITHOUT_Z)
Returns
number of nearest node
0 if not found

Definition at line 38 of file vector/Vlib/find.c.

References tools::box, G_debug(), HUGE_VAL, Vect_get_node_coor(), Vect_new_list(), Vect_points_distance(), Vect_select_nodes_by_box(), and y.

Referenced by Vect_overlay_and().