[/ Generated by doxygen_xml2qbk 1.1.1, don't change, will be overwritten automatically]
[/ Generated from xml/group__predicates.xml]
[section:group__predicates Predicates (boost::geometry::index::)]
[heading Functions]
[table
[[Function][Description]]
[[[link group__predicates_1gaff057c9f612ef416fd834e4d59eb26e1 `contains(Geometry const &)`]][Generate [^[link group__predicates_1gaff057c9f612ef416fd834e4d59eb26e1 contains()]] predicate. ]]
[[[link group__predicates_1ga33e1bf84e5e3658fe19b19f6331314b3 `covered_by(Geometry const &)`]][Generate [^[link group__predicates_1ga33e1bf84e5e3658fe19b19f6331314b3 covered_by()]] predicate. ]]
[[[link group__predicates_1ga546e417153441edbeeb55c50234bbeea `covers(Geometry const &)`]][Generate [^[link group__predicates_1ga546e417153441edbeeb55c50234bbeea covers()]] predicate. ]]
[[[link group__predicates_1gac4f2328326b16c98736a6dbb70948fba `disjoint(Geometry const &)`]][Generate [^[link group__predicates_1gac4f2328326b16c98736a6dbb70948fba disjoint()]] predicate. ]]
[[[link group__predicates_1ga2e4da4b87ceea63756ec854aa265647c `intersects(Geometry const &)`]][Generate [^[link group__predicates_1ga2e4da4b87ceea63756ec854aa265647c intersects()]] predicate. ]]
[[[link group__predicates_1gac94f965fd8d5b2200cb2493b9f1968ee `overlaps(Geometry const &)`]][Generate [^[link group__predicates_1gac94f965fd8d5b2200cb2493b9f1968ee overlaps()]] predicate. ]]
[[[link group__predicates_1ga2aa3520641e62522877d0e7dc9d4bf0d `within(Geometry const &)`]][Generate [^[link group__predicates_1ga2aa3520641e62522877d0e7dc9d4bf0d within()]] predicate. ]]
[[[link group__predicates_1gaf23b2a001cdc392f58c22f64d96aa97b `satisfies(UnaryPredicate const &)`]][Generate [link group__predicates_1gaf23b2a001cdc392f58c22f64d96aa97b satisfies()] predicate. ]]
[[[link group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e `nearest(Geometry const &, std::size_t)`]][Generate [link group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e nearest()] predicate. ]]
]

[#group__predicates_1gaff057c9f612ef416fd834e4d59eb26e1]
[section contains(Geometry const &)]
'''<indexterm><primary>contains</primary></indexterm>'''
Generate [^[link group__predicates_1gaff057c9f612ef416fd834e4d59eb26e1 contains()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `contains``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::contains(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1ga33e1bf84e5e3658fe19b19f6331314b3]
[section covered_by(Geometry const &)]
'''<indexterm><primary>covered_by</primary></indexterm>'''
Generate [^[link group__predicates_1ga33e1bf84e5e3658fe19b19f6331314b3 covered_by()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `covered_by``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::covered_by(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1ga546e417153441edbeeb55c50234bbeea]
[section covers(Geometry const &)]
'''<indexterm><primary>covers</primary></indexterm>'''
Generate [^[link group__predicates_1ga546e417153441edbeeb55c50234bbeea covers()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `covers``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::covers(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1gac4f2328326b16c98736a6dbb70948fba]
[section disjoint(Geometry const &)]
'''<indexterm><primary>disjoint</primary></indexterm>'''
Generate [^[link group__predicates_1gac4f2328326b16c98736a6dbb70948fba disjoint()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `disjoint``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::disjoint(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1ga2e4da4b87ceea63756ec854aa265647c]
[section intersects(Geometry const &)]
'''<indexterm><primary>intersects</primary></indexterm>'''
Generate [^[link group__predicates_1ga2e4da4b87ceea63756ec854aa265647c intersects()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `intersects``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::intersects(box), std::back_inserter(result));
bgi::query(spatial_index, bgi::intersects(ring), std::back_inserter(result));
bgi::query(spatial_index, bgi::intersects(polygon), std::back_inserter(result));
``


[endsect]

[#group__predicates_1gac94f965fd8d5b2200cb2493b9f1968ee]
[section overlaps(Geometry const &)]
'''<indexterm><primary>overlaps</primary></indexterm>'''
Generate [^[link group__predicates_1gac94f965fd8d5b2200cb2493b9f1968ee overlaps()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `overlaps``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::overlaps(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1ga2aa3520641e62522877d0e7dc9d4bf0d]
[section within(Geometry const &)]
'''<indexterm><primary>within</primary></indexterm>'''
Generate [^[link group__predicates_1ga2aa3520641e62522877d0e7dc9d4bf0d within()]] predicate. 

[heading Description]
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]
[pre
`template<``typename Geometry``>`
/unspecified/ `within``(``Geometry const &` `g``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`Geometry`][The Geometry type.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `g` ][The Geometry object. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::within(box), std::back_inserter(result));
``


[endsect]

[#group__predicates_1gaf23b2a001cdc392f58c22f64d96aa97b]
[section satisfies(UnaryPredicate const &)]
'''<indexterm><primary>satisfies</primary></indexterm>'''
Generate [link group__predicates_1gaf23b2a001cdc392f58c22f64d96aa97b satisfies()] predicate. 

[heading Description]
A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query.[heading Synopsis]
[pre
`template<``typename UnaryPredicate``>`
/unspecified/ `satisfies``(``UnaryPredicate const &` `pred``)`
]

[heading Template parameter(s)]
[table
[[Parameter] [Description]]
[[`UnaryPredicate`][A type of unary predicate function or function object.]]
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`UnaryPredicate const &`][ `pred` ][The unary predicate function or function object. ]]
]
[heading Example]

``
bool is_red(Value const& v) { return v.is_red(); }

struct is_red_o {
template <typename Value> bool operator()(Value const& v) { return v.is_red(); }
}

// ...

rt.query(index::intersects(box) && index::satisfies(is_red),
std::back_inserter(result));

rt.query(index::intersects(box) && index::satisfies(is_red_o()),
std::back_inserter(result));

rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }),
std::back_inserter(result));
``


[endsect]

[#group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e]
[section nearest(Geometry const &, std::size_t)]
'''<indexterm><primary>nearest</primary></indexterm>'''
Generate [link group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e nearest()] predicate. 

[heading Description]
When nearest predicate is passed to the query, k-nearest neighbour search will be performed. [^[link group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e 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]
[pre
`template<``typename Geometry``>`
/unspecified/ `nearest``(``Geometry const &` `geometry``,` `std::size_t` `k``)`
]

[heading Parameter(s)]
[table 
[[Type][Name][Description]]
[[`Geometry const &`][ `geometry` ][The geometry from which distance is calculated. ]]
[[`std::size_t`][ `k` ][The maximum number of values to return. ]]
]
[heading Example]

``
bgi::query(spatial_index, bgi::nearest(pt, 5), std::back_inserter(result));
bgi::query(spatial_index, bgi::nearest(pt, 5) && bgi::intersects(box), std::back_inserter(result));
bgi::query(spatial_index, bgi::nearest(box, 5), std::back_inserter(result));
``


[warning Only one [^[link group__predicates_1ga8b4b9bdfa5e666c7e77b7ba5d6249d9e nearest()]] predicate may be used in a query.]

[endsect]

[endsect]

