predicates.qbk 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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. [#group__predicates_1gac52a6557110425d4ece53fbd6f9ff866]
  18. [section contains(Geometry const &)]
  19. '''<indexterm><primary>contains</primary></indexterm>'''
  20. Generate [^[link group__predicates_1gac52a6557110425d4ece53fbd6f9ff866 contains()]] predicate.
  21. [heading Description]
  22. Generate 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]
  23. [pre
  24. `template<``typename Geometry``>`
  25. /unspecified/ `contains``(``Geometry const &` `g``)`
  26. ]
  27. [heading Template parameter(s)]
  28. [table
  29. [[Parameter] [Description]]
  30. [[`Geometry`][The Geometry type.]]
  31. ]
  32. [heading Parameter(s)]
  33. [table
  34. [[Type][Name][Description]]
  35. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  36. ]
  37. [heading Example]
  38. ``
  39. bgi::query(spatial_index, bgi::contains(box), std::back_inserter(result));
  40. ``
  41. [endsect]
  42. [#group__predicates_1ga02dbb7cca47de0b921ef96af464d9590]
  43. [section covered_by(Geometry const &)]
  44. '''<indexterm><primary>covered_by</primary></indexterm>'''
  45. Generate [^[link group__predicates_1ga02dbb7cca47de0b921ef96af464d9590 covered_by()]] predicate.
  46. [heading Description]
  47. Generate 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]
  48. [pre
  49. `template<``typename Geometry``>`
  50. /unspecified/ `covered_by``(``Geometry const &` `g``)`
  51. ]
  52. [heading Template parameter(s)]
  53. [table
  54. [[Parameter] [Description]]
  55. [[`Geometry`][The Geometry type.]]
  56. ]
  57. [heading Parameter(s)]
  58. [table
  59. [[Type][Name][Description]]
  60. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  61. ]
  62. [heading Example]
  63. ``
  64. bgi::query(spatial_index, bgi::covered_by(box), std::back_inserter(result));
  65. ``
  66. [endsect]
  67. [#group__predicates_1ga0e92e4a20dd19185584fe85847439108]
  68. [section covers(Geometry const &)]
  69. '''<indexterm><primary>covers</primary></indexterm>'''
  70. Generate [^[link group__predicates_1ga0e92e4a20dd19185584fe85847439108 covers()]] predicate.
  71. [heading Description]
  72. Generate 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]
  73. [pre
  74. `template<``typename Geometry``>`
  75. /unspecified/ `covers``(``Geometry const &` `g``)`
  76. ]
  77. [heading Template parameter(s)]
  78. [table
  79. [[Parameter] [Description]]
  80. [[`Geometry`][The Geometry type.]]
  81. ]
  82. [heading Parameter(s)]
  83. [table
  84. [[Type][Name][Description]]
  85. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  86. ]
  87. [heading Example]
  88. ``
  89. bgi::query(spatial_index, bgi::covers(box), std::back_inserter(result));
  90. ``
  91. [endsect]
  92. [#group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da]
  93. [section disjoint(Geometry const &)]
  94. '''<indexterm><primary>disjoint</primary></indexterm>'''
  95. Generate [^[link group__predicates_1ga0aa114ab16f40c8caeb3338adba5d6da disjoint()]] predicate.
  96. [heading Description]
  97. Generate 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]
  98. [pre
  99. `template<``typename Geometry``>`
  100. /unspecified/ `disjoint``(``Geometry const &` `g``)`
  101. ]
  102. [heading Template parameter(s)]
  103. [table
  104. [[Parameter] [Description]]
  105. [[`Geometry`][The Geometry type.]]
  106. ]
  107. [heading Parameter(s)]
  108. [table
  109. [[Type][Name][Description]]
  110. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  111. ]
  112. [heading Example]
  113. ``
  114. bgi::query(spatial_index, bgi::disjoint(box), std::back_inserter(result));
  115. ``
  116. [endsect]
  117. [#group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5]
  118. [section intersects(Geometry const &)]
  119. '''<indexterm><primary>intersects</primary></indexterm>'''
  120. Generate [^[link group__predicates_1ga78cb2ef221b951867c591ffb51b7d8c5 intersects()]] predicate.
  121. [heading Description]
  122. Generate 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]
  123. [pre
  124. `template<``typename Geometry``>`
  125. /unspecified/ `intersects``(``Geometry const &` `g``)`
  126. ]
  127. [heading Template parameter(s)]
  128. [table
  129. [[Parameter] [Description]]
  130. [[`Geometry`][The Geometry type.]]
  131. ]
  132. [heading Parameter(s)]
  133. [table
  134. [[Type][Name][Description]]
  135. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  136. ]
  137. [heading Example]
  138. ``
  139. bgi::query(spatial_index, bgi::intersects(box), std::back_inserter(result));
  140. bgi::query(spatial_index, bgi::intersects(ring), std::back_inserter(result));
  141. bgi::query(spatial_index, bgi::intersects(polygon), std::back_inserter(result));
  142. ``
  143. [endsect]
  144. [#group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b]
  145. [section overlaps(Geometry const &)]
  146. '''<indexterm><primary>overlaps</primary></indexterm>'''
  147. Generate [^[link group__predicates_1ga4a6d33e6f61ad5bff3bdee50a972d54b overlaps()]] predicate.
  148. [heading Description]
  149. Generate 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]
  150. [pre
  151. `template<``typename Geometry``>`
  152. /unspecified/ `overlaps``(``Geometry const &` `g``)`
  153. ]
  154. [heading Template parameter(s)]
  155. [table
  156. [[Parameter] [Description]]
  157. [[`Geometry`][The Geometry type.]]
  158. ]
  159. [heading Parameter(s)]
  160. [table
  161. [[Type][Name][Description]]
  162. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  163. ]
  164. [heading Example]
  165. ``
  166. bgi::query(spatial_index, bgi::overlaps(box), std::back_inserter(result));
  167. ``
  168. [endsect]
  169. [#group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5]
  170. [section within(Geometry const &)]
  171. '''<indexterm><primary>within</primary></indexterm>'''
  172. Generate [^[link group__predicates_1gaabce901b82af2aab10ebbd0dda12f4d5 within()]] predicate.
  173. [heading Description]
  174. Generate 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]
  175. [pre
  176. `template<``typename Geometry``>`
  177. /unspecified/ `within``(``Geometry const &` `g``)`
  178. ]
  179. [heading Template parameter(s)]
  180. [table
  181. [[Parameter] [Description]]
  182. [[`Geometry`][The Geometry type.]]
  183. ]
  184. [heading Parameter(s)]
  185. [table
  186. [[Type][Name][Description]]
  187. [[`Geometry const &`][ `g` ][The Geometry object. ]]
  188. ]
  189. [heading Example]
  190. ``
  191. bgi::query(spatial_index, bgi::within(box), std::back_inserter(result));
  192. ``
  193. [endsect]
  194. [#group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c]
  195. [section satisfies(UnaryPredicate const &)]
  196. '''<indexterm><primary>satisfies</primary></indexterm>'''
  197. Generate [link group__predicates_1ga3213772dd3e54ad03340c2ca66b4f58c satisfies()] predicate.
  198. [heading Description]
  199. A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query.[heading Synopsis]
  200. [pre
  201. `template<``typename UnaryPredicate``>`
  202. /unspecified/ `satisfies``(``UnaryPredicate const &` `pred``)`
  203. ]
  204. [heading Template parameter(s)]
  205. [table
  206. [[Parameter] [Description]]
  207. [[`UnaryPredicate`][A type of unary predicate function or function object.]]
  208. ]
  209. [heading Parameter(s)]
  210. [table
  211. [[Type][Name][Description]]
  212. [[`UnaryPredicate const &`][ `pred` ][The unary predicate function or function object. ]]
  213. ]
  214. [heading Example]
  215. ``
  216. bool is_red(Value const& v) { return v.is_red(); }
  217. struct is_red_o {
  218. template <typename Value> bool operator()(Value const& v) { return v.is_red(); }
  219. }
  220. // ...
  221. rt.query(index::intersects(box) && index::satisfies(is_red),
  222. std::back_inserter(result));
  223. rt.query(index::intersects(box) && index::satisfies(is_red_o()),
  224. std::back_inserter(result));
  225. #ifndef BOOST_NO_CXX11_LAMBDAS
  226. rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }),
  227. std::back_inserter(result));
  228. #endif
  229. ``
  230. [endsect]
  231. [#group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e]
  232. [section nearest(Geometry const &, unsigned)]
  233. '''<indexterm><primary>nearest</primary></indexterm>'''
  234. Generate [link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()] predicate.
  235. [heading Description]
  236. When 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]
  237. [pre
  238. `template<``typename Geometry``>`
  239. /unspecified/ `nearest``(``Geometry const &` `geometry``,` `unsigned` `k``)`
  240. ]
  241. [heading Parameter(s)]
  242. [table
  243. [[Type][Name][Description]]
  244. [[`Geometry const &`][ `geometry` ][The geometry from which distance is calculated. ]]
  245. [[`unsigned`][ `k` ][The maximum number of values to return. ]]
  246. ]
  247. [heading Example]
  248. ``
  249. bgi::query(spatial_index, bgi::nearest(pt, 5), std::back_inserter(result));
  250. bgi::query(spatial_index, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result));
  251. bgi::query(spatial_index, bgi::nearest(box, 5), std::back_inserter(result));
  252. ``
  253. [warning Only one [^[link group__predicates_1ga8772d9d3e5b12b3292f7d94d47310e3e nearest()]] predicate may be used in a query.]
  254. [endsect]
  255. [endsect]