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
34enum FeatureFlags
35{
36 LAST_SPATIAL_ITEM = 1,
37 AREA = 1 << 1,
38 RELATION_MEMBER = 1 << 2,
39 WAYNODE = 1 << 5,
40 MULTITILE_WEST = 1 << 6,
41 MULTITILE_NORTH = 1 << 7
42};
43
44
45enum MemberFlags
46{
47 LAST = 1,
48 FOREIGN = 2,
49 DIFFERENT_ROLE = 4,
50 DIFFERENT_TILE = 8,
51 // TODO: This will change in 2.0 for relation tables and feature-node tables
52 // (moves to Bit 2 == value 4, to accommodate more TEX bits)
53 WIDE_NODE_TEX = 8,
54 WIDE_RELATION_TEX = 8,
55 WIDE_MEMBER_TEX = 16,
56};
57
58namespace FeatureConstants
59{
60 static const Tip START_TIP(0x4000);
61 // TODO: move to Tip? No, not really a characteristic of TIP,
62 // it is driven by the encoding used by member/node/relation tables
63 static const int MAX_COMMON_KEY = (1 << 13) - 2;
64 static const int MAX_COMMON_ROLE = (1 << 15) - 1;
65};
66
67// \endcond
68} // namespace geodesk
Definition Features.h:12