GeoDesk for C++
Fast and storage-efficient spatial database engine for OpenStreetMap features
Loading...
Searching...
No Matches
types.h
Go to the documentation of this file.
1// Copyright (c) 2024 Clarisma / GeoDesk contributors
2// SPDX-License-Identifier: LGPL-3.0-only
3
4#pragma once
5
6#ifdef GEODESK_PYTHON
7#include <Python.h>
8#endif
9#include <cstdint>
11#include <geodesk/feature/Tip.h>
12
13namespace geodesk {
14
16
17enum FeatureIndexType
18{
19 NODES = 0,
20 WAYS = 1,
21 AREAS = 2,
22 RELATIONS = 3
23};
24
25class IndexBits
26{
27public:
28 static uint32_t fromCategory(int category)
29 {
30 return category == 0 ? 0 : (1 << (category - 1));
31 }
32};
33
34namespace FeatureFlags
35{
36 enum
37 {
38 LAST_SPATIAL_ITEM = 1,
39 AREA = 1 << 1,
40 RELATION_MEMBER = 1 << 2,
41 WAYNODE = 1 << 5,
42 MULTITILE_WEST = 1 << 6,
43 MULTITILE_NORTH = 1 << 7,
44 SHARED_LOCATION = 1 << 8,
45 EXCEPTION_NODE = 1 << 9,
46 UNMODIFIED = 1 << 10,
47 DELETED = 1 << 11
48 };
49}
50
51
52enum MemberFlags
53{
54 LAST = 1,
55 FOREIGN = 2,
56 DIFFERENT_ROLE = 4,
57 DIFFERENT_TILE = 8,
58 // TODO: This will change in 2.0 for relation tables and feature-node tables
59 // (moves to Bit 2 == value 4, to accommodate more TEX bits)
60 WIDE_NODE_TEX = 8,
61 WIDE_RELATION_TEX = 8,
62 WIDE_MEMBER_TEX = 16,
63};
64
65namespace FeatureConstants
66{
67 static const Tip START_TIP(0x4000);
68 // TODO: move to Tip? No, not really a characteristic of TIP,
69 // it is driven by the encoding used by member/node/relation tables
70 static const int MAX_COMMON_KEY = (1 << 13) - 2;
71 static const int MAX_COMMON_ROLE = (1 << 15) - 1;
72};
73
74// \endcond
75} // namespace geodesk
Definition Feature.h:11