|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r81547 - in sandbox-branches/geometry/index_dev/doc: html html/geometry_index html/geometry_index/r_tree rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2012-11-26 06:06:02
Author: awulkiew
Date: 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
New Revision: 81547
URL: http://svn.boost.org/trac/boost/changeset/81547
Log:
Docs modified - queries.
Text files modified:
sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html | 4 ++
sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html | 6 ++-
sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html | 60 +++++++++++++++++++++++++++------------
sandbox-branches/geometry/index_dev/doc/html/index.html | 2
sandbox-branches/geometry/index_dev/doc/rtree/nearest_query.qbk | 2
sandbox-branches/geometry/index_dev/doc/rtree/spatial_query.qbk | 38 +++++++++++++++++--------
6 files changed, 77 insertions(+), 35 deletions(-)
Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree.html 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -51,6 +51,10 @@
queries</a></span></dt>
<dt><span class="section"><a href="r_tree/spatial_queries.html#geometry_index.r_tree.spatial_queries.spatial_predicates">Spatial
predicates</a></span></dt>
+<dt><span class="section"><a href="r_tree/spatial_queries.html#geometry_index.r_tree.spatial_queries.connecting_predicates">Connecting
+ predicates</a></span></dt>
+<dt><span class="section"><a href="r_tree/spatial_queries.html#geometry_index.r_tree.spatial_queries.value_predicate">Value
+ predicate</a></span></dt>
</dl></dd>
<dt><span class="section"><a href="r_tree/nearest_neighbours_queries.html">Nearest
neighbours queries</a></span></dt>
Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/nearest_neighbours_queries.html 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -59,12 +59,14 @@
</th>
<th>
<p>
- knn in a ring (Value's furthest point)
+ knn query - distance to Indexable's furthest point greather than
+ ...
</p>
</th>
<th>
<p>
- knn in a ring (Value's closest point)
+ knn query - distance to Indexable's closest point greather than
+ ...
</p>
</th>
</tr></thead>
Modified: sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/geometry_index/r_tree/spatial_queries.html 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -31,13 +31,19 @@
queries</a></span></dt>
<dt><span class="section"><a href="spatial_queries.html#geometry_index.r_tree.spatial_queries.spatial_predicates">Spatial
predicates</a></span></dt>
+<dt><span class="section"><a href="spatial_queries.html#geometry_index.r_tree.spatial_queries.connecting_predicates">Connecting
+ predicates</a></span></dt>
+<dt><span class="section"><a href="spatial_queries.html#geometry_index.r_tree.spatial_queries.value_predicate">Value
+ predicate</a></span></dt>
</dl></div>
<p>
Spatial queries returns <code class="computeroutput"><span class="identifier">Value</span></code>s
which meets some predicates. For instance it may be used to retrieve Values
- intersecting some area or are within some other area. The examples of some
- basic queries may be found in the table below. The query region and result
- <code class="computeroutput"><span class="identifier">Value</span></code>s are orange.
+ intersecting some area or are within some other area. Names of predicates
+ corresponds to names of Boost.Geometry
+ algorithms. The examples of some basic queries may be found in the table
+ below. The query region and result <code class="computeroutput"><span class="identifier">Value</span></code>s
+ are orange.
</p>
<div class="informaltable"><table class="table">
<colgroup>
@@ -139,10 +145,8 @@
predicates</a>
</h4></div></div></div>
<p>
- It is possible to define other relations between queried <code class="computeroutput">Value</code>s
- and region/regions of interest. Names of predicates corresponds to names
- of Boost.Geometry
- algorithms.
+ To explicitly define one of the predicates one may pass it to the <code class="computeroutput"><span class="identifier">spatial_query</span><span class="special">()</span></code>
+ as the first argument instead of <code class="computeroutput"><span class="identifier">Box</span></code>.
</p>
<pre class="programlisting"><span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span> <span class="comment">// default case - intersects</span>
<span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box</span><span class="special">),</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span> <span class="comment">// the same as default</span>
@@ -158,21 +162,38 @@
<span class="comment">// the same as</span>
<span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">disjoint</span><span class="special">(</span><span class="identifier">box</span><span class="special">),</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="geometry_index.r_tree.spatial_queries.connecting_predicates"></a><a class="link" href="spatial_queries.html#geometry_index.r_tree.spatial_queries.connecting_predicates" title="Connecting predicates">Connecting
+ predicates</a>
+</h4></div></div></div>
<p>
- It's possible to use some number of predicates by passing <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">Pred1</span><span class="special">,</span> <span class="identifier">Pred2</span><span class="special">></span></code>
- </p>
-<pre class="programlisting"><span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span>
- <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box1</span><span class="special">),</span> <span class="special">!</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">within</span><span class="special">(</span><span class="identifier">box2</span><span class="special">))</span>
- <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
-</pre>
-<p>
- or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">Pred1</span><span class="special">,</span> <span class="identifier">Pred2</span><span class="special">,</span> <span class="identifier">Pred3</span><span class="special">,</span> <span class="special">...></span></code>
+ It's possible to use some number of predicates in one time by passing
+ <code class="computeroutput"><span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special"><</span><span class="identifier">Pred1</span><span class="special">,</span> <span class="identifier">Pred2</span><span class="special">></span></code>
+ or <code class="computeroutput"><span class="identifier">boost</span><span class="special">::</span><span class="identifier">tuple</span><span class="special"><</span><span class="identifier">Pred1</span><span class="special">,</span> <span class="identifier">Pred2</span><span class="special">,</span> <span class="identifier">Pred3</span><span class="special">,</span> <span class="special">...></span></code>. These predicates are connected
+ by logical AND. Passing all predicates together not only makes possible
+ to construct advanced queries but is also faster than separate calls because
+ the tree is traversed only once. Traversing is continued and <code class="computeroutput"><span class="identifier">Value</span></code>s are returned only if all predicates
+ are met. Predicates are checked left-to-right so placing most restictive
+ predicates first should accelerate the search even more.
</p>
<pre class="programlisting"><span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span>
+ <span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box1</span><span class="special">),</span> <span class="special">!</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">within</span><span class="special">(</span><span class="identifier">box2</span><span class="special">)</span> <span class="special">),</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
+
+<span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span>
<span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_tuple</span><span class="special">(</span>
- <span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box1</span><span class="special">),</span> <span class="special">!</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">within</span><span class="special">(</span><span class="identifier">box2</span><span class="special">),</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">overlaps</span><span class="special">(</span><span class="identifier">box3</span><span class="special">))</span>
- <span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
+ <span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box1</span><span class="special">),</span> <span class="special">!</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">within</span><span class="special">(</span><span class="identifier">box2</span><span class="special">),</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">overlaps</span><span class="special">(</span><span class="identifier">box3</span><span class="special">)</span> <span class="special">),</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
</pre>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="geometry_index.r_tree.spatial_queries.value_predicate"></a><a class="link" href="spatial_queries.html#geometry_index.r_tree.spatial_queries.value_predicate" title="Value predicate">Value
+ predicate</a>
+</h4></div></div></div>
<p>
There is also a unique predicate <code class="computeroutput"><span class="identifier">index</span><span class="special">::</span><span class="identifier">value</span><span class="special">(...)</span></code> taking user-defined function/functor
which checks if <code class="computeroutput">Value</code> should be returned by the query.
@@ -185,8 +206,9 @@
<span class="comment">// ...</span>
<span class="identifier">rt</span><span class="special">.</span><span class="identifier">spatial_query</span><span class="special">(</span>
- <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span><span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box</span><span class="special">),</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">fun</span><span class="special">))</span>
-<span class="special">,</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
+ <span class="identifier">boost</span><span class="special">::</span><span class="identifier">make_pair</span><span class="special">(</span>
+ <span class="identifier">index</span><span class="special">::</span><span class="identifier">intersects</span><span class="special">(</span><span class="identifier">box</span><span class="special">),</span> <span class="identifier">index</span><span class="special">::</span><span class="identifier">value</span><span class="special">(</span><span class="identifier">fun</span><span class="special">)</span> <span class="special">),</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">back_inserter</span><span class="special">(</span><span class="identifier">result</span><span class="special">));</span>
</pre>
</div>
</div>
Modified: sandbox-branches/geometry/index_dev/doc/html/index.html
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/html/index.html (original)
+++ sandbox-branches/geometry/index_dev/doc/html/index.html 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -56,7 +56,7 @@
</div>
</div>
<table xmlns:rev="http://www.cs.rpi.edu/~gregod/boost/tools/doc/revision" width="100%"><tr>
-<td align="left"><p><small>Last revised: November 25, 2012 at 21:53:32 GMT</small></p></td>
+<td align="left"><p><small>Last revised: November 26, 2012 at 02:22:46 GMT</small></p></td>
<td align="right"><div class="copyright-footer"></div></td>
</tr></table>
<hr>
Modified: sandbox-branches/geometry/index_dev/doc/rtree/nearest_query.qbk
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/rtree/nearest_query.qbk (original)
+++ sandbox-branches/geometry/index_dev/doc/rtree/nearest_query.qbk 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -17,7 +17,7 @@
The query point, region and result Values are orange.
[table
-[[Basic knn query] [knn in a ring (Value's furthest point)] [knn in a ring (Value's closest point)]]
+[[Basic knn query] [knn query - distance to Indexable's furthest point greather than ...] [knn query - distance to Indexable's closest point greather than ...]]
[[[$../images/knn.png]] [[$../images/knn_inters.png]] [[$../images/knn_cover.png]]]
]
Modified: sandbox-branches/geometry/index_dev/doc/rtree/spatial_query.qbk
==============================================================================
--- sandbox-branches/geometry/index_dev/doc/rtree/spatial_query.qbk (original)
+++ sandbox-branches/geometry/index_dev/doc/rtree/spatial_query.qbk 2012-11-26 06:06:01 EST (Mon, 26 Nov 2012)
@@ -11,7 +11,8 @@
[section Spatial queries]
Spatial queries returns `Value`s which meets some predicates. For instance it may be used to
-retrieve Values intersecting some area or are within some other area. The examples of some
+retrieve Values intersecting some area or are within some other area. Names of predicates
+corresponds to names of __boost_geometry__ algorithms. The examples of some
basic queries may be found in the table below. The query region and result `Value`s are orange.
[table
@@ -45,8 +46,8 @@
[section Spatial predicates]
-It is possible to define other relations between queried `__value__`s and region/regions
-of interest. Names of predicates corresponds to names of __boost_geometry__ algorithms.
+To explicitly define one of the predicates one may pass it to the `spatial_query()` as
+the first argument instead of `Box`.
rt.spatial_query(box, std::back_inserter(result)); // default case - intersects
rt.spatial_query(index::intersects(box), std::back_inserter(result)); // the same as default
@@ -61,18 +62,30 @@
// the same as
rt.spatial_query(index::disjoint(box), std::back_inserter(result));
-It's possible to use some number of predicates by passing `std::pair<Pred1, Pred2>`
+[endsect]
- rt.spatial_query(
- std::make_pair(index::intersects(box1), !index::within(box2))
- , std::back_inserter(result));
+[section Connecting predicates]
-or `boost::tuple<Pred1, Pred2, Pred3, ...>`
+It's possible to use some number of predicates in one time by passing `std::pair<Pred1, Pred2>`
+or `boost::tuple<Pred1, Pred2, Pred3, ...>`. These predicates are connected by logical AND.
+Passing all predicates together not only makes possible to construct advanced queries but is also
+faster than separate calls because the tree is traversed only once. Traversing is continued and
+`Value`s are returned only if all predicates are met. Predicates are checked left-to-right so placing
+most restictive predicates first should accelerate the search even more.
+
+ rt.spatial_query(
+ std::make_pair(
+ index::intersects(box1), !index::within(box2) ),
+ std::back_inserter(result));
rt.spatial_query(
boost::make_tuple(
- index::intersects(box1), !index::within(box2), index::overlaps(box3))
- , std::back_inserter(result));
+ index::intersects(box1), !index::within(box2), index::overlaps(box3) ),
+ std::back_inserter(result));
+
+[endsect]
+
+[section Value predicate]
There is also a unique predicate `index::value(...)` taking user-defined function/functor
which checks if `__value__` should be returned by the query.
@@ -85,8 +98,9 @@
// ...
rt.spatial_query(
- boost::make_pair(index::intersects(box), index::value(fun))
- , std::back_inserter(result));
+ boost::make_pair(
+ index::intersects(box), index::value(fun) ),
+ std::back_inserter(result));
[endsect]
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk