grass  7.8.6
About: GRASS (Geographic Resources Analysis Support System) is a raster- and vector-based GIS, image processing system, graphics production system and spatial modeling system.
  Fossies Dox: grass-7.8.6.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

select.c File Reference

Vedit library - select primitives by query. More...

#include <math.h>
#include <grass/glocale.h>
#include <grass/vedit.h>
Include dependency graph for select.c:

Go to the source code of this file.

Functions

static int select_by_query (struct Map_info *Map, int line, int type, double thresh, int query, struct line_pnts *Points, struct line_cats *Cats)
 Query selected primitive. More...
 
static int merge_lists (struct ilist *alist, struct ilist *blist)
 Merge two lists, i.e. store only duplicate items. More...
 
int Vedit_select_by_query (struct Map_info *Map, int type, int layer, double thresh, int query, struct ilist *List)
 Select primitives by query (based on geometry properties) More...
 

Detailed Description

Vedit library - select primitives by query.

(C) 2007-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
Martin Landa <landa.martin gmail.com>

Definition in file select.c.

Function Documentation

◆ merge_lists()

int merge_lists ( struct ilist alist,
struct ilist blist 
)
static

Merge two lists, i.e. store only duplicate items.

Parameters
[in,out]alistlist to be merged
blistlist used for merging
Returns
result number of items

Definition at line 245 of file select.c.

References ilist::n_values, ilist::value, Vect_destroy_list(), Vect_list_append(), Vect_list_delete_list(), Vect_new_list(), and Vect_val_in_list().

Referenced by Vedit_select_by_query().

◆ select_by_query()

int select_by_query ( struct Map_info Map,
int  line,
int  type,
double  thresh,
int  query,
struct line_pnts Points,
struct line_cats Cats 
)
static

◆ Vedit_select_by_query()

int Vedit_select_by_query ( struct Map_info Map,
int  type,
int  layer,
double  thresh,
int  query,
struct ilist List 
)

Select primitives by query (based on geometry properties)

Currently supported:

  • QUERY_LENGTH, select all lines longer than threshold (or shorter if threshold is < 0)
  • QUERY_DANGLE, select all dangles longer than threshold (or shorter if threshold is < 0)

Perform global query if List is empty otherwise query only selected vector objects.

Parameters
Mappointer to Map_info
typefeature type
layerlayer number
threshthreshold value (< 0 for 'shorter', > 0 for 'longer')
queryquery (length, dangle, ...)
[in,out]Listlist of selected features
Returns
number of selected primitives

Definition at line 42 of file select.c.

References G_debug(), line(), merge_lists(), ilist::n_values, Points, QUERY_DANGLE, QUERY_LENGTH, select_by_query(), type, ilist::value, Vect_destroy_cats_struct(), Vect_destroy_line_struct(), Vect_destroy_list(), Vect_get_num_lines(), Vect_list_append(), Vect_new_cats_struct(), Vect_new_line_struct(), Vect_new_list(), Vect_select_dangles(), and Vect_val_in_list().