GRASS 8 Programmer's Manual 8.6.0dev(2026)-56a9afeb9f
Loading...
Searching...
No Matches
vector/diglib/type.c
Go to the documentation of this file.
1/**
2 * \file diglib/type.c
3 *
4 * \brief Vector library - feature type conversion (lower level functions)
5 *
6 * Lower level functions for reading/writing/manipulating vectors.
7 *
8 * This program is free software under the GNU General Public License
9 * (>=v2). Read the file COPYING that comes with GRASS for details.
10 *
11 * \author Radim Blazek
12 *
13 * \date 2001
14 */
15
16#include <grass/vector.h>
17
18/*!
19 \brief Convert type to store type
20
21 \param type feature type
22
23 \return store type
24 */
25int dig_type_to_store(int type)
26{
27 switch (type) {
28 case GV_POINT:
29 return GV_STORE_POINT;
30 case GV_LINE:
31 return GV_STORE_LINE;
32 case GV_BOUNDARY:
33 return GV_STORE_BOUNDARY;
34 case GV_CENTROID:
35 return GV_STORE_CENTROID;
36 case GV_AREA:
37 return GV_STORE_AREA;
38 case GV_FACE:
39 return GV_STORE_FACE;
40 case GV_KERNEL:
41 return GV_STORE_KERNEL;
42 case GV_VOLUME:
43 return GV_STORE_VOLUME;
44 default:
45 return 0;
46 }
47}
48
49/*!
50 \brief Convert type from store type
51
52 \param stype feature store type
53
54 \return type
55 */
57{
58 switch (stype) {
59 case GV_STORE_POINT:
60 return GV_POINT;
61 case GV_STORE_LINE:
62 return GV_LINE;
64 return GV_BOUNDARY;
66 return GV_CENTROID;
67 case GV_STORE_AREA:
68 return GV_AREA;
69 case GV_STORE_FACE:
70 return GV_FACE;
71 case GV_STORE_KERNEL:
72 return GV_KERNEL;
73 case GV_STORE_VOLUME:
74 return GV_VOLUME;
75 default:
76 return 0;
77 }
78}
#define GV_STORE_AREA
#define GV_CENTROID
#define GV_LINE
#define GV_POINT
Feature types used in memory on run time (may change)
#define GV_BOUNDARY
#define GV_STORE_POINT
Feature types used in store like 'coor' file or postgis type column (must not change)
#define GV_FACE
#define GV_STORE_FACE
#define GV_STORE_KERNEL
#define GV_STORE_LINE
#define GV_STORE_VOLUME
#define GV_STORE_BOUNDARY
#define GV_AREA
#define GV_VOLUME
#define GV_STORE_CENTROID
#define GV_KERNEL
int dig_type_to_store(int type)
Convert type to store type.
int dig_type_from_store(int stype)
Convert type from store type.