predicates

# Predicates (boost::geometry::index::)

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::contains_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::contains_tag, false> boost::geometry::index::contains (Geometry const &g) contains Geometry const & g

Generate `contains()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::within(Geometry, Indexable)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::covered_by_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::covered_by_tag, false> boost::geometry::index::covered_by (Geometry const &g) covered_by Geometry const & g

Generate `covered_by()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::covered_by(Indexable, Geometry)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::covers_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::covers_tag, false> boost::geometry::index::covers (Geometry const &g) covers Geometry const & g

Generate `covers()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::covered_by(Geometry, Indexable)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::disjoint_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::disjoint_tag, false> boost::geometry::index::disjoint (Geometry const &g) disjoint Geometry const & g

Generate `disjoint()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::disjoint(Indexable, Geometry)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::intersects_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::intersects_tag, false> boost::geometry::index::intersects (Geometry const &g) intersects Geometry const & g

Generate `intersects()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::intersects(Indexable, Geometry)` returns true.

# 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));

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::overlaps_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::overlaps_tag, false> boost::geometry::index::overlaps (Geometry const &g) overlaps Geometry const & g

Generate `overlaps()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::overlaps(Indexable, Geometry)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename Geometry
detail::predicates::spatial_predicate< Geometry, detail::predicates::within_tag, false > detail::predicates::spatial_predicate<Geometry, detail::predicates::within_tag, false> boost::geometry::index::within (Geometry const &g) within Geometry const & g

Generate `within()` predicate.

Generate a predicate defining Value and Geometry relationship. Value will be returned by the query if `bg::within(Indexable, Geometry)` returns true.

# Example

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

Geometry

The Geometry type.

g

The Geometry object.

typename UnaryPredicate
detail::predicates::satisfies< UnaryPredicate, false > detail::predicates::satisfies<UnaryPredicate, false> boost::geometry::index::satisfies (UnaryPredicate const &pred) satisfies UnaryPredicate const & pred

Generate satisfies() predicate.

A wrapper around user-defined UnaryPredicate checking if Value should be returned by spatial query.

# 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)); #ifndef BOOST_NO_CXX11_LAMBDAS rt.query(index::intersects(box) && index::satisfies([](Value const& v) { return v.is_red(); }), std::back_inserter(result)); #endif

UnaryPredicate

A type of unary predicate function or function object.

pred

The unary predicate function or function object.

typename Geometry
detail::predicates::nearest< Geometry > detail::predicates::nearest<Geometry> boost::geometry::index::nearest (Geometry const &geometry, unsigned k) nearest Geometry const & geometry unsigned k

Generate nearest() predicate.

When nearest predicate is passed to the query, k-nearest neighbour search will be performed. `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.

# 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));

Only one `nearest()` predicate may be used in a query.

geometry

The geometry from which distance is calculated.

k

The maximum number of values to return.