GRASS 8 Programmer's Manual
8.6.0dev(2026)-f6f2c534ea
Loading...
Searching...
No Matches
vector/Vlib/type.c
Go to the documentation of this file.
1
/*!
2
\file lib/vector/Vlib/type.c
3
4
\brief Vector library - feature type
5
6
Higher level functions for reading/writing/manipulating vectors.
7
8
(C) 2001-2009 by the GRASS Development Team
9
10
This program is free software under the GNU General Public License
11
(>=v2). Read the file COPYING that comes with GRASS for details.
12
13
\author Radim Blazek
14
*/
15
16
#include <
grass/vector.h
>
17
18
/*!
19
\brief Get types from options
20
21
\param type_opt Option structure
22
23
\return types
24
\return -1 on error
25
*/
26
int
Vect_option_to_types
(
const
struct
Option
*
type_opt
)
27
{
28
int
i, type;
29
30
type = 0;
31
for
(i = 0;
type_opt
->answers[i]; i++) {
32
if
(
strcmp
(
type_opt
->answers[i],
"auto"
) == 0)
33
continue
;
34
35
switch
(
type_opt
->answers[i][0]) {
36
case
'p'
:
37
type |=
GV_POINT
;
38
break
;
39
case
'l'
:
40
type |=
GV_LINE
;
41
break
;
42
case
'b'
:
43
type |=
GV_BOUNDARY
;
44
break
;
45
case
'c'
:
46
type |=
GV_CENTROID
;
47
break
;
48
case
'f'
:
49
type |=
GV_FACE
;
50
break
;
51
case
'k'
:
52
type |=
GV_KERNEL
;
53
break
;
54
case
'a'
:
55
type |=
GV_AREA
;
56
break
;
57
case
'v'
:
58
type |=
GV_VOLUME
;
59
break
;
60
}
61
}
62
63
return
type;
64
}
AMI_STREAM
Definition
ami_stream.h:153
GV_CENTROID
#define GV_CENTROID
Definition
dig_defines.h:186
GV_LINE
#define GV_LINE
Definition
dig_defines.h:184
GV_POINT
#define GV_POINT
Feature types used in memory on run time (may change)
Definition
dig_defines.h:183
GV_BOUNDARY
#define GV_BOUNDARY
Definition
dig_defines.h:185
GV_FACE
#define GV_FACE
Definition
dig_defines.h:187
GV_AREA
#define GV_AREA
Definition
dig_defines.h:189
GV_VOLUME
#define GV_VOLUME
Definition
dig_defines.h:190
GV_KERNEL
#define GV_KERNEL
Definition
dig_defines.h:188
Option
Structure that stores option information.
Definition
gis.h:563
Vect_option_to_types
int Vect_option_to_types(const struct Option *type_opt)
Get types from options.
Definition
vector/Vlib/type.c:26
vector.h
lib
vector
Vlib
type.c
Generated on Mon Apr 13 2026 06:59:42 for GRASS 8 Programmer's Manual by
1.9.8