boat
C++23 geospatial library
Loading...
Searching...
No Matches
meta.hpp
Go to the documentation of this file.
1
// Andrew Naplavkov
2
3
#ifndef BOAT_DB_META_HPP
4
#define BOAT_DB_META_HPP
5
6
#include <cstdint>
7
#include <ranges>
8
#include <string>
9
#include <vector>
10
11
namespace
boat::db
{
12
13
struct
source
{
14
std::string
source_name
;
15
std::string
address
;
16
};
17
18
struct
layer
{
19
std::string
schema_name
;
20
std::string
table_name
;
21
std::string
column_name
;
22
bool
raster
;
23
24
friend
bool
operator==
(
layer
const
&,
layer
const
&) =
default
;
25
};
26
27
struct
column
{
28
std::string
kind
;
29
std::string
column_name
;
30
std::string
type_name
;
31
int
length
;
32
int
srid
;
33
int
epsg
;
34
std::string
wkt
;
35
std::string
proj4
;
36
37
bool
has_coord_sys
()
const
38
{
39
return
epsg
> 0 || !
wkt
.empty() || !
proj4
.empty();
40
}
41
};
42
43
struct
index_key
{
44
std::string
schema_name
;
45
std::string
index_name
;
46
std::string
column_name
;
47
bool
descending
;
48
bool
partial
;
49
bool
primary
;
50
bool
unique
;
51
int
ordinal
;
52
};
53
54
struct
table
{
55
std::string
dbms
;
56
std::string
schema_name
;
57
std::string
table_name
;
58
std::vector<column>
columns
;
59
std::vector<index_key>
index_keys
;
60
61
auto
indices
()
const
62
{
63
return
index_keys
| std::views::chunk_by([](
auto
& lhs,
auto
& rhs) {
64
return
lhs.ordinal < rhs.ordinal;
65
});
66
}
67
};
68
70
struct
bbox
{
71
std::vector<std::string>
select_list
;
72
std::string
layer_column
;
73
double
xmin
;
74
double
ymin
;
75
double
xmax
;
76
double
ymax
;
77
int
limit
;
78
};
79
80
struct
order_key
{
81
std::string
column_name
;
82
bool
descending
;
83
};
84
86
struct
page
{
87
std::vector<std::string>
select_list
;
88
std::vector<order_key>
order_by
;
89
size_t
offset
;
90
int
limit
;
91
};
92
93
struct
band
{
94
std::string
color_name
;
95
std::string
type_name
;
96
};
97
98
struct
raster
{
99
std::string
schema_name
;
100
std::string
table_name
;
101
std::string
column_name
;
102
std::vector<band>
bands
;
103
int
width
;
104
int
height
;
105
double
xorig
;
106
double
yorig
;
107
double
xscale
;
108
double
yscale
;
109
double
xskew
;
110
double
yskew
;
111
int
srid
;
112
int
epsg
;
113
std::string
wkt
;
114
std::string
proj4
;
115
};
116
117
struct
rect
{
118
int
x
;
119
int
y
;
120
int
width
;
121
int
height
;
122
};
123
124
}
// namespace boat::db
125
126
#endif
// BOAT_DB_META_HPP
boat::db
Definition
geometry.hpp:9
boat::db::band
Definition
meta.hpp:93
boat::db::band::color_name
std::string color_name
lower case
Definition
meta.hpp:94
boat::db::band::type_name
std::string type_name
lower case
Definition
meta.hpp:95
boat::db::bbox
Spatial filter for row selection.
Definition
meta.hpp:70
boat::db::bbox::xmin
double xmin
Definition
meta.hpp:73
boat::db::bbox::ymax
double ymax
Definition
meta.hpp:76
boat::db::bbox::ymin
double ymin
Definition
meta.hpp:74
boat::db::bbox::limit
int limit
Definition
meta.hpp:77
boat::db::bbox::layer_column
std::string layer_column
Definition
meta.hpp:72
boat::db::bbox::select_list
std::vector< std::string > select_list
Definition
meta.hpp:71
boat::db::bbox::xmax
double xmax
Definition
meta.hpp:75
boat::db::column
Definition
meta.hpp:27
boat::db::column::kind
std::string kind
Definition
meta.hpp:28
boat::db::column::proj4
std::string proj4
Definition
meta.hpp:35
boat::db::column::srid
int srid
Definition
meta.hpp:32
boat::db::column::wkt
std::string wkt
Definition
meta.hpp:34
boat::db::column::type_name
std::string type_name
lower case
Definition
meta.hpp:30
boat::db::column::length
int length
Definition
meta.hpp:31
boat::db::column::column_name
std::string column_name
Definition
meta.hpp:29
boat::db::column::epsg
int epsg
Definition
meta.hpp:33
boat::db::column::has_coord_sys
bool has_coord_sys() const
Definition
meta.hpp:37
boat::db::index_key
Definition
meta.hpp:43
boat::db::index_key::ordinal
int ordinal
one-based
Definition
meta.hpp:51
boat::db::index_key::partial
bool partial
Definition
meta.hpp:48
boat::db::index_key::primary
bool primary
Definition
meta.hpp:49
boat::db::index_key::column_name
std::string column_name
Definition
meta.hpp:46
boat::db::index_key::index_name
std::string index_name
Definition
meta.hpp:45
boat::db::index_key::descending
bool descending
Definition
meta.hpp:47
boat::db::index_key::schema_name
std::string schema_name
Definition
meta.hpp:44
boat::db::index_key::unique
bool unique
Definition
meta.hpp:50
boat::db::layer
Definition
meta.hpp:18
boat::db::layer::table_name
std::string table_name
Definition
meta.hpp:20
boat::db::layer::column_name
std::string column_name
Definition
meta.hpp:21
boat::db::layer::operator==
friend bool operator==(layer const &, layer const &)=default
boat::db::layer::schema_name
std::string schema_name
Definition
meta.hpp:19
boat::db::layer::raster
bool raster
Definition
meta.hpp:22
boat::db::order_key
Definition
meta.hpp:80
boat::db::order_key::column_name
std::string column_name
Definition
meta.hpp:81
boat::db::order_key::descending
bool descending
Definition
meta.hpp:82
boat::db::page
Pagination filter for row selection.
Definition
meta.hpp:86
boat::db::page::limit
int limit
Definition
meta.hpp:90
boat::db::page::order_by
std::vector< order_key > order_by
Definition
meta.hpp:88
boat::db::page::offset
size_t offset
Definition
meta.hpp:89
boat::db::page::select_list
std::vector< std::string > select_list
Definition
meta.hpp:87
boat::db::raster
Definition
meta.hpp:98
boat::db::raster::proj4
std::string proj4
Definition
meta.hpp:114
boat::db::raster::xorig
double xorig
Definition
meta.hpp:105
boat::db::raster::column_name
std::string column_name
Definition
meta.hpp:101
boat::db::raster::yskew
double yskew
Definition
meta.hpp:110
boat::db::raster::height
int height
Definition
meta.hpp:104
boat::db::raster::bands
std::vector< band > bands
Definition
meta.hpp:102
boat::db::raster::table_name
std::string table_name
Definition
meta.hpp:100
boat::db::raster::xscale
double xscale
Definition
meta.hpp:107
boat::db::raster::yorig
double yorig
Definition
meta.hpp:106
boat::db::raster::width
int width
Definition
meta.hpp:103
boat::db::raster::epsg
int epsg
Definition
meta.hpp:112
boat::db::raster::srid
int srid
Definition
meta.hpp:111
boat::db::raster::wkt
std::string wkt
Definition
meta.hpp:113
boat::db::raster::yscale
double yscale
Definition
meta.hpp:108
boat::db::raster::schema_name
std::string schema_name
Definition
meta.hpp:99
boat::db::raster::xskew
double xskew
Definition
meta.hpp:109
boat::db::rect
Definition
meta.hpp:117
boat::db::rect::width
int width
Definition
meta.hpp:120
boat::db::rect::x
int x
Definition
meta.hpp:118
boat::db::rect::y
int y
Definition
meta.hpp:119
boat::db::rect::height
int height
Definition
meta.hpp:121
boat::db::source
Definition
meta.hpp:13
boat::db::source::source_name
std::string source_name
Definition
meta.hpp:14
boat::db::source::address
std::string address
Definition
meta.hpp:15
boat::db::table
Definition
meta.hpp:54
boat::db::table::index_keys
std::vector< index_key > index_keys
Definition
meta.hpp:59
boat::db::table::indices
auto indices() const
Definition
meta.hpp:61
boat::db::table::table_name
std::string table_name
Definition
meta.hpp:57
boat::db::table::schema_name
std::string schema_name
Definition
meta.hpp:56
boat::db::table::columns
std::vector< column > columns
Definition
meta.hpp:58
boat::db::table::dbms
std::string dbms
lower case
Definition
meta.hpp:55
include
boat
db
meta.hpp
Generated by
1.15.0