GRASS 8 Programmer's Manual
8.6.0dev(2026)-745b61fbf6
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
SPDX-FileCopyrightText: 2001-2009 GRASS Development Team
9
SPDX-License-Identifier: GPL-2.0-or-later
10
11
\author Radim Blazek
12
*/
13
14
#include <
grass/vector.h
>
15
16
/*!
17
\brief Get types from options
18
19
\param type_opt Option structure
20
21
\return types
22
\return -1 on error
23
*/
24
int
Vect_option_to_types
(
const
struct
Option
*
type_opt
)
25
{
26
int
i, type;
27
28
type = 0;
29
for
(i = 0;
type_opt
->answers[i]; i++) {
30
if
(
strcmp
(
type_opt
->answers[i],
"auto"
) == 0)
31
continue
;
32
33
switch
(
type_opt
->answers[i][0]) {
34
case
'p'
:
35
type |=
GV_POINT
;
36
break
;
37
case
'l'
:
38
type |=
GV_LINE
;
39
break
;
40
case
'b'
:
41
type |=
GV_BOUNDARY
;
42
break
;
43
case
'c'
:
44
type |=
GV_CENTROID
;
45
break
;
46
case
'f'
:
47
type |=
GV_FACE
;
48
break
;
49
case
'k'
:
50
type |=
GV_KERNEL
;
51
break
;
52
case
'a'
:
53
type |=
GV_AREA
;
54
break
;
55
case
'v'
:
56
type |=
GV_VOLUME
;
57
break
;
58
}
59
}
60
61
return
type;
62
}
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:560
Vect_option_to_types
int Vect_option_to_types(const struct Option *type_opt)
Get types from options.
Definition
vector/Vlib/type.c:24
vector.h
lib
vector
Vlib
type.c
Generated on Wed Sep 16 2026 06:58:09 for GRASS 8 Programmer's Manual by
1.9.8