Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r83110 - in sandbox-branches/geometry/index: boost/geometry/index/detail/rtree/rstar doc doc/html doc/html/geometry_index doc/html/geometry_index/r_tree doc/rtree doc/src/examples/rtree
From: adam.wulkiewicz_at_[hidden]
Date: 2013-02-23 18:47:22


Author: awulkiew
Date: 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
New Revision: 83110
URL: http://svn.boost.org/trac/boost/changeset/83110

Log:
Added examples of indexing polygons.
Fixed c++11 compilation error caused by use of deleted Allocators copy ctor in rstar insert visitor.

Added:
   sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_shared_ptr.cpp (contents, props changed)
   sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_vector.cpp (contents, props changed)
Text files modified:
   sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp | 2
   sandbox-branches/geometry/index/doc/html/geometry_index/r_tree.html | 4
   sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_examples.html | 192 +++++++++++++++++++++++++++++++++++++++
   sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_quickstart.html | 12 +
   sandbox-branches/geometry/index/doc/html/index.html | 2
   sandbox-branches/geometry/index/doc/imports.qbk | 2
   sandbox-branches/geometry/index/doc/rtree/examples.qbk | 8 +
   sandbox-branches/geometry/index/doc/src/examples/rtree/Jamfile.v2 | 6 +
   sandbox-branches/geometry/index/doc/src/examples/rtree/interprocess.cpp | 10 +
   sandbox-branches/geometry/index/doc/src/examples/rtree/quick_start.cpp | 12 +
   10 files changed, 235 insertions(+), 15 deletions(-)

Modified: sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp
==============================================================================
--- sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp (original)
+++ sandbox-branches/geometry/index/boost/geometry/index/detail/rtree/rstar/insert.hpp 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -532,7 +532,7 @@
 
     size_t m_relative_level;
 
- Allocators m_allocators;
+ Allocators & m_allocators;
 };
 
 }}} // namespace detail::rtree::visitors

Modified: sandbox-branches/geometry/index/doc/html/geometry_index/r_tree.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/geometry_index/r_tree.html (original)
+++ sandbox-branches/geometry/index/doc/html/geometry_index/r_tree.html 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -68,6 +68,10 @@
 <dd><dl>
 <dt><span class="section"><a href="r_tree/rtree_examples.html#geometry_index.r_tree.rtree_examples.quick_start">Quick
         start</a></span></dt>
+<dt><span class="section"><a href="r_tree/rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_polygons_stored_in_vector">Index
+ of polygons stored in vector</a></span></dt>
+<dt><span class="section"><a href="r_tree/rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_shared_pointers_to_polygons">Index
+ of shared pointers to polygons</a></span></dt>
 <dt><span class="section">Interprocess</span></dt>
 </dl></dd>
 <dt><span class="section">Reference</span></dt>

Modified: sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_examples.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_examples.html (original)
+++ sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_examples.html 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -29,6 +29,10 @@
 <div class="toc"><dl>
 <dt><span class="section"><a href="rtree_examples.html#geometry_index.r_tree.rtree_examples.quick_start">Quick
         start</a></span></dt>
+<dt><span class="section"><a href="rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_polygons_stored_in_vector">Index
+ of polygons stored in vector</a></span></dt>
+<dt><span class="section"><a href="rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_shared_pointers_to_polygons">Index
+ of shared pointers to polygons</a></span></dt>
 <dt><span class="section">Interprocess</span></dt>
 </dl></div>
 <div class="section">
@@ -39,7 +43,7 @@
 <p>
 </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
-<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point_xy</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">index</span><span class="special">/</span><span class="identifier">rtree</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@@ -61,7 +65,7 @@
     <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">&gt;</span> <span class="identifier">value</span><span class="special">;</span>
 
     <span class="comment">// create the rtree using default constructor</span>
- <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">quadratic</span><span class="special">&lt;</span><span class="number">32</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
+ <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">quadratic</span><span class="special">&lt;</span><span class="number">16</span><span class="special">,</span> <span class="number">4</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
 
     <span class="comment">// create some values</span>
     <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">10</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
@@ -81,9 +85,15 @@
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">value</span><span class="special">&gt;</span> <span class="identifier">result_n</span><span class="special">;</span>
     <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">query</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">),</span> <span class="number">5</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_n</span><span class="special">));</span>
 
+ <span class="comment">// display results</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query box:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">query_box</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
     <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_s</span><span class="special">)</span>
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">first</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" - "</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query point:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
     <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_n</span><span class="special">)</span>
         <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">first</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" - "</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
@@ -96,6 +106,184 @@
 </div>
 <div class="section">
 <div class="titlepage"><div><div><h4 class="title">
+<a name="geometry_index.r_tree.rtree_examples.index_of_polygons_stored_in_vector"></a><a class="link" href="rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_polygons_stored_in_vector" title="Index of polygons stored in vector">Index
+ of polygons stored in vector</a>
+</h4></div></div></div>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">index</span><span class="special">/</span><span class="identifier">rtree</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cmath</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foreach</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">bg</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">bgi</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">index</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">point</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">cs</span><span class="special">::</span><span class="identifier">cartesian</span><span class="special">&gt;</span> <span class="identifier">point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">box</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">,</span> <span class="keyword">false</span><span class="special">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="identifier">polygon</span><span class="special">;</span> <span class="comment">// ccw, open polygon</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">,</span> <span class="keyword">unsigned</span><span class="special">&gt;</span> <span class="identifier">value</span><span class="special">;</span>
+
+ <span class="comment">// polygons</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">polygons</span><span class="special">;</span>
+
+ <span class="comment">// create some polygons</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">10</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="comment">// create a polygon</span>
+ <span class="identifier">polygon</span> <span class="identifier">p</span><span class="special">;</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">float</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">a</span> <span class="special">&lt;</span> <span class="number">6.28316f</span> <span class="special">;</span> <span class="identifier">a</span> <span class="special">+=</span> <span class="number">1.04720f</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">float</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">i</span> <span class="special">+</span> <span class="keyword">int</span><span class="special">(</span><span class="number">10</span><span class="special">*::</span><span class="identifier">cos</span><span class="special">(</span><span class="identifier">a</span><span class="special">))*</span><span class="number">0.1f</span><span class="special">;</span>
+ <span class="keyword">float</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">i</span> <span class="special">+</span> <span class="keyword">int</span><span class="special">(</span><span class="number">10</span><span class="special">*::</span><span class="identifier">sin</span><span class="special">(</span><span class="identifier">a</span><span class="special">))*</span><span class="number">0.1f</span><span class="special">;</span>
+ <span class="identifier">p</span><span class="special">.</span><span class="identifier">outer</span><span class="special">().</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">));</span>
+ <span class="special">}</span>
+
+ <span class="comment">// add polygon</span>
+ <span class="identifier">polygons</span><span class="special">.</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">p</span><span class="special">);</span>
+ <span class="special">}</span>
+
+ <span class="comment">// display polygons</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"generated polygons:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">polygon</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">p</span><span class="special">,</span> <span class="identifier">polygons</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(</span><span class="identifier">p</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="comment">// create the rtree using default constructor</span>
+ <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rstar</span><span class="special">&lt;</span><span class="number">16</span><span class="special">,</span> <span class="number">4</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
+
+ <span class="comment">// fill the spatial index</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="identifier">size_t</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="identifier">polygons</span><span class="special">.</span><span class="identifier">size</span><span class="special">()</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="comment">// calculate polygon bounding box</span>
+ <span class="identifier">box</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">return_envelope</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">polygons</span><span class="special">[</span><span class="identifier">i</span><span class="special">]);</span>
+ <span class="comment">// insert new value</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">insert</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">b</span><span class="special">,</span> <span class="identifier">i</span><span class="special">));</span>
+ <span class="special">}</span>
+
+ <span class="comment">// find values intersecting some area defined by a box</span>
+ <span class="identifier">box</span> <span class="identifier">query_box</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">),</span> <span class="identifier">point</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">));</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">value</span><span class="special">&gt;</span> <span class="identifier">result_s</span><span class="special">;</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">query</span><span class="special">(</span><span class="identifier">query_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_s</span><span class="special">));</span>
+
+ <span class="comment">// find 5 nearest values to a point</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">value</span><span class="special">&gt;</span> <span class="identifier">result_n</span><span class="special">;</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">query</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">),</span> <span class="number">5</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_n</span><span class="special">));</span>
+
+ <span class="comment">// display results</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query box:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">query_box</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_s</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(</span><span class="identifier">polygons</span><span class="special">[</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">])</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query point:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_n</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(</span><span class="identifier">polygons</span><span class="special">[</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">])</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
+<a name="geometry_index.r_tree.rtree_examples.index_of_shared_pointers_to_polygons"></a><a class="link" href="rtree_examples.html#geometry_index.r_tree.rtree_examples.index_of_shared_pointers_to_polygons" title="Index of shared pointers to polygons">Index
+ of shared pointers to polygons</a>
+</h4></div></div></div>
+<p>
+</p>
+<pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">polygon</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">index</span><span class="special">/</span><span class="identifier">rtree</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">cmath</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">vector</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">iostream</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">foreach</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">shared_ptr</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+
+<span class="keyword">namespace</span> <span class="identifier">bg</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">;</span>
+<span class="keyword">namespace</span> <span class="identifier">bgi</span> <span class="special">=</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">geometry</span><span class="special">::</span><span class="identifier">index</span><span class="special">;</span>
+
+<span class="keyword">int</span> <span class="identifier">main</span><span class="special">(</span><span class="keyword">void</span><span class="special">)</span>
+<span class="special">{</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">point</span><span class="special">&lt;</span><span class="keyword">float</span><span class="special">,</span> <span class="number">2</span><span class="special">,</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">cs</span><span class="special">::</span><span class="identifier">cartesian</span><span class="special">&gt;</span> <span class="identifier">point</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">box</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;</span> <span class="identifier">box</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">model</span><span class="special">::</span><span class="identifier">polygon</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">,</span> <span class="keyword">false</span><span class="special">,</span> <span class="keyword">false</span><span class="special">&gt;</span> <span class="identifier">polygon</span><span class="special">;</span> <span class="comment">// ccw, open polygon</span>
+ <span class="keyword">typedef</span> <span class="identifier">boost</span><span class="special">::</span><span class="identifier">shared_ptr</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;</span> <span class="identifier">shp</span><span class="special">;</span>
+ <span class="keyword">typedef</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">pair</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">,</span> <span class="identifier">shp</span><span class="special">&gt;</span> <span class="identifier">value</span><span class="special">;</span>
+
+ <span class="comment">// create the rtree using default constructor</span>
+ <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">linear</span><span class="special">&lt;</span><span class="number">16</span><span class="special">,</span> <span class="number">4</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"filling index with polygons shared pointers:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="comment">// create some polygons and fill the spatial index</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">unsigned</span> <span class="identifier">i</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">i</span> <span class="special">&lt;</span> <span class="number">10</span> <span class="special">;</span> <span class="special">++</span><span class="identifier">i</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="comment">// create a polygon</span>
+ <span class="identifier">shp</span> <span class="identifier">p</span><span class="special">(</span><span class="keyword">new</span> <span class="identifier">polygon</span><span class="special">());</span>
+ <span class="keyword">for</span> <span class="special">(</span> <span class="keyword">float</span> <span class="identifier">a</span> <span class="special">=</span> <span class="number">0</span> <span class="special">;</span> <span class="identifier">a</span> <span class="special">&lt;</span> <span class="number">6.28316f</span> <span class="special">;</span> <span class="identifier">a</span> <span class="special">+=</span> <span class="number">1.04720f</span> <span class="special">)</span>
+ <span class="special">{</span>
+ <span class="keyword">float</span> <span class="identifier">x</span> <span class="special">=</span> <span class="identifier">i</span> <span class="special">+</span> <span class="keyword">int</span><span class="special">(</span><span class="number">10</span><span class="special">*::</span><span class="identifier">cos</span><span class="special">(</span><span class="identifier">a</span><span class="special">))*</span><span class="number">0.1f</span><span class="special">;</span>
+ <span class="keyword">float</span> <span class="identifier">y</span> <span class="special">=</span> <span class="identifier">i</span> <span class="special">+</span> <span class="keyword">int</span><span class="special">(</span><span class="number">10</span><span class="special">*::</span><span class="identifier">sin</span><span class="special">(</span><span class="identifier">a</span><span class="special">))*</span><span class="number">0.1f</span><span class="special">;</span>
+ <span class="identifier">p</span><span class="special">-&gt;</span><span class="identifier">outer</span><span class="special">().</span><span class="identifier">push_back</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="identifier">x</span><span class="special">,</span> <span class="identifier">y</span><span class="special">));</span>
+ <span class="special">}</span>
+
+ <span class="comment">// display new polygon</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(*</span><span class="identifier">p</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="comment">// calculate polygon bounding box</span>
+ <span class="identifier">box</span> <span class="identifier">b</span> <span class="special">=</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">return_envelope</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(*</span><span class="identifier">p</span><span class="special">);</span>
+ <span class="comment">// insert new value</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">insert</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">b</span><span class="special">,</span> <span class="identifier">p</span><span class="special">));</span>
+ <span class="special">}</span>
+
+ <span class="comment">// find values intersecting some area defined by a box</span>
+ <span class="identifier">box</span> <span class="identifier">query_box</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">),</span> <span class="identifier">point</span><span class="special">(</span><span class="number">5</span><span class="special">,</span> <span class="number">5</span><span class="special">));</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">value</span><span class="special">&gt;</span> <span class="identifier">result_s</span><span class="special">;</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">query</span><span class="special">(</span><span class="identifier">query_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_s</span><span class="special">));</span>
+
+ <span class="comment">// find 5 nearest values to a point</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">vector</span><span class="special">&lt;</span><span class="identifier">value</span><span class="special">&gt;</span> <span class="identifier">result_n</span><span class="special">;</span>
+ <span class="identifier">rtree</span><span class="special">.</span><span class="identifier">query</span><span class="special">(</span><span class="identifier">bgi</span><span class="special">::</span><span class="identifier">nearest</span><span class="special">(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">),</span> <span class="number">5</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_n</span><span class="special">));</span>
+
+ <span class="comment">// display results</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query box:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">query_box</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_s</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(*</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query point:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+ <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_n</span><span class="special">)</span>
+ <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">polygon</span><span class="special">&gt;(*</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+ <span class="keyword">return</span> <span class="number">0</span><span class="special">;</span>
+<span class="special">}</span>
+</pre>
+<p>
+ </p>
+</div>
+<div class="section">
+<div class="titlepage"><div><div><h4 class="title">
 <a name="geometry_index.r_tree.rtree_examples.interprocess"></a><a class="link" href="rtree_examples.html#geometry_index.r_tree.rtree_examples.interprocess" title="Interprocess">Interprocess</a>
 </h4></div></div></div>
 <p>

Modified: sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_quickstart.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_quickstart.html (original)
+++ sandbox-branches/geometry/index/doc/html/geometry_index/r_tree/rtree_quickstart.html 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -36,7 +36,7 @@
 <p>
 </p>
 <pre class="programlisting"><span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
-<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point_xy</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
+<span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">point</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">geometries</span><span class="special">/</span><span class="identifier">box</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
 
 <span class="preprocessor">#include</span> <span class="special">&lt;</span><span class="identifier">boost</span><span class="special">/</span><span class="identifier">geometry</span><span class="special">/</span><span class="identifier">index</span><span class="special">/</span><span class="identifier">rtree</span><span class="special">.</span><span class="identifier">hpp</span><span class="special">&gt;</span>
@@ -79,7 +79,7 @@
 <p>
 </p>
 <pre class="programlisting"><span class="comment">// create the rtree using default constructor</span>
-<span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">quadratic</span><span class="special">&lt;</span><span class="number">32</span><span class="special">,</span> <span class="number">8</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
+<span class="identifier">bgi</span><span class="special">::</span><span class="identifier">rtree</span><span class="special">&lt;</span> <span class="identifier">value</span><span class="special">,</span> <span class="identifier">bgi</span><span class="special">::</span><span class="identifier">quadratic</span><span class="special">&lt;</span><span class="number">16</span><span class="special">,</span> <span class="number">4</span><span class="special">&gt;</span> <span class="special">&gt;</span> <span class="identifier">rtree</span><span class="special">;</span>
 </pre>
 <p>
       </p>
@@ -139,9 +139,15 @@
       </p>
 <p>
 </p>
-<pre class="programlisting"><span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<pre class="programlisting"><span class="comment">// display results</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query box:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">query_box</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"spatial query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
 <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_s</span><span class="special">)</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">first</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" - "</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query point:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
+<span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">point</span><span class="special">&gt;(</span><span class="identifier">point</span><span class="special">(</span><span class="number">0</span><span class="special">,</span> <span class="number">0</span><span class="special">))</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
 <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="string">"knn query result:"</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>
 <span class="identifier">BOOST_FOREACH</span><span class="special">(</span><span class="identifier">value</span> <span class="keyword">const</span><span class="special">&amp;</span> <span class="identifier">v</span><span class="special">,</span> <span class="identifier">result_n</span><span class="special">)</span>
     <span class="identifier">std</span><span class="special">::</span><span class="identifier">cout</span> <span class="special">&lt;&lt;</span> <span class="identifier">bg</span><span class="special">::</span><span class="identifier">wkt</span><span class="special">&lt;</span><span class="identifier">box</span><span class="special">&gt;(</span><span class="identifier">v</span><span class="special">.</span><span class="identifier">first</span><span class="special">)</span> <span class="special">&lt;&lt;</span> <span class="string">" - "</span> <span class="special">&lt;&lt;</span> <span class="identifier">v</span><span class="special">.</span><span class="identifier">second</span> <span class="special">&lt;&lt;</span> <span class="identifier">std</span><span class="special">::</span><span class="identifier">endl</span><span class="special">;</span>

Modified: sandbox-branches/geometry/index/doc/html/index.html
==============================================================================
--- sandbox-branches/geometry/index/doc/html/index.html (original)
+++ sandbox-branches/geometry/index/doc/html/index.html 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -51,7 +51,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: February 23, 2013 at 04:28:38 GMT</small></p></td>
+<td align="left"><p><small>Last revised: February 23, 2013 at 23:45:13 GMT</small></p></td>
 <td align="right"><div class="copyright-footer"></div></td>
 </tr></table>
 <hr>

Modified: sandbox-branches/geometry/index/doc/imports.qbk
==============================================================================
--- sandbox-branches/geometry/index/doc/imports.qbk (original)
+++ sandbox-branches/geometry/index/doc/imports.qbk 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -9,4 +9,6 @@
 =============================================================================/]
 
 [import src/examples/rtree/quick_start.cpp]
+[import src/examples/rtree/polygons_vector.cpp]
+[import src/examples/rtree/polygons_shared_ptr.cpp]
 [import src/examples/rtree/interprocess.cpp]

Modified: sandbox-branches/geometry/index/doc/rtree/examples.qbk
==============================================================================
--- sandbox-branches/geometry/index/doc/rtree/examples.qbk (original)
+++ sandbox-branches/geometry/index/doc/rtree/examples.qbk 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -14,6 +14,14 @@
 [rtree_quickstart]
 [endsect]
 
+[section Index of polygons stored in vector]
+[rtree_polygons_vector]
+[endsect]
+
+[section Index of shared pointers to polygons]
+[rtree_polygons_shared_ptr]
+[endsect]
+
 [section Interprocess]
 [rtree_interprocess]
 [endsect]

Modified: sandbox-branches/geometry/index/doc/src/examples/rtree/Jamfile.v2
==============================================================================
--- sandbox-branches/geometry/index/doc/src/examples/rtree/Jamfile.v2 (original)
+++ sandbox-branches/geometry/index/doc/src/examples/rtree/Jamfile.v2 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -1,6 +1,6 @@
 # Boost.Geometry Index
 #
-# Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+# Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
 #
 # Use, modification and distribution is subject to the Boost Software License,
 # Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -8,6 +8,10 @@
 
 exe quick_start : quick_start.cpp
     ;
+exe polygons_vector : polygons_vector.cpp
+ ;
+exe polygons_shared_ptr : polygons_shared_ptr.cpp
+ ;
 
 exe interprocess : interprocess.cpp /boost/thread//boost_thread
         :

Modified: sandbox-branches/geometry/index/doc/src/examples/rtree/interprocess.cpp
==============================================================================
--- sandbox-branches/geometry/index/doc/src/examples/rtree/interprocess.cpp (original)
+++ sandbox-branches/geometry/index/doc/src/examples/rtree/interprocess.cpp 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -1,7 +1,9 @@
-// Boost.Geometry.Index Rtree interprocess example
-
-// Copyright (c) 2013 Adam Wulkiewicz, Lodz, Poland.
-
+// Boost.Geometry Index
+//
+// Quickbook Examples
+//
+// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
+//
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
 // http://www.boost.org/LICENSE_1_0.txt)

Added: sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_shared_ptr.cpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_shared_ptr.cpp 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -0,0 +1,88 @@
+// Boost.Geometry Index
+//
+// Quickbook Examples
+//
+// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
+//
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[rtree_polygons_shared_ptr
+
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/index/rtree.hpp>
+
+#include <cmath>
+#include <vector>
+#include <iostream>
+#include <boost/foreach.hpp>
+#include <boost/shared_ptr.hpp>
+
+namespace bg = boost::geometry;
+namespace bgi = boost::geometry::index;
+
+int main(void)
+{
+ typedef bg::model::point<float, 2, bg::cs::cartesian> point;
+ typedef bg::model::box<point> box;
+ typedef bg::model::polygon<point, false, false> polygon; // ccw, open polygon
+ typedef boost::shared_ptr<polygon> shp;
+ typedef std::pair<box, shp> value;
+
+ // create the rtree using default constructor
+ bgi::rtree< value, bgi::linear<16, 4> > rtree;
+
+ std::cout << "filling index with polygons shared pointers:" << std::endl;
+
+ // create some polygons and fill the spatial index
+ for ( unsigned i = 0 ; i < 10 ; ++i )
+ {
+ // create a polygon
+ shp p(new polygon());
+ for ( float a = 0 ; a < 6.28316f ; a += 1.04720f )
+ {
+ float x = i + int(10*::cos(a))*0.1f;
+ float y = i + int(10*::sin(a))*0.1f;
+ p->outer().push_back(point(x, y));
+ }
+
+ // display new polygon
+ std::cout << bg::wkt<polygon>(*p) << std::endl;
+
+ // calculate polygon bounding box
+ box b = bg::return_envelope<box>(*p);
+ // insert new value
+ rtree.insert(std::make_pair(b, p));
+ }
+
+ // find values intersecting some area defined by a box
+ box query_box(point(0, 0), point(5, 5));
+ std::vector<value> result_s;
+ rtree.query(query_box, std::back_inserter(result_s));
+
+ // find 5 nearest values to a point
+ std::vector<value> result_n;
+ rtree.query(bgi::nearest(point(0, 0), 5), std::back_inserter(result_n));
+
+ // display results
+ std::cout << "spatial query box:" << std::endl;
+ std::cout << bg::wkt<box>(query_box) << std::endl;
+ std::cout << "spatial query result:" << std::endl;
+ BOOST_FOREACH(value const& v, result_s)
+ std::cout << bg::wkt<polygon>(*v.second) << std::endl;
+
+ std::cout << "knn query point:" << std::endl;
+ std::cout << bg::wkt<point>(point(0, 0)) << std::endl;
+ std::cout << "knn query result:" << std::endl;
+ BOOST_FOREACH(value const& v, result_n)
+ std::cout << bg::wkt<polygon>(*v.second) << std::endl;
+
+ return 0;
+}
+
+//]
\ No newline at end of file

Added: sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_vector.cpp
==============================================================================
--- (empty file)
+++ sandbox-branches/geometry/index/doc/src/examples/rtree/polygons_vector.cpp 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -0,0 +1,96 @@
+// Boost.Geometry Index
+//
+// Quickbook Examples
+//
+// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
+//
+// Use, modification and distribution is subject to the Boost Software License,
+// Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+//[rtree_polygons_vector
+
+#include <boost/geometry.hpp>
+#include <boost/geometry/geometries/point.hpp>
+#include <boost/geometry/geometries/box.hpp>
+#include <boost/geometry/geometries/polygon.hpp>
+
+#include <boost/geometry/index/rtree.hpp>
+
+#include <cmath>
+#include <vector>
+#include <iostream>
+#include <boost/foreach.hpp>
+
+namespace bg = boost::geometry;
+namespace bgi = boost::geometry::index;
+
+int main(void)
+{
+ typedef bg::model::point<float, 2, bg::cs::cartesian> point;
+ typedef bg::model::box<point> box;
+ typedef bg::model::polygon<point, false, false> polygon; // ccw, open polygon
+ typedef std::pair<box, unsigned> value;
+
+ // polygons
+ std::vector<polygon> polygons;
+
+ // create some polygons
+ for ( unsigned i = 0 ; i < 10 ; ++i )
+ {
+ // create a polygon
+ polygon p;
+ for ( float a = 0 ; a < 6.28316f ; a += 1.04720f )
+ {
+ float x = i + int(10*::cos(a))*0.1f;
+ float y = i + int(10*::sin(a))*0.1f;
+ p.outer().push_back(point(x, y));
+ }
+
+ // add polygon
+ polygons.push_back(p);
+ }
+
+ // display polygons
+ std::cout << "generated polygons:" << std::endl;
+ BOOST_FOREACH(polygon const& p, polygons)
+ std::cout << bg::wkt<polygon>(p) << std::endl;
+
+ // create the rtree using default constructor
+ bgi::rtree< value, bgi::rstar<16, 4> > rtree;
+
+ // fill the spatial index
+ for ( size_t i = 0 ; i < polygons.size() ; ++i )
+ {
+ // calculate polygon bounding box
+ box b = bg::return_envelope<box>(polygons[i]);
+ // insert new value
+ rtree.insert(std::make_pair(b, i));
+ }
+
+ // find values intersecting some area defined by a box
+ box query_box(point(0, 0), point(5, 5));
+ std::vector<value> result_s;
+ rtree.query(query_box, std::back_inserter(result_s));
+
+ // find 5 nearest values to a point
+ std::vector<value> result_n;
+ rtree.query(bgi::nearest(point(0, 0), 5), std::back_inserter(result_n));
+
+ // display results
+ std::cout << "spatial query box:" << std::endl;
+ std::cout << bg::wkt<box>(query_box) << std::endl;
+ std::cout << "spatial query result:" << std::endl;
+ BOOST_FOREACH(value const& v, result_s)
+ std::cout << bg::wkt<polygon>(polygons[v.second]) << std::endl;
+
+ std::cout << "knn query point:" << std::endl;
+ std::cout << bg::wkt<point>(point(0, 0)) << std::endl;
+ std::cout << "knn query result:" << std::endl;
+ BOOST_FOREACH(value const& v, result_n)
+ std::cout << bg::wkt<polygon>(polygons[v.second]) << std::endl;
+
+ return 0;
+}
+
+//]
\ No newline at end of file

Modified: sandbox-branches/geometry/index/doc/src/examples/rtree/quick_start.cpp
==============================================================================
--- sandbox-branches/geometry/index/doc/src/examples/rtree/quick_start.cpp (original)
+++ sandbox-branches/geometry/index/doc/src/examples/rtree/quick_start.cpp 2013-02-23 18:47:19 EST (Sat, 23 Feb 2013)
@@ -2,7 +2,7 @@
 //
 // Quickbook Examples
 //
-// Copyright (c) 2011-2012 Adam Wulkiewicz, Lodz, Poland.
+// Copyright (c) 2011-2013 Adam Wulkiewicz, Lodz, Poland.
 //
 // Use, modification and distribution is subject to the Boost Software License,
 // Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
@@ -13,7 +13,7 @@
 //[rtree_quickstart_include
 
 #include <boost/geometry.hpp>
-#include <boost/geometry/geometries/point_xy.hpp>
+#include <boost/geometry/geometries/point.hpp>
 #include <boost/geometry/geometries/box.hpp>
 
 #include <boost/geometry/index/rtree.hpp>
@@ -39,7 +39,7 @@
 
     //[rtree_quickstart_create
     // create the rtree using default constructor
- bgi::rtree< value, bgi::quadratic<32, 8> > rtree;
+ bgi::rtree< value, bgi::quadratic<16, 4> > rtree;
     //]
 
     //[rtree_quickstart_insert
@@ -67,9 +67,15 @@
     //]
 
     //[rtree_quickstart_output
+ // display results
+ std::cout << "spatial query box:" << std::endl;
+ std::cout << bg::wkt<box>(query_box) << std::endl;
     std::cout << "spatial query result:" << std::endl;
     BOOST_FOREACH(value const& v, result_s)
         std::cout << bg::wkt<box>(v.first) << " - " << v.second << std::endl;
+
+ std::cout << "knn query point:" << std::endl;
+ std::cout << bg::wkt<point>(point(0, 0)) << std::endl;
     std::cout << "knn query result:" << std::endl;
     BOOST_FOREACH(value const& v, result_n)
         std::cout << bg::wkt<box>(v.first) << " - " << v.second << std::endl;


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