• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
2[/ Generated from xml/group__predicates.xml]
3[section:group__predicates Predicates (boost::geometry::index::)]
4[heading Functions]
5[table
6[[Function][Description]]
7[[[link group__predicates_1gac52a6557110425d4ece53fbd6f9ff866 `contains(Geometry const &)`]][Generate [^[link group__predicates_1gac52a6557110425d4ece53fbd6f9ff866 contains()]] predicate. ]]
8[[[link group__predicates_1ga02dbb7cca47de0b921ef96af464d9590 `covered_by(Geometry const &)`]][Generate [^[link group__predicates_1ga02dbb7cca47de0b921ef96af464d9590 covered_by()]] predicate. ]]
9[[[link group__predicates_1ga0e92e4a20dd19185584fe85847439108 `covers(Geometry const &)`]][Generate [^[link group__predicates_1ga0e92e4a20dd19185584fe85847439108 covers()]] predicate. ]]
10[[[link group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da `disjoint(Geometry const &)`]][Generate [^[link group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da disjoint()]] predicate. ]]
11[[[link group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5 `intersects(Geometry const &)`]][Generate [^[link group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5 intersects()]] predicate. ]]
12[[[link group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b `overlaps(Geometry const &)`]][Generate [^[link group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b overlaps()]] predicate. ]]
13[[[link group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5 `within(Geometry const &)`]][Generate [^[link group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5 within()]] predicate. ]]
14[[[link group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c `satisfies(UnaryPredicate const &)`]][Generate [link group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c satisfies()] predicate. ]]
15[[[link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e `nearest(Geometry const &, unsigned)`]][Generate [link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()] predicate. ]]
16]
17
18[#group__predicates_1gac52a6557110425d4ece53fbd6f9ff866]
19[section contains(Geometry const &)]
20'''<indexterm><primary>contains</primary></indexterm>'''
21Generate [^[link group__predicates_1gac52a6557110425d4ece53fbd6f9ff866 contains()]] predicate.
22
23[heading Description]
24Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that contain passed Geometry. Value is returned by the query if [^`bg::within(Geometry, Indexable)`] returns [^`true`].[heading Synopsis]
25[pre
26`template<``typename Geometry``>`
27/unspecified/ `contains``(``Geometry const &` `g``)`
28]
29
30[heading Template parameter(s)]
31[table
32[[Parameter] [Description]]
33[[`Geometry`][The Geometry type.]]
34]
35
36[heading Parameter(s)]
37[table
38[[Type][Name][Description]]
39[[`Geometry const &`][ `g` ][The Geometry object. ]]
40]
41[heading Example]
42
43``
44bgi::query(spatial_index, bgi::contains(box), std::back_inserter(result));
45``
46
47
48[endsect]
49
50[#group__predicates_1ga02dbb7cca47de0b921ef96af464d9590]
51[section covered_by(Geometry const &)]
52'''<indexterm><primary>covered_by</primary></indexterm>'''
53Generate [^[link group__predicates_1ga02dbb7cca47de0b921ef96af464d9590 covered_by()]] predicate.
54
55[heading Description]
56Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that are covered by passed Geometry. Value is returned by the query if [^`bg::covered_by(Indexable, Geometry)`] returns [^`true`].[heading Synopsis]
57[pre
58`template<``typename Geometry``>`
59/unspecified/ `covered_by``(``Geometry const &` `g``)`
60]
61
62[heading Template parameter(s)]
63[table
64[[Parameter] [Description]]
65[[`Geometry`][The Geometry type.]]
66]
67
68[heading Parameter(s)]
69[table
70[[Type][Name][Description]]
71[[`Geometry const &`][ `g` ][The Geometry object. ]]
72]
73[heading Example]
74
75``
76bgi::query(spatial_index, bgi::covered_by(box), std::back_inserter(result));
77``
78
79
80[endsect]
81
82[#group__predicates_1ga0e92e4a20dd19185584fe85847439108]
83[section covers(Geometry const &)]
84'''<indexterm><primary>covers</primary></indexterm>'''
85Generate [^[link group__predicates_1ga0e92e4a20dd19185584fe85847439108 covers()]] predicate.
86
87[heading Description]
88Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that cover passed Geometry. Value is returned by the query if [^`bg::covered_by(Geometry, Indexable)`] returns [^`true`].[heading Synopsis]
89[pre
90`template<``typename Geometry``>`
91/unspecified/ `covers``(``Geometry const &` `g``)`
92]
93
94[heading Template parameter(s)]
95[table
96[[Parameter] [Description]]
97[[`Geometry`][The Geometry type.]]
98]
99
100[heading Parameter(s)]
101[table
102[[Type][Name][Description]]
103[[`Geometry const &`][ `g` ][The Geometry object. ]]
104]
105[heading Example]
106
107``
108bgi::query(spatial_index, bgi::covers(box), std::back_inserter(result));
109``
110
111
112[endsect]
113
114[#group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da]
115[section disjoint(Geometry const &)]
116'''<indexterm><primary>disjoint</primary></indexterm>'''
117Generate [^[link group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da disjoint()]] predicate.
118
119[heading Description]
120Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that are disjoint with passed Geometry. Value is returned by the query if [^`bg::disjoint(Indexable, Geometry)`] returns [^`true`].[heading Synopsis]
121[pre
122`template<``typename Geometry``>`
123/unspecified/ `disjoint``(``Geometry const &` `g``)`
124]
125
126[heading Template parameter(s)]
127[table
128[[Parameter] [Description]]
129[[`Geometry`][The Geometry type.]]
130]
131
132[heading Parameter(s)]
133[table
134[[Type][Name][Description]]
135[[`Geometry const &`][ `g` ][The Geometry object. ]]
136]
137[heading Example]
138
139``
140bgi::query(spatial_index, bgi::disjoint(box), std::back_inserter(result));
141``
142
143
144[endsect]
145
146[#group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5]
147[section intersects(Geometry const &)]
148'''<indexterm><primary>intersects</primary></indexterm>'''
149Generate [^[link group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5 intersects()]] predicate.
150
151[heading Description]
152Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that intersect passed Geometry. Value is returned by the query if [^`bg::intersects(Indexable, Geometry)`] returns [^`true`].[heading Synopsis]
153[pre
154`template<``typename Geometry``>`
155/unspecified/ `intersects``(``Geometry const &` `g``)`
156]
157
158[heading Template parameter(s)]
159[table
160[[Parameter] [Description]]
161[[`Geometry`][The Geometry type.]]
162]
163
164[heading Parameter(s)]
165[table
166[[Type][Name][Description]]
167[[`Geometry const &`][ `g` ][The Geometry object. ]]
168]
169[heading Example]
170
171``
172bgi::query(spatial_index, bgi::intersects(box), std::back_inserter(result));
173bgi::query(spatial_index, bgi::intersects(ring), std::back_inserter(result));
174bgi::query(spatial_index, bgi::intersects(polygon), std::back_inserter(result));
175``
176
177
178[endsect]
179
180[#group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b]
181[section overlaps(Geometry const &)]
182'''<indexterm><primary>overlaps</primary></indexterm>'''
183Generate [^[link group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b overlaps()]] predicate.
184
185[heading Description]
186Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that overlap passed Geometry. Value is returned by the query if [^`bg::overlaps(Indexable, Geometry)`] returns [^`true`].[heading Synopsis]
187[pre
188`template<``typename Geometry``>`
189/unspecified/ `overlaps``(``Geometry const &` `g``)`
190]
191
192[heading Template parameter(s)]
193[table
194[[Parameter] [Description]]
195[[`Geometry`][The Geometry type.]]
196]
197
198[heading Parameter(s)]
199[table
200[[Type][Name][Description]]
201[[`Geometry const &`][ `g` ][The Geometry object. ]]
202]
203[heading Example]
204
205``
206bgi::query(spatial_index, bgi::overlaps(box), std::back_inserter(result));
207``
208
209
210[endsect]
211
212[#group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5]
213[section within(Geometry const &)]
214'''<indexterm><primary>within</primary></indexterm>'''
215Generate [^[link group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5 within()]] predicate.
216
217[heading Description]
218Generate a predicate defining Value and Geometry relationship. With this predicate query returns indexed Values that are within passed Geometry. Value is returned by the query if [^`bg::within(Indexable, Geometry)`] returns [^`true`].[heading Synopsis]
219[pre
220`template<``typename Geometry``>`
221/unspecified/ `within``(``Geometry const &` `g``)`
222]
223
224[heading Template parameter(s)]
225[table
226[[Parameter] [Description]]
227[[`Geometry`][The Geometry type.]]
228]
229
230[heading Parameter(s)]
231[table
232[[Type][Name][Description]]
233[[`Geometry const &`][ `g` ][The Geometry object. ]]
234]
235[heading Example]
236
237``
238bgi::query(spatial_index, bgi::within(box), std::back_inserter(result));
239``
240
241
242[endsect]
243
244[#group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c]
245[section satisfies(UnaryPredicate const &)]
246'''<indexterm><primary>satisfies</primary></indexterm>'''
247Generate [link group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c satisfies()] predicate.
248
249[heading Description]
250A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query.[heading Synopsis]
251[pre
252`template<``typename UnaryPredicate``>`
253/unspecified/ `satisfies``(``UnaryPredicate const &` `pred``)`
254]
255
256[heading Template parameter(s)]
257[table
258[[Parameter] [Description]]
259[[`UnaryPredicate`][A type of unary predicate function or function object.]]
260]
261
262[heading Parameter(s)]
263[table
264[[Type][Name][Description]]
265[[`UnaryPredicate const &`][ `pred` ][The unary predicate function or function object. ]]
266]
267[heading Example]
268
269``
270bool is_red(Value const& v) { return v.is_red(); }
271
272struct is_red_o {
273template <typename Value> bool operator()(Value const& v) { return v.is_red(); }
274}
275
276// ...
277
278rt.query(index::intersects(box) && index::satisfies(is_red),
279std::back_inserter(result));
280
281rt.query(index::intersects(box) && index::satisfies(is_red_o()),
282std::back_inserter(result));
283
284#ifndef BOOST_NO_CXX11_LAMBDAS
285rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }),
286std::back_inserter(result));
287#endif
288``
289
290
291[endsect]
292
293[#group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e]
294[section nearest(Geometry const &, unsigned)]
295'''<indexterm><primary>nearest</primary></indexterm>'''
296Generate [link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()] predicate.
297
298[heading Description]
299When nearest predicate is passed to the query, k-nearest neighbour search will be performed. [^[link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()]] predicate takes a [^`Geometry`] from which distances to [^`Values`] are calculated and the maximum number of [^`Values`] that should be returned. Internally boost::geometry::comparable_distance() is used to perform the calculation.[heading Synopsis]
300[pre
301`template<``typename Geometry``>`
302/unspecified/ `nearest``(``Geometry const &` `geometry``,` `unsigned` `k``)`
303]
304
305[heading Parameter(s)]
306[table
307[[Type][Name][Description]]
308[[`Geometry const &`][ `geometry` ][The geometry from which distance is calculated. ]]
309[[`unsigned`][ `k` ][The maximum number of values to return. ]]
310]
311[heading Example]
312
313``
314bgi::query(spatial_index, bgi::nearest(pt, 5), std::back_inserter(result));
315bgi::query(spatial_index, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result));
316bgi::query(spatial_index, bgi::nearest(box, 5), std::back_inserter(result));
317``
318
319
320[warning Only one [^[link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()]] predicate may be used in a query.]
321
322[endsect]
323
324[endsect]
325
326