266 lines
13 KiB
HTML
266 lines
13 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::algorithm::InteriorPointArea 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
|
||
|
 <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 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 id="navrow2" class="tabs2">
|
||
|
<ul class="tablist">
|
||
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
||
|
<li><a href="inherits.html"><span>Class Hierarchy</span></a></li>
|
||
|
<li><a href="functions.html"><span>Class 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_1algorithm.html">algorithm</a></li><li class="navelem"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html">InteriorPointArea</a></li> </ul>
|
||
|
</div>
|
||
|
</div><!-- top -->
|
||
|
<div class="header">
|
||
|
<div class="summary">
|
||
|
<a href="#pub-methods">Public Member Functions</a> |
|
||
|
<a href="#pri-methods">Private Member Functions</a> |
|
||
|
<a href="#pri-attribs">Private Attributes</a> |
|
||
|
<a href="classgeos_1_1algorithm_1_1InteriorPointArea-members.html">List of all members</a> </div>
|
||
|
<div class="headertitle">
|
||
|
<div class="title">geos::algorithm::InteriorPointArea Class Reference</div> </div>
|
||
|
</div><!--header-->
|
||
|
<div class="contents">
|
||
|
|
||
|
<p>Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases.
|
||
|
<a href="classgeos_1_1algorithm_1_1InteriorPointArea.html#details">More...</a></p>
|
||
|
|
||
|
<p><code>#include <<a class="el" href="InteriorPointArea_8h_source.html">InteriorPointArea.h</a>></code></p>
|
||
|
<div class="dynheader">
|
||
|
Collaboration diagram for geos::algorithm::InteriorPointArea:</div>
|
||
|
<div class="dyncontent">
|
||
|
<div class="center"><iframe scrolling="no" frameborder="0" src="classgeos_1_1algorithm_1_1InteriorPointArea__coll__graph.svg" width="286" height="147"><p><b>This browser is not able to show SVG: try Firefox, Chrome, Safari, or Opera instead.</b></p></iframe>
|
||
|
</div>
|
||
|
<center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
|
||
|
<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:aa9dbe6bd7e7a9668e30ea881388aad3d"><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#aa9dbe6bd7e7a9668e30ea881388aad3d">InteriorPointArea</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *g)</td></tr>
|
||
|
<tr class="separator:aa9dbe6bd7e7a9668e30ea881388aad3d"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a44de841d169bab7c534cdd942ac92032"><td class="memItemLeft" align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#a44de841d169bab7c534cdd942ac92032">getInteriorPoint</a> (<a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> &ret) const </td></tr>
|
||
|
<tr class="separator:a44de841d169bab7c534cdd942ac92032"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table><table class="memberdecls">
|
||
|
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pri-methods"></a>
|
||
|
Private Member Functions</h2></td></tr>
|
||
|
<tr class="memitem:ada6cb1a42534dbba1887dbb47a9329b5"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#ada6cb1a42534dbba1887dbb47a9329b5">process</a> (const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> *geom)</td></tr>
|
||
|
<tr class="separator:ada6cb1a42534dbba1887dbb47a9329b5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:a6fe43468cd1c86895d9ecdcbe0a9ae12"><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#a6fe43468cd1c86895d9ecdcbe0a9ae12">processPolygon</a> (const <a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a> *polygon)</td></tr>
|
||
|
<tr class="separator:a6fe43468cd1c86895d9ecdcbe0a9ae12"><td class="memSeparator" colspan="2"> </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:a05623a13282b23ac4b08a9dbe14f2eb5"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#a05623a13282b23ac4b08a9dbe14f2eb5">interiorPoint</a></td></tr>
|
||
|
<tr class="separator:a05623a13282b23ac4b08a9dbe14f2eb5"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
<tr class="memitem:abb490de223d7fd40450e0e3de218d7c9"><td class="memItemLeft" align="right" valign="top">double </td><td class="memItemRight" valign="bottom"><a class="el" href="classgeos_1_1algorithm_1_1InteriorPointArea.html#abb490de223d7fd40450e0e3de218d7c9">maxWidth</a></td></tr>
|
||
|
<tr class="separator:abb490de223d7fd40450e0e3de218d7c9"><td class="memSeparator" colspan="2"> </td></tr>
|
||
|
</table>
|
||
|
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
|
||
|
<div class="textblock"><p>Computes a point in the interior of an areal geometry. The point will lie in the geometry interior in all except certain pathological cases. </p>
|
||
|
<h2>Algorithm</h2>
|
||
|
<p>For each input polygon: </p><ul>
|
||
|
<li>
|
||
|
Determine a horizontal scan line on which the interior point will be located. To increase the chance of the scan line having non-zero-width intersection with the polygon the scan line Y ordinate is chosen to be near the centre of the polygon's Y extent but distinct from all of vertex Y ordinates. </li>
|
||
|
<li>
|
||
|
Compute the sections of the scan line which lie in the interior of the polygon. </li>
|
||
|
<li>
|
||
|
Choose the widest interior section and take its midpoint as the interior point. </li>
|
||
|
</ul>
|
||
|
<p>The final interior point is chosen as the one occurring in the widest interior section. </p>
|
||
|
<p>This algorithm is a tradeoff between performance and point quality (where points further from the geometry boundary are considered to be higher quality) Priority is given to performance. This means that the computed interior point may not be suitable for some uses (such as label positioning). </p>
|
||
|
<p>The algorithm handles some kinds of invalid/degenerate geometry, including zero-area and self-intersecting polygons. </p>
|
||
|
<p>Empty geometry is handled by returning a <code>null</code> point.</p>
|
||
|
<h3>KNOWN BUGS</h3>
|
||
|
<ul>
|
||
|
<li>
|
||
|
If a fixed precision model is used, in some cases this method may return a point which does not lie in the interior. </li>
|
||
|
<li>
|
||
|
If the input polygon is <em>extremely</em> narrow the computed point may not lie in the interior of the polygon. </li>
|
||
|
</ul>
|
||
|
|
||
|
<p>Definition at line <a class="el" href="InteriorPointArea_8h_source.html#l00080">80</a> of file <a class="el" href="InteriorPointArea_8h_source.html">InteriorPointArea.h</a>.</p>
|
||
|
</div><h2 class="groupheader">Constructor & Destructor Documentation</h2>
|
||
|
<a class="anchor" id="aa9dbe6bd7e7a9668e30ea881388aad3d"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">geos::algorithm::InteriorPointArea::InteriorPointArea </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> * </td>
|
||
|
<td class="paramname"><em>g</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Creates a new interior point finder for an areal geometry.</p>
|
||
|
<dl class="params"><dt>Parameters</dt><dd>
|
||
|
<table class="params">
|
||
|
<tr><td class="paramname">g</td><td>an areal geometry </td></tr>
|
||
|
</table>
|
||
|
</dd>
|
||
|
</dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<h2 class="groupheader">Member Function Documentation</h2>
|
||
|
<a class="anchor" id="a44de841d169bab7c534cdd942ac92032"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">bool geos::algorithm::InteriorPointArea::getInteriorPoint </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> & </td>
|
||
|
<td class="paramname"><em>ret</em></td><td>)</td>
|
||
|
<td> const</td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
<p>Gets the computed interior point.</p>
|
||
|
<dl class="section return"><dt>Returns</dt><dd>the coordinate of an interior point or <code>null</code> if the input geometry is empty </dd></dl>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="ada6cb1a42534dbba1887dbb47a9329b5"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void geos::algorithm::InteriorPointArea::process </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Geometry.html">geom::Geometry</a> * </td>
|
||
|
<td class="paramname"><em>geom</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="a6fe43468cd1c86895d9ecdcbe0a9ae12"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">void geos::algorithm::InteriorPointArea::processPolygon </td>
|
||
|
<td>(</td>
|
||
|
<td class="paramtype">const <a class="el" href="classgeos_1_1geom_1_1Polygon.html">geom::Polygon</a> * </td>
|
||
|
<td class="paramname"><em>polygon</em></td><td>)</td>
|
||
|
<td></td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</td>
|
||
|
<td class="mlabels-right">
|
||
|
<span class="mlabels"><span class="mlabel">private</span></span> </td>
|
||
|
</tr>
|
||
|
</table>
|
||
|
</div><div class="memdoc">
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<h2 class="groupheader">Member Data Documentation</h2>
|
||
|
<a class="anchor" id="a05623a13282b23ac4b08a9dbe14f2eb5"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname"><a class="el" href="classgeos_1_1geom_1_1Coordinate.html">geom::Coordinate</a> geos::algorithm::InteriorPointArea::interiorPoint</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="InteriorPointArea_8h_source.html#l00100">100</a> of file <a class="el" href="InteriorPointArea_8h_source.html">InteriorPointArea.h</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<a class="anchor" id="abb490de223d7fd40450e0e3de218d7c9"></a>
|
||
|
<div class="memitem">
|
||
|
<div class="memproto">
|
||
|
<table class="mlabels">
|
||
|
<tr>
|
||
|
<td class="mlabels-left">
|
||
|
<table class="memname">
|
||
|
<tr>
|
||
|
<td class="memname">double geos::algorithm::InteriorPointArea::maxWidth</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="InteriorPointArea_8h_source.html#l00101">101</a> of file <a class="el" href="InteriorPointArea_8h_source.html">InteriorPointArea.h</a>.</p>
|
||
|
|
||
|
</div>
|
||
|
</div>
|
||
|
<hr/>The documentation for this class was generated from the following file:<ul>
|
||
|
<li><a class="el" href="InteriorPointArea_8h_source.html">InteriorPointArea.h</a></li>
|
||
|
</ul>
|
||
|
</div><!-- contents -->
|
||
|
<!-- start footer part -->
|
||
|
<hr class="footer"/><address class="footer"><small>
|
||
|
Generated by  <a href="http://www.doxygen.org/index.html">
|
||
|
<img class="footer" src="doxygen.png" alt="doxygen"/>
|
||
|
</a> 1.8.11
|
||
|
</small></address>
|
||
|
</body>
|
||
|
</html>
|