Files
geometry/doc/doxygen_output/html/group__length.html
Barend Gehrels 363580fbf6 Added old doxygen docs
[SVN r59777]
2010-02-20 15:57:12 +00:00

184 lines
11 KiB
HTML

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Boost.Geometry (aka GGL, Generic Geometry Library)</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
<link href="tabs.css" rel="stylesheet" type="text/css">
</head>
<table cellpadding="2" width="100%">
<tbody>
<tr>
<td valign="top">
<img alt="Boost.Geometry" src="images/ggl-logo-big.png" height="80" width="200">
&nbsp;&nbsp;
</td>
<td valign="top" align="right">
<a href="http://www.boost.org">
<img alt="Boost C++ Libraries" src="images/accepted_by_boost.png" height="80" width="230" border="0">
</a>
</td>
</tr>
</tbody>
</table>
<!-- Generated by Doxygen 1.5.9 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
<li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
<li><a href="modules.html"><span>Modules</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
<li><a href="examples.html"><span>Examples</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>length: calculate length of a linear geometry</h1><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Classes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">struct &nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="structboost_1_1geometry_1_1length__result.html">boost::geometry::length_result&lt; Geometry &gt;</a></td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Meta-function defining return type of length function. <a href="structboost_1_1geometry_1_1length__result.html#_details">More...</a><br></td></tr>
<tr><td colspan="2"><br><h2>Functions</h2></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Geometry , typename Strategy &gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">length_result&lt; Geometry &gt;::type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__length.html#g9cccd3df58ebe23f8a5ba35ddca81b31">boost::geometry::length</a> (Geometry const &amp;geometry, Strategy const &amp;strategy)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>. <a href="#g9cccd3df58ebe23f8a5ba35ddca81b31"></a><br></td></tr>
<tr><td class="memTemplParams" nowrap colspan="2">template&lt;typename Geometry &gt; </td></tr>
<tr><td class="memTemplItemLeft" nowrap align="right" valign="top">length_result&lt; Geometry &gt;::type&nbsp;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="group__length.html#g1537537131cd91037cf3ad9fd80d50f1">boost::geometry::length</a> (Geometry const &amp;geometry)</td></tr>
<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Calculate length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>. <a href="#g1537537131cd91037cf3ad9fd80d50f1"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
The length algorithm is implemented for the linestring and the multi_linestring geometry and results in the length of the linestring. If the points of a linestring have coordinates expressed in kilometers, the length of the line is expressed in kilometers as well. <dl class="user" compact><dt><b>Example:</b></dt><dd>Example showing length calculation <div class="fragment"><pre class="fragment">{
<a class="code" href="classboost_1_1geometry_1_1linestring.html" title="A linestring (named so by OGC) is a collection (default a vector) of points.">boost::geometry::linestring&lt;boost::geometry::point_xy&lt;double&gt;</a> &gt; line;
boost::geometry::read_wkt(<span class="stringliteral">"linestring(0 0,1 1,4 8,3 2)"</span>, line);
std::cout &lt;&lt; <span class="stringliteral">"linestring length is "</span>
&lt;&lt; <a class="code" href="group__length.html#g1537537131cd91037cf3ad9fd80d50f1" title="Calculate length of a geometry.">boost::geometry::length</a>(line)
&lt;&lt; <span class="stringliteral">" units"</span> &lt;&lt; std::endl;
}
</pre></div> </dd></dl>
<hr><h2>Function Documentation</h2>
<a class="anchor" name="g1537537131cd91037cf3ad9fd80d50f1"></a><!-- doxytag: member="boost::geometry::length" ref="g1537537131cd91037cf3ad9fd80d50f1" args="(Geometry const &amp;geometry)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Geometry &gt; </div>
<table class="memname">
<tr>
<td class="memname">length_result&lt;Geometry&gt;::type boost::geometry::length </td>
<td>(</td>
<td class="paramtype">Geometry const &amp;&nbsp;</td>
<td class="paramname"> <em>geometry</em> </td>
<td>&nbsp;)&nbsp;</td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Calculate length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>.
<p>
The function length returns the length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>, using the default distance-calculation-strategy <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="namespaceboost_1_1geometry.html">geometry</a></em>&nbsp;</td><td>the <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>, being a <a class="el" href="classboost_1_1geometry_1_1linestring.html" title="A linestring (named so by OGC) is a collection (default a vector) of points.">geometry::linestring</a>, vector, iterator pair, or any other <a class="el" href="namespaceboost.html">boost</a> compatible range </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the length Example showing length calculation on a vector <div class="fragment"><pre class="fragment">{
std::vector&lt;boost::geometry::point_xy&lt;double&gt; &gt; line;
boost::geometry::read_wkt&lt;boost::geometry::point_xy&lt;double&gt; &gt;(<span class="stringliteral">"linestring(0 0,1 1,4 8,3 2)"</span>, std::back_inserter(line));
std::cout &lt;&lt; <span class="stringliteral">"linestring length is "</span>
&lt;&lt; <a class="code" href="group__length.html#g1537537131cd91037cf3ad9fd80d50f1" title="Calculate length of a geometry.">boost::geometry::length</a>(line)
&lt;&lt; <span class="stringliteral">" units"</span> &lt;&lt; std::endl;
}
</pre></div> </dd></dl>
<dl compact><dt><b>Examples: </b></dt><dd>
<a class="el" href="02__linestring__example_8cpp-example.html#a7">02_linestring_example.cpp</a>, <a class="el" href="07__graph__route__example_8cpp-example.html#a2">07_graph_route_example.cpp</a>, <a class="el" href="c03__custom__linestring__example_8cpp-example.html#a3">c03_custom_linestring_example.cpp</a>, and <a class="el" href="c05__custom__point__pointer__example_8cpp-example.html#a1">c05_custom_point_pointer_example.cpp</a>.</dl>
<p>Definition at line <a class="el" href="algorithms_2length_8hpp_source.html#l00154">154</a> of file <a class="el" href="algorithms_2length_8hpp_source.html">length.hpp</a>.</p>
</div>
</div><p>
<a class="anchor" name="g9cccd3df58ebe23f8a5ba35ddca81b31"></a><!-- doxytag: member="boost::geometry::length" ref="g9cccd3df58ebe23f8a5ba35ddca81b31" args="(Geometry const &amp;geometry, Strategy const &amp;strategy)" -->
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;typename Geometry , typename Strategy &gt; </div>
<table class="memname">
<tr>
<td class="memname">length_result&lt;Geometry&gt;::type boost::geometry::length </td>
<td>(</td>
<td class="paramtype">Geometry const &amp;&nbsp;</td>
<td class="paramname"> <em>geometry</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">Strategy const &amp;&nbsp;</td>
<td class="paramname"> <em>strategy</em></td><td>&nbsp;</td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>
Calculate length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>.
<p>
The function length returns the length of a <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>, using specified <a class="el" href="namespaceboost_1_1geometry_1_1strategy.html">strategy</a> <dl compact><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="namespaceboost_1_1geometry.html">geometry</a></em>&nbsp;</td><td>the <a class="el" href="namespaceboost_1_1geometry.html">geometry</a>, being a <a class="el" href="classboost_1_1geometry_1_1linestring.html" title="A linestring (named so by OGC) is a collection (default a vector) of points.">geometry::linestring</a>, vector, iterator pair, or any other <a class="el" href="namespaceboost.html">boost</a> compatible range </td></tr>
<tr><td valign="top"></td><td valign="top"><em><a class="el" href="namespaceboost_1_1geometry_1_1strategy.html">strategy</a></em>&nbsp;</td><td><a class="el" href="namespaceboost_1_1geometry_1_1strategy.html">strategy</a> to be used for distance calculations. </td></tr>
</table>
</dl>
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the length </dd></dl>
<dl class="user" compact><dt><b>Example:</b></dt><dd>Example showing length calculation using iterators and the Vincenty <a class="el" href="namespaceboost_1_1geometry_1_1strategy.html">strategy</a> <div class="fragment"><pre class="fragment">{
<span class="comment">/*</span>
<span class="comment"> Extension, other coordinate system:</span>
<span class="comment"> using namespace boost::geometry;</span>
<span class="comment"> typedef point_ll&lt;float, boost::geometry::cs::geographic&lt;boost::geometry::degree&gt; &gt; LL;</span>
<span class="comment"> std::deque&lt;LL&gt; line;</span>
<span class="comment"> boost::geometry::read_wkt&lt;LL&gt;("linestring(0 51,1 51,2 52)", std::back_inserter(line));</span>
<span class="comment"> std::cout &lt;&lt; "linestring length is "</span>
<span class="comment"> &lt;&lt; 0.001 * boost::geometry::length(line, boost::geometry::strategy::distance::vincenty&lt;LL&gt;())</span>
<span class="comment"> &lt;&lt; " kilometers" &lt;&lt; std::endl;</span>
<span class="comment"> */</span>
}
</pre></div> </dd></dl>
<p>Definition at line <a class="el" href="algorithms_2length_8hpp_source.html#l00196">196</a> of file <a class="el" href="algorithms_2length_8hpp_source.html">length.hpp</a>.</p>
</div>
</div><p>
</div>
<hr size="1">
<table width="100%">
<tbody>
<tr>
<td align="left"><small>
<p>December 1, 2009</p>
</small></td>
<td align="right">
<small>Copyright © 1995-2009 Barend Gehrels, Geodan, Amsterdam<br>
Copyright © 2008-2009 Bruno Lalande, Paris<br>
Copyright © 2009 Mateusz Loskot, Cadcorp, London<br>
</small>
</td>
</tr>
</tbody>
</table>
<address style="text-align: right;"><small>
Documentation is generated by&nbsp;<a href="http://www.doxygen.org/index.html">Doxygen</a>
</small></address>
</body>
</html>