<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/> <title>GEOS: geos::index::strtree::STRtree Class Reference</title> <link href="tabs.css" rel="stylesheet" type="text/css"/> <link href="doxygen.css" rel="stylesheet" type="text/css"/> </head> <body> <!-- Generated by Doxygen 1.7.1 --> <div class="navigation" id="top"> <div class="tabs"> <ul class="tablist"> <li><a href="index.html"><span>Main Page</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> <li><a href="namespaces.html"><span>Namespaces</span></a></li> <li class="current"><a href="annotated.html"><span>Classes</span></a></li> <li><a href="files.html"><span>Files</span></a></li> </ul> </div> <div class="tabs2"> <ul class="tablist"> <li><a href="annotated.html"><span>Class List</span></a></li> <li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li> <li><a href="functions.html"><span>Class Members</span></a></li> </ul> </div> <div class="navpath"> <ul> <li><a class="el" href="namespacegeos.html">geos</a> </li> <li><a class="el" href="namespacegeos_1_1index.html">index</a> </li> <li><a class="el" href="namespacegeos_1_1index_1_1strtree.html">strtree</a> </li> <li><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html">geos::index::strtree::STRtree</a> </li> </ul> </div> </div> <div class="header"> <div class="summary"> <a href="#pub-methods">Public Member Functions</a> | <a href="#pub-static-methods">Static Public Member Functions</a> | <a href="#pro-methods">Protected Member Functions</a> </div> <div class="headertitle"> <h1>geos::index::strtree::STRtree Class Reference</h1> </div> </div> <div class="contents"> <!-- doxytag: class="geos::index::strtree::STRtree" --><!-- doxytag: inherits="geos::index::strtree::AbstractSTRtree,geos::index::SpatialIndex" --> <p>A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatial data. <a href="#_details">More...</a></p> <p><code>#include <<a class="el" href="STRtree_8h_source.html">STRtree.h</a>></code></p> <div class="dynheader"> Inheritance diagram for geos::index::strtree::STRtree:</div> <div class="dyncontent"> <div class="center"> <img src="classgeos_1_1index_1_1strtree_1_1STRtree.png" usemap="#geos::index::strtree::STRtree_map" alt=""/> <map id="geos::index::strtree::STRtree_map" name="geos::index::strtree::STRtree_map"> <area href="classgeos_1_1index_1_1strtree_1_1AbstractSTRtree.html" alt="geos::index::strtree::AbstractSTRtree" shape="rect" coords="0,0,215,24"/> <area href="classgeos_1_1index_1_1SpatialIndex.html" alt="geos::index::SpatialIndex" shape="rect" coords="225,0,440,24"/> </map> </div> <p><a href="classgeos_1_1index_1_1strtree_1_1STRtree-members.html">List of all members.</a></p> <table class="memberdecls"> <tr><td colspan="2"><h2><a name="pub-methods"></a> Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#a696257ed769998f4a129bef3b9e32780">STRtree</a> (size_t nodeCapacity=10)</td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#a3a1e68a5099dc855b86604b2dde7e03f">insert</a> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> *itemEnv, void *item)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Adds a spatial item with an extent specified by the given Envelope to the index. <a href="#a3a1e68a5099dc855b86604b2dde7e03f"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#ada94f2eeb8cc1edcdfa346e04bf0f977">query</a> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> *searchEnv, std::vector< void * > &matches)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Queries the index for all items whose extents intersect the given search Envelope. <a href="#ada94f2eeb8cc1edcdfa346e04bf0f977"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#a4a2fc9d3c2c03577bb4c5b3897c55188">query</a> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> *searchEnv, <a class="el" href="classgeos_1_1index_1_1ItemVisitor.html">ItemVisitor</a> &visitor)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Queries the index for all items whose extents intersect the given search Envelope and applies an <a class="el" href="classgeos_1_1index_1_1ItemVisitor.html" title="A visitor for items in an index.">ItemVisitor</a> to them. <a href="#a4a2fc9d3c2c03577bb4c5b3897c55188"></a><br/></td></tr> <tr><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#aecffa6cb4487b6af60f19e7a0ee71e05">remove</a> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> *itemEnv, void *item)</td></tr> <tr><td class="mdescLeft"> </td><td class="mdescRight">Removes a single item from the tree. <a href="#aecffa6cb4487b6af60f19e7a0ee71e05"></a><br/></td></tr> <tr><td colspan="2"><h2><a name="pub-static-methods"></a> Static Public Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="ac935345cd5faba9509670304282b57d9"></a><!-- doxytag: member="geos::index::strtree::STRtree::avg" ref="ac935345cd5faba9509670304282b57d9" args="(double a, double b)" --> static double </td><td class="memItemRight" valign="bottom"><b>avg</b> (double a, double b)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a7d5ba9565a68d11d80083cd1babffebe"></a><!-- doxytag: member="geos::index::strtree::STRtree::centreY" ref="a7d5ba9565a68d11d80083cd1babffebe" args="(const geom::Envelope *e)" --> static double </td><td class="memItemRight" valign="bottom"><b>centreY</b> (const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> *e)</td></tr> <tr><td colspan="2"><h2><a name="pro-methods"></a> Protected Member Functions</h2></td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa330a2a26d6fd4dc49323f395add78a8"></a><!-- doxytag: member="geos::index::strtree::STRtree::createNode" ref="aa330a2a26d6fd4dc49323f395add78a8" args="(int level)" --> <a class="el" href="classgeos_1_1index_1_1strtree_1_1AbstractNode.html">AbstractNode</a> * </td><td class="memItemRight" valign="bottom"><b>createNode</b> (int level)</td></tr> <tr><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abd1492817c7b5e9a2295e983750a5b3a"></a><!-- doxytag: member="geos::index::strtree::STRtree::getIntersectsOp" ref="abd1492817c7b5e9a2295e983750a5b3a" args="()" --> IntersectsOp * </td><td class="memItemRight" valign="bottom"><b>getIntersectsOp</b> ()</td></tr> </table> <hr/><a name="_details"></a><h2>Detailed Description</h2> <p>A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatial data. </p> <p>The STR packed R-tree is simple to implement and maximizes space utilization; that is, as many leaves as possible are filled to capacity. Overlap between nodes is far less than in a basic R-tree. However, once the tree has been built (explicitly or on the first call to <a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html#ada94f2eeb8cc1edcdfa346e04bf0f977" title="Queries the index for all items whose extents intersect the given search Envelope.">query</a>), items may not be added or removed.</p> <p>Described in: P. Rigaux, Michel Scholl and Agnes Voisard. Spatial Databases With Application To GIS. Morgan Kaufmann, San Francisco, 2002. </p> <hr/><h2>Constructor & Destructor Documentation</h2> <a class="anchor" id="a696257ed769998f4a129bef3b9e32780"></a><!-- doxytag: member="geos::index::strtree::STRtree::STRtree" ref="a696257ed769998f4a129bef3b9e32780" args="(size_t nodeCapacity=10)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">geos::index::strtree::STRtree::STRtree </td> <td>(</td> <td class="paramtype">size_t </td> <td class="paramname"> <em>nodeCapacity</em> = <code>10</code></td> <td> ) </td> <td></td> </tr> </table> </div> <div class="memdoc"> <p>Constructs an <a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html" title="A query-only R-tree created using the Sort-Tile-Recursive (STR) algorithm. For two-dimensional spatia...">STRtree</a> with the given maximum number of child nodes that a node may have </p> </div> </div> <hr/><h2>Member Function Documentation</h2> <a class="anchor" id="a3a1e68a5099dc855b86604b2dde7e03f"></a><!-- doxytag: member="geos::index::strtree::STRtree::insert" ref="a3a1e68a5099dc855b86604b2dde7e03f" args="(const geom::Envelope *itemEnv, void *item)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::index::strtree::STRtree::insert </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> * </td> <td class="paramname"> <em>itemEnv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>item</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Adds a spatial item with an extent specified by the given Envelope to the index. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>itemEnv</em> </td><td>Envelope of the item, ownership left to caller. TODO: Reference hold by this class ?</td></tr> <tr><td valign="top"></td><td valign="top"><em>item</em> </td><td>Opaque item, ownership left to caller. Reference hold by this class. </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classgeos_1_1index_1_1SpatialIndex.html#aaac40880b4fbc4a32d1d0aba1d679117">geos::index::SpatialIndex</a>.</p> </div> </div> <a class="anchor" id="a4a2fc9d3c2c03577bb4c5b3897c55188"></a><!-- doxytag: member="geos::index::strtree::STRtree::query" ref="a4a2fc9d3c2c03577bb4c5b3897c55188" args="(const geom::Envelope *searchEnv, ItemVisitor &visitor)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::index::strtree::STRtree::query </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> * </td> <td class="paramname"> <em>searchEnv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype"><a class="el" href="classgeos_1_1index_1_1ItemVisitor.html">ItemVisitor</a> & </td> <td class="paramname"> <em>visitor</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Queries the index for all items whose extents intersect the given search Envelope and applies an <a class="el" href="classgeos_1_1index_1_1ItemVisitor.html" title="A visitor for items in an index.">ItemVisitor</a> to them. </p> <p>Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>searchEnv</em> </td><td>the envelope to query for </td></tr> <tr><td valign="top"></td><td valign="top"><em>visitor</em> </td><td>a visitor object to apply to the items found </td></tr> </table> </dd> </dl> <p>Implements <a class="el" href="classgeos_1_1index_1_1SpatialIndex.html#ab79a4e1da4835cbfa030f25867effcde">geos::index::SpatialIndex</a>.</p> <p>References <a class="el" href="classgeos_1_1index_1_1strtree_1_1AbstractSTRtree.html#a668b51c0354bee9934ebeca13f68d8b1">geos::index::strtree::AbstractSTRtree::query()</a>.</p> </div> </div> <a class="anchor" id="ada94f2eeb8cc1edcdfa346e04bf0f977"></a><!-- doxytag: member="geos::index::strtree::STRtree::query" ref="ada94f2eeb8cc1edcdfa346e04bf0f977" args="(const geom::Envelope *searchEnv, std::vector< void * > &matches)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">void geos::index::strtree::STRtree::query </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> * </td> <td class="paramname"> <em>searchEnv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">std::vector< void * > & </td> <td class="paramname"></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Queries the index for all items whose extents intersect the given search Envelope. </p> <p>Note that some kinds of indexes may also return objects which do not in fact intersect the query envelope.</p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>searchEnv</em> </td><td>the envelope to query for </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd>a list of the items found by the query in a newly allocated vector </dd></dl> <p>Implements <a class="el" href="classgeos_1_1index_1_1SpatialIndex.html#aec3aa2aafa2eff5679c75388afb34ab2">geos::index::SpatialIndex</a>.</p> <p>References <a class="el" href="classgeos_1_1index_1_1strtree_1_1AbstractSTRtree.html#a668b51c0354bee9934ebeca13f68d8b1">geos::index::strtree::AbstractSTRtree::query()</a>.</p> </div> </div> <a class="anchor" id="aecffa6cb4487b6af60f19e7a0ee71e05"></a><!-- doxytag: member="geos::index::strtree::STRtree::remove" ref="aecffa6cb4487b6af60f19e7a0ee71e05" args="(const geom::Envelope *itemEnv, void *item)" --> <div class="memitem"> <div class="memproto"> <table class="memname"> <tr> <td class="memname">bool geos::index::strtree::STRtree::remove </td> <td>(</td> <td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Envelope.html">geom::Envelope</a> * </td> <td class="paramname"> <em>itemEnv</em>, </td> </tr> <tr> <td class="paramkey"></td> <td></td> <td class="paramtype">void * </td> <td class="paramname"> <em>item</em></td><td> </td> </tr> <tr> <td></td> <td>)</td> <td></td><td></td><td><code> [inline, virtual]</code></td> </tr> </table> </div> <div class="memdoc"> <p>Removes a single item from the tree. </p> <dl><dt><b>Parameters:</b></dt><dd> <table border="0" cellspacing="2" cellpadding="0"> <tr><td valign="top"></td><td valign="top"><em>itemEnv</em> </td><td>the Envelope of the item to remove </td></tr> <tr><td valign="top"></td><td valign="top"><em>item</em> </td><td>the item to remove </td></tr> </table> </dd> </dl> <dl class="return"><dt><b>Returns:</b></dt><dd><code>true</code> if the item was found </dd></dl> <p>Implements <a class="el" href="classgeos_1_1index_1_1SpatialIndex.html#a70adf500577ec4c6a595d3d26196eb04">geos::index::SpatialIndex</a>.</p> </div> </div> <hr/>The documentation for this class was generated from the following file:<ul> <li><a class="el" href="STRtree_8h_source.html">STRtree.h</a></li> </ul> </div> <hr class="footer"/><address class="footer"><small>Generated on Thu Jul 22 2010 for GEOS by <a href="http://www.doxygen.org/index.html"> <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.1 </small></address> </body> </html>