geos_390_docs/classgeos_1_1operation_1_1d...

344 lines
20 KiB
HTML

<!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"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.11"/>
<title>GEOS: geos::operation::distance::IndexedFacetDistance Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr style="height: 56px;">
<td id="projectalign" style="padding-left: 0.5em;">
<div id="projectname">GEOS
&#160;<span id="projectnumber">3.9.1dev</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.11 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main&#160;Page</span></a></li>
<li><a href="pages.html"><span>Related&#160;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 id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="annotated.html"><span>Class&#160;List</span></a></li>
<li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class&#160;Members</span></a></li>
</ul>
</div>
<div id="nav-path" class="navpath">
<ul>
<li class="navelem"><a class="el" href="namespacegeos.html">geos</a></li><li class="navelem"><a class="el" href="namespacegeos_1_1operation.html">operation</a></li><li class="navelem"><a class="el" href="namespacegeos_1_1operation_1_1distance.html">distance</a></li><li class="navelem"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html">IndexedFacetDistance</a></li> </ul>
</div>
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="#pub-static-methods">Static Public Member Functions</a> &#124;
<a href="#pri-attribs">Private Attributes</a> &#124;
<a href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance-members.html">List of all members</a> </div>
<div class="headertitle">
<div class="title">geos::operation::distance::IndexedFacetDistance Class Reference</div> </div>
</div><!--header-->
<div class="contents">
<p>Computes the distance between the facets (segments and vertices) of two <a class="el" href="classgeos_1_1geom_1_1Geometry.html">Geometrys</a> using a Branch-and-Bound algorithm.
<a href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#details">More...</a></p>
<p><code>#include &lt;<a class="el" href="IndexedFacetDistance_8h_source.html">IndexedFacetDistance.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af2d15f4683ac632a717743dca891ddca"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#af2d15f4683ac632a717743dca891ddca">IndexedFacetDistance</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g)</td></tr>
<tr class="memdesc:af2d15f4683ac632a717743dca891ddca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Creates a new distance-finding instance for a given target <a class="el" href="classgeos_1_1geom_1_1Geometry.html" title="Basic implementation of Geometry, constructed and destructed by GeometryFactory. ">geom::Geometry</a>. <a href="#af2d15f4683ac632a717743dca891ddca">More...</a><br /></td></tr>
<tr class="separator:af2d15f4683ac632a717743dca891ddca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ac14ef44b0f65cba67a5f0d62d6c0a1ad"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#ac14ef44b0f65cba67a5f0d62d6c0a1ad">distance</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g) const </td></tr>
<tr class="memdesc:ac14ef44b0f65cba67a5f0d62d6c0a1ad"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the distance from the base geometry to the given geometry. <a href="#ac14ef44b0f65cba67a5f0d62d6c0a1ad">More...</a><br /></td></tr>
<tr class="separator:ac14ef44b0f65cba67a5f0d62d6c0a1ad"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a4817479267d2d1b5f0d48852e4e21138"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classgeos_1_1operation_1_1distance_1_1GeometryLocation.html">GeometryLocation</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#a4817479267d2d1b5f0d48852e4e21138">nearestLocations</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g) const </td></tr>
<tr class="memdesc:a4817479267d2d1b5f0d48852e4e21138"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the nearest locations on the base geometry and the given geometry. <a href="#a4817479267d2d1b5f0d48852e4e21138">More...</a><br /></td></tr>
<tr class="separator:a4817479267d2d1b5f0d48852e4e21138"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a85b1e1bc84c5a786dacaa962ec7dc741"><td class="memItemLeft" align="right" valign="top">std::vector&lt; <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#a85b1e1bc84c5a786dacaa962ec7dc741">nearestPoints</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g) const </td></tr>
<tr class="memdesc:a85b1e1bc84c5a786dacaa962ec7dc741"><td class="mdescLeft">&#160;</td><td class="mdescRight">Compute the nearest locations on the target geometry and the given geometry. <a href="#a85b1e1bc84c5a786dacaa962ec7dc741">More...</a><br /></td></tr>
<tr class="separator:a85b1e1bc84c5a786dacaa962ec7dc741"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-static-methods"></a>
Static Public Member Functions</h2></td></tr>
<tr class="memitem:a6fe2effb5e9fff357f2c2aab5c7d1b10"><td class="memItemLeft" align="right" valign="top">static double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#a6fe2effb5e9fff357f2c2aab5c7d1b10">distance</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g1, const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g2)</td></tr>
<tr class="memdesc:a6fe2effb5e9fff357f2c2aab5c7d1b10"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the distance between facets of two geometries. <a href="#a6fe2effb5e9fff357f2c2aab5c7d1b10">More...</a><br /></td></tr>
<tr class="separator:a6fe2effb5e9fff357f2c2aab5c7d1b10"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3f3a1b9eaf0fa45d82974d1939782ff2"><td class="memItemLeft" align="right" valign="top">static std::vector&lt; <a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#a3f3a1b9eaf0fa45d82974d1939782ff2">nearestPoints</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g1, const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g2)</td></tr>
<tr class="memdesc:a3f3a1b9eaf0fa45d82974d1939782ff2"><td class="mdescLeft">&#160;</td><td class="mdescRight">Computes the nearest points of the facets of two geometries. <a href="#a3f3a1b9eaf0fa45d82974d1939782ff2">More...</a><br /></td></tr>
<tr class="separator:a3f3a1b9eaf0fa45d82974d1939782ff2"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-attribs"></a>
Private Attributes</h2></td></tr>
<tr class="memitem:acd5bb41419a04f62d480b7bf1be0c6eb"><td class="memItemLeft" align="right" valign="top">std::unique_ptr&lt; <a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html">geos::index::strtree::STRtree</a> &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1operation_1_1distance_1_1IndexedFacetDistance.html#acd5bb41419a04f62d480b7bf1be0c6eb">cachedTree</a></td></tr>
<tr class="separator:acd5bb41419a04f62d480b7bf1be0c6eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><p>Computes the distance between the facets (segments and vertices) of two <a class="el" href="classgeos_1_1geom_1_1Geometry.html">Geometrys</a> using a Branch-and-Bound algorithm. </p>
<p>The Branch-and-Bound algorithm operates over a traversal of R-trees built on the target and the query geometries.</p>
<p>This approach provides the following benefits:</p>
<ul>
<li>Performance is dramatically improved due to the use of the R-tree index and the pruning due to the Branch-and-Bound approach</li>
<li>The spatial index on the target geometry is cached which allow reuse in an repeated query situation.</li>
</ul>
<p>Using this technique is usually much more performant than using the brute-force <a class="el" href="classgeos_1_1geom_1_1Geometry.html#ad21bf3fd92a4d3c573228806f77123b7">geom::Geometry::distance(const Geometry* g) const</a> when one or both input geometries are large, or when evaluating many distance computations against a single geometry.</p>
<dl class="section author"><dt>Author</dt><dd>Martin Davis </dd></dl>
<p>Definition at line <a class="el" href="IndexedFacetDistance_8h_source.html#l00047">47</a> of file <a class="el" href="IndexedFacetDistance_8h_source.html">IndexedFacetDistance.h</a>.</p>
</div><h2 class="groupheader">Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="af2d15f4683ac632a717743dca891ddca"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">geos::operation::distance::IndexedFacetDistance::IndexedFacetDistance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g</em></td><td>)</td>
<td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Creates a new distance-finding instance for a given target <a class="el" href="classgeos_1_1geom_1_1Geometry.html" title="Basic implementation of Geometry, constructed and destructed by GeometryFactory. ">geom::Geometry</a>. </p>
<p>Distances will be computed to all facets of the input geometry. The facets of the geometry are the discrete segments and points contained in its components. In the case of lineal and puntal inputs, this is equivalent to computing the conventional distance. In the case of polygonal inputs, this is equivalent to computing the distance to the polygon boundaries.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g</td><td>a Geometry, which may be of any type. </td></tr>
</table>
</dd>
</dl>
<p>Definition at line <a class="el" href="IndexedFacetDistance_8h_source.html#l00061">61</a> of file <a class="el" href="IndexedFacetDistance_8h_source.html">IndexedFacetDistance.h</a>.</p>
</div>
</div>
<h2 class="groupheader">Member Function Documentation</h2>
<a class="anchor" id="a6fe2effb5e9fff357f2c2aab5c7d1b10"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static double geos::operation::distance::IndexedFacetDistance::distance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the distance between facets of two geometries. </p>
<p>For geometries with many segments or points, this can be faster than using a simple distance algorithm.</p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g1</td><td>a geometry </td></tr>
<tr><td class="paramname">g2</td><td>a geometry </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the distance between facets of the geometries </dd></dl>
</div>
</div>
<a class="anchor" id="ac14ef44b0f65cba67a5f0d62d6c0a1ad"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">double geos::operation::distance::IndexedFacetDistance::distance </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the distance from the base geometry to the given geometry. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g</td><td>the geometry to compute the distance to</td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the computed distance </dd></dl>
</div>
</div>
<a class="anchor" id="a4817479267d2d1b5f0d48852e4e21138"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classgeos_1_1operation_1_1distance_1_1GeometryLocation.html">GeometryLocation</a>&gt; geos::operation::distance::IndexedFacetDistance::nearestLocations </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the nearest locations on the base geometry and the given geometry. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g</td><td>the geometry to compute the nearest location to </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the nearest locations </dd></dl>
</div>
</div>
<a class="anchor" id="a3f3a1b9eaf0fa45d82974d1939782ff2"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">static std::vector&lt;<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a>&gt; geos::operation::distance::IndexedFacetDistance::nearestPoints </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g1</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g2</em>&#160;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">static</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Computes the nearest points of the facets of two geometries. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g1</td><td>a geometry </td></tr>
<tr><td class="paramname">g2</td><td>a geometry </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the nearest points on the facets of the geometries </dd></dl>
</div>
</div>
<a class="anchor" id="a85b1e1bc84c5a786dacaa962ec7dc741"></a>
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">std::vector&lt;<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a>&gt; geos::operation::distance::IndexedFacetDistance::nearestPoints </td>
<td>(</td>
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *&#160;</td>
<td class="paramname"><em>g</em></td><td>)</td>
<td> const</td>
</tr>
</table>
</div><div class="memdoc">
<p>Compute the nearest locations on the target geometry and the given geometry. </p>
<dl class="params"><dt>Parameters</dt><dd>
<table class="params">
<tr><td class="paramname">g</td><td>the geometry to compute the nearest point to </td></tr>
</table>
</dd>
</dl>
<dl class="section return"><dt>Returns</dt><dd>the nearest points </dd></dl>
</div>
</div>
<h2 class="groupheader">Member Data Documentation</h2>
<a class="anchor" id="acd5bb41419a04f62d480b7bf1be0c6eb"></a>
<div class="memitem">
<div class="memproto">
<table class="mlabels">
<tr>
<td class="mlabels-left">
<table class="memname">
<tr>
<td class="memname">std::unique_ptr&lt;<a class="el" href="classgeos_1_1index_1_1strtree_1_1STRtree.html">geos::index::strtree::STRtree</a>&gt; geos::operation::distance::IndexedFacetDistance::cachedTree</td>
</tr>
</table>
</td>
<td class="mlabels-right">
<span class="mlabels"><span class="mlabel">private</span></span> </td>
</tr>
</table>
</div><div class="memdoc">
<p>Definition at line <a class="el" href="IndexedFacetDistance_8h_source.html#l00102">102</a> of file <a class="el" href="IndexedFacetDistance_8h_source.html">IndexedFacetDistance.h</a>.</p>
</div>
</div>
<hr/>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="IndexedFacetDistance_8h_source.html">IndexedFacetDistance.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.11
</small></address>
</body>
</html>