MapLibre Native C API
Public C ABI for the MapLibre Native wrapper.
Loading...
Searching...
No Matches
query.h
Go to the documentation of this file.
1
9
10#ifndef MAPLIBRE_NATIVE_C_QUERY_H
11#define MAPLIBRE_NATIVE_C_QUERY_H
12
13#include <stddef.h>
14#include <stdint.h>
15
16#include "base.h"
17#include "completion.h"
18#include "map.h"
19
20#ifdef __cplusplus
21extern "C" {
22#endif
23
25typedef enum mln_rendered_query_geometry_type : uint32_t {
26 MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT = 1,
27 MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX = 2,
28 MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING = 3,
30
41
43typedef struct mln_screen_line_string {
45 const mln_screen_point* points MLN_BINDING("length=point_count");
46 size_t point_count;
48
52 MLN_BINDING("variant=MLN_RENDERED_QUERY_GEOMETRY_TYPE_POINT");
54 MLN_BINDING("variant=MLN_RENDERED_QUERY_GEOMETRY_TYPE_BOX");
55 mln_screen_line_string line_string
56 MLN_BINDING("variant=MLN_RENDERED_QUERY_GEOMETRY_TYPE_LINE_STRING");
58
61 uint32_t size;
63 uint32_t type MLN_BINDING("enum=mln_rendered_query_geometry_type");
66
68typedef enum MLN_BINDING(
69 "kind=bitmask"
71 MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS = 1U << 0U,
72 MLN_RENDERED_FEATURE_QUERY_OPTION_FILTER = 1U << 1U,
74
77 uint32_t size;
78 uint32_t fields MLN_BINDING("enum=mln_rendered_feature_query_option_field");
81 "length=layer_id_count;mask=fields;"
82 "bit=MLN_RENDERED_FEATURE_QUERY_OPTION_LAYER_IDS"
83 );
84 size_t layer_id_count;
87 "encoding=json;mask=fields;bit=MLN_RENDERED_FEATURE_QUERY_OPTION_FILTER"
88 );
90
92typedef enum MLN_BINDING(
93 "kind=bitmask"
95 MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS = 1U << 0U,
96 MLN_SOURCE_FEATURE_QUERY_OPTION_FILTER = 1U << 1U,
98
101 uint32_t size;
102 uint32_t fields MLN_BINDING("enum=mln_source_feature_query_option_field");
107 "length=source_layer_id_count;mask=fields;"
108 "bit=MLN_SOURCE_FEATURE_QUERY_OPTION_SOURCE_LAYER_IDS"
109 );
110 size_t source_layer_id_count;
113 "encoding=json;mask=fields;bit=MLN_SOURCE_FEATURE_QUERY_OPTION_FILTER"
114 );
116
118typedef enum MLN_BINDING("kind=bitmask") mln_rendered_feature_field : uint32_t {
119 MLN_RENDERED_FEATURE_SOURCE_ID = 1U << 0U,
120 MLN_RENDERED_FEATURE_SOURCE_LAYER_ID = 1U << 1U,
121 MLN_RENDERED_FEATURE_STATE = 1U << 2U,
123
134typedef struct mln_rendered_feature {
135 uint32_t fields MLN_BINDING("enum=mln_rendered_feature_field");
136 mln_buffer_view feature MLN_BINDING("encoding=json");
137 mln_buffer_view layer_id;
138 mln_buffer_view source_id
139 MLN_BINDING("mask=fields;bit=MLN_RENDERED_FEATURE_SOURCE_ID");
140 mln_buffer_view source_layer_id
141 MLN_BINDING("mask=fields;bit=MLN_RENDERED_FEATURE_SOURCE_LAYER_ID");
142 mln_buffer_view state
143 MLN_BINDING("encoding=json;mask=fields;bit=MLN_RENDERED_FEATURE_STATE");
145
147typedef enum MLN_BINDING("kind=bitmask") mln_source_feature_field : uint32_t {
148 MLN_SOURCE_FEATURE_SOURCE_LAYER_ID = 1U << 0U,
150
159typedef struct mln_source_feature {
160 uint32_t fields MLN_BINDING("enum=mln_source_feature_field");
161 mln_buffer_view feature MLN_BINDING("encoding=json");
162 mln_buffer_view source_layer_id
163 MLN_BINDING("mask=fields;bit=MLN_SOURCE_FEATURE_SOURCE_LAYER_ID");
165
169
173
199MLN_BINDING("execution=query;result=mln_rendered_feature;shape=array")
201 mln_render_session session, const mln_rendered_query_geometry* geometry,
203 MLN_BINDING("nullable=true"),
204 const mln_completion* completion, mln_diagnostic* out_diagnostic
205) MLN_NOEXCEPT;
206
227MLN_BINDING("execution=query;result=mln_source_feature;shape=array")
229 mln_render_session session, mln_buffer_view source_id,
230 const mln_source_feature_query_options* options MLN_BINDING("nullable=true"),
231 const mln_completion* completion, mln_diagnostic* out_diagnostic
232) MLN_NOEXCEPT;
233
258MLN_BINDING("execution=query;result=mln_buffer_view;encoding=json")
260 mln_render_session session, mln_buffer_view source_id,
261 mln_buffer_view feature MLN_BINDING("encoding=json"),
262 mln_buffer_view extension, mln_buffer_view extension_field,
263 const mln_buffer_view* arguments MLN_BINDING("encoding=json;nullable=true"),
264 const mln_completion* completion, mln_diagnostic* out_diagnostic
265) MLN_NOEXCEPT;
266
267#ifdef __cplusplus
268}
269#endif
270
271#endif // MAPLIBRE_NATIVE_C_QUERY_H
uint64_t mln_render_session
Definition base.h:161
mln_status
Definition base.h:61
#define MLN_BINDING(contract)
Definition binding.h:17
mln_rendered_feature_query_options mln_rendered_feature_query_options_default(void)
mln_rendered_query_geometry_type
Definition query.h:25
mln_source_feature_field
Definition query.h:147
mln_rendered_feature_query_option_field
Definition query.h:70
mln_source_feature_query_option_field
Definition query.h:94
mln_status mln_render_session_query_source_features(mln_render_session session, mln_buffer_view source_id, const mln_source_feature_query_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_rendered_feature_field
Definition query.h:118
mln_status mln_render_session_query_feature_extensions(mln_render_session session, mln_buffer_view source_id, mln_buffer_view feature, mln_buffer_view extension, mln_buffer_view extension_field, const mln_buffer_view *arguments, const mln_completion *completion, mln_diagnostic *out_diagnostic)
mln_source_feature_query_options mln_source_feature_query_options_default(void)
mln_status mln_render_session_query_rendered_features(mln_render_session session, const mln_rendered_query_geometry *geometry, const mln_rendered_feature_query_options *options, const mln_completion *completion, mln_diagnostic *out_diagnostic)
Definition base.h:192
Definition completion.h:121
Definition base.h:100
mln_buffer_view filter
Definition query.h:88
const mln_buffer_view * layer_ids
Definition query.h:83
Definition query.h:134
Definition query.h:60
uint32_t type
Definition query.h:63
Definition query.h:37
Definition query.h:43
const mln_screen_point * points
Definition query.h:45
Definition map.h:216
Definition query.h:100
mln_buffer_view filter
Definition query.h:114
const mln_buffer_view * source_layer_ids
Definition query.h:109
Definition query.h:159