Debian Codegraph @

docs/apidoc/html/classXapian_1_1GreatCircleMetric.html

raw symbols SCIP
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <meta http-equiv="X-UA-Compatible" content="IE=9"/>
6 <meta name="generator" content="Doxygen 1.15.0"/>
7 <meta name="viewport" content="width=device-width, initial-scale=1"/>
8 <title>Xapian: API Documentation: Xapian::GreatCircleMetric Class Reference</title>
9 <link href="tabs.css" rel="stylesheet" type="text/css"/>
10 <script type="text/javascript" src="jquery.js"></script>
11 <script type="text/javascript" src="dynsections.js"></script>
12 <link href="doxygen.css" rel="stylesheet" type="text/css" />
13 </head>
14 <body>
15 <div id="top"><!-- do not remove this div, it is closed by doxygen! -->
16 <div id="titlearea">
17 <table cellspacing="0" cellpadding="0">
18 <tbody>
19 <tr style="height: 56px;">
20 <td id="projectalign" style="padding-left: 0.5em;">
21 <div id="projectname">xapian-core
22 &#160;<span id="projectnumber">1.4.31</span>
23 </div>
24 </td>
25 </tr>
26 </tbody>
27 </table>
28 </div>
29 <!-- end header part -->
30 <!-- Generated by Doxygen 1.15.0 -->
31 <script type="text/javascript">
32 $(function() { codefold.init(); });
33 </script>
34 <script type="text/javascript" src="menudata.js"></script>
35 <script type="text/javascript" src="menu.js"></script>
36 <script type="text/javascript">
37 $(function() {
38 initMenu('',false,false,'search.php','Search',false);
39 });
40 </script>
41 <div id="main-nav"></div>
42 <div id="nav-path" class="navpath">
43 <ul>
44 <li class="navelem"><a href="namespaceXapian.html">Xapian</a></li><li class="navelem"><a href="classXapian_1_1GreatCircleMetric.html">GreatCircleMetric</a></li> </ul>
45 </div>
46 </div><!-- top -->
47 <div id="doc-content">
48 <div class="header">
49 <div class="summary">
50 <a href="#pub-methods">Public Member Functions</a> &#124;
51 <a href="classXapian_1_1GreatCircleMetric-members.html">List of all members</a> </div>
52 <div class="headertitle"><div class="title">Xapian::GreatCircleMetric Class Reference</div></div>
53 </div><!--header-->
54 <div class="contents">
55
56 <p>Calculate the great-circle distance between two coordinates on a sphere.
57 <a href="#details">More...</a></p>
58
59 <p><code>#include &lt;geospatial.h&gt;</code></p>
60 <div id="dynsection-0" onclick="return dynsection.toggleVisibility(this)" class="dynheader closed" style="cursor:pointer;"><span class="dynarrow"><span class="arrowhead closed"></span></span>Inheritance diagram for Xapian::GreatCircleMetric:</div>
61 <div id="dynsection-0-summary" class="dynsummary" style="display:block;">
62 </div>
63 <div id="dynsection-0-content" class="dyncontent" style="display:none;">
64 <div class="center"><img src="classXapian_1_1GreatCircleMetric__inherit__graph.png" border="0" usemap="#aXapian_1_1GreatCircleMetric_inherit__map" loading="lazy" alt="Inheritance graph"/></div>
65 <map name="aXapian_1_1GreatCircleMetric_inherit__map" id="aXapian_1_1GreatCircleMetric_inherit__map">
66 <area shape="rect" title="Calculate the great&#45;circle distance between two coordinates on a sphere." alt="" coords="5,81,194,109"/>
67 <area shape="rect" href="classXapian_1_1LatLongMetric.html" title="Base class for calculating distances between two lat/long coordinates." alt="" coords="16,5,183,33"/>
68 <area shape="poly" title=" " alt="" coords="101,47,102,82,97,80,98,51"/>
69 </map>
70 <center><span class="legend">[<a href="graph_legend.html">legend</a>]</span></center></div>
71 <table class="memberdecls">
72 <tr class="heading"><td colspan="2"><h2 id="header-pub-methods" class="groupheader"><a id="pub-methods" name="pub-methods"></a>
73 Public Member Functions</h2></td></tr>
74 <tr class="memitem:a370614b3184b248cef3466360a306f04" id="r_a370614b3184b248cef3466360a306f04"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a370614b3184b248cef3466360a306f04">GreatCircleMetric</a> ()</td></tr>
75 <tr class="memdesc:a370614b3184b248cef3466360a306f04"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a <a class="el" href="classXapian_1_1GreatCircleMetric.html" title="Calculate the great-circle distance between two coordinates on a sphere.">GreatCircleMetric</a>. <br /></td></tr>
76 <tr class="memitem:ad1503db5015359efd5045947d249773a" id="r_ad1503db5015359efd5045947d249773a"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad1503db5015359efd5045947d249773a">GreatCircleMetric</a> (double radius_)</td></tr>
77 <tr class="memdesc:ad1503db5015359efd5045947d249773a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Construct a <a class="el" href="classXapian_1_1GreatCircleMetric.html" title="Calculate the great-circle distance between two coordinates on a sphere.">GreatCircleMetric</a> using a specified radius. <br /></td></tr>
78 <tr class="memitem:afc3ebef50fda81a5fc70bf666098bbb5" id="r_afc3ebef50fda81a5fc70bf666098bbb5"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#afc3ebef50fda81a5fc70bf666098bbb5">pointwise_distance</a> (const <a class="el" href="structXapian_1_1LatLongCoord.html">LatLongCoord</a> &amp;a, const <a class="el" href="structXapian_1_1LatLongCoord.html">LatLongCoord</a> &amp;b) const</td></tr>
79 <tr class="memdesc:afc3ebef50fda81a5fc70bf666098bbb5"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the great-circle distance between points on the sphere. <br /></td></tr>
80 <tr class="memitem:a3a9a960564bccae8c449a06691feed9e" id="r_a3a9a960564bccae8c449a06691feed9e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classXapian_1_1LatLongMetric.html">LatLongMetric</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a3a9a960564bccae8c449a06691feed9e">clone</a> () const</td></tr>
81 <tr class="memdesc:a3a9a960564bccae8c449a06691feed9e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Clone the metric. <br /></td></tr>
82 <tr class="memitem:ae714ff4dc3aa8cb176007f6696b6cba4" id="r_ae714ff4dc3aa8cb176007f6696b6cba4"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ae714ff4dc3aa8cb176007f6696b6cba4">name</a> () const</td></tr>
83 <tr class="memdesc:ae714ff4dc3aa8cb176007f6696b6cba4"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the full name of the metric. <br /></td></tr>
84 <tr class="memitem:a2c59f816fdee553ee213693cd037657a" id="r_a2c59f816fdee553ee213693cd037657a"><td class="memItemLeft" align="right" valign="top">std::string&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#a2c59f816fdee553ee213693cd037657a">serialise</a> () const</td></tr>
85 <tr class="memdesc:a2c59f816fdee553ee213693cd037657a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Serialise object parameters into a string. <br /></td></tr>
86 <tr class="memitem:ad5d72e63be8e63f83d2d089335810d68" id="r_ad5d72e63be8e63f83d2d089335810d68"><td class="memItemLeft" align="right" valign="top"><a class="el" href="classXapian_1_1LatLongMetric.html">LatLongMetric</a> *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="#ad5d72e63be8e63f83d2d089335810d68">unserialise</a> (const std::string &amp;serialised) const</td></tr>
87 <tr class="memdesc:ad5d72e63be8e63f83d2d089335810d68"><td class="mdescLeft">&#160;</td><td class="mdescRight">Create object given string serialisation returned by <a class="el" href="#a2c59f816fdee553ee213693cd037657a" title="Serialise object parameters into a string.">serialise()</a>. <br /></td></tr>
88 <tr class="inherit_header pub_methods_classXapian_1_1LatLongMetric"><td colspan="2" onclick="javascript:dynsection.toggleInherit('pub_methods_classXapian_1_1LatLongMetric')"><span class="dynarrow"><span class="arrowhead closed"></span></span>Public Member Functions inherited from <a class="el" href="classXapian_1_1LatLongMetric.html">Xapian::LatLongMetric</a></td></tr>
89 <tr class="memitem:a43dd8ae5b17c70310f3581fb7dabbca6 inherit pub_methods_classXapian_1_1LatLongMetric" id="r_a43dd8ae5b17c70310f3581fb7dabbca6"><td class="memItemLeft" align="right" valign="top">
90 virtual&#160;</td><td class="memItemRight" valign="bottom"><b>~LatLongMetric</b> ()</td></tr>
91 <tr class="memdesc:a43dd8ae5b17c70310f3581fb7dabbca6 inherit pub_methods_classXapian_1_1LatLongMetric"><td class="mdescLeft">&#160;</td><td class="mdescRight">Destructor. <br /></td></tr>
92 <tr class="memitem:a12f867071c2715dabef83ea7fb9e9768 inherit pub_methods_classXapian_1_1LatLongMetric" id="r_a12f867071c2715dabef83ea7fb9e9768"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1LatLongMetric.html#a12f867071c2715dabef83ea7fb9e9768">operator()</a> (const <a class="el" href="classXapian_1_1LatLongCoords.html">LatLongCoords</a> &amp;a, const <a class="el" href="classXapian_1_1LatLongCoords.html">LatLongCoords</a> &amp;b) const</td></tr>
93 <tr class="memdesc:a12f867071c2715dabef83ea7fb9e9768 inherit pub_methods_classXapian_1_1LatLongMetric"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the distance between two coordinate lists, in metres. <br /></td></tr>
94 <tr class="memitem:ad9d8ef2fae8e873260152117cea235fc inherit pub_methods_classXapian_1_1LatLongMetric" id="r_ad9d8ef2fae8e873260152117cea235fc"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1LatLongMetric.html#ad9d8ef2fae8e873260152117cea235fc">operator()</a> (const <a class="el" href="classXapian_1_1LatLongCoords.html">LatLongCoords</a> &amp;a, const std::string &amp;b) const</td></tr>
95 <tr class="memdesc:ad9d8ef2fae8e873260152117cea235fc inherit pub_methods_classXapian_1_1LatLongMetric"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the distance between two coordinate lists, in metres. <br /></td></tr>
96 <tr class="memitem:a2d61e659ded795c9f9b58eb317264db3 inherit pub_methods_classXapian_1_1LatLongMetric" id="r_a2d61e659ded795c9f9b58eb317264db3"><td class="memItemLeft" align="right" valign="top">double&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classXapian_1_1LatLongMetric.html#a2d61e659ded795c9f9b58eb317264db3">operator()</a> (const <a class="el" href="classXapian_1_1LatLongCoords.html">LatLongCoords</a> &amp;a, const char *b_ptr, size_t b_len) const</td></tr>
97 <tr class="memdesc:a2d61e659ded795c9f9b58eb317264db3 inherit pub_methods_classXapian_1_1LatLongMetric"><td class="mdescLeft">&#160;</td><td class="mdescRight">Return the distance between two coordinate lists, in metres. <br /></td></tr>
98 </table>
99 <a name="details" id="details"></a><h2 id="header-details" class="groupheader">Detailed Description</h2>
100 <div class="textblock"><p>Calculate the great-circle distance between two coordinates on a sphere. </p>
101 <p>Experimental - see <a href="https://xapian.org/docs/deprecation#experimental-features">https://xapian.org/docs/deprecation#experimental-features</a></p>
102 <p>This uses the haversine formula to calculate the distance. Note that this formula is subject to inaccuracy due to numerical errors for coordinates on the opposite side of the sphere.</p>
103 <p>See <a href="https://en.wikipedia.org/wiki/Haversine_formula">https://en.wikipedia.org/wiki/Haversine_formula</a> </p>
104 </div><a name="doc-constructors" id="doc-constructors"></a><h2 id="header-doc-constructors" class="groupheader">Constructor &amp; Destructor Documentation</h2>
105 <a id="a370614b3184b248cef3466360a306f04" name="a370614b3184b248cef3466360a306f04"></a>
106 <h2 class="memtitle"><span class="permalink"><a href="#a370614b3184b248cef3466360a306f04">&#9670;&#160;</a></span>GreatCircleMetric() <span class="overload">[1/2]</span></h2>
107
108 <div class="memitem">
109 <div class="memproto">
110 <table class="memname">
111 <tr>
112 <td class="memname">Xapian::GreatCircleMetric::GreatCircleMetric </td>
113 <td>(</td>
114 <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
115 <td></td>
116 </tr>
117 </table>
118 </div><div class="memdoc">
119
120 <p>Construct a <a class="el" href="classXapian_1_1GreatCircleMetric.html" title="Calculate the great-circle distance between two coordinates on a sphere.">GreatCircleMetric</a>. </p>
121 <p>The (quadratic mean) radius of the Earth will be used by this calculator. </p>
122
123 </div>
124 </div>
125 <a id="ad1503db5015359efd5045947d249773a" name="ad1503db5015359efd5045947d249773a"></a>
126 <h2 class="memtitle"><span class="permalink"><a href="#ad1503db5015359efd5045947d249773a">&#9670;&#160;</a></span>GreatCircleMetric() <span class="overload">[2/2]</span></h2>
127
128 <div class="memitem">
129 <div class="memproto">
130 <table class="mlabels">
131 <tr>
132 <td class="mlabels-left">
133 <table class="memname">
134 <tr>
135 <td class="memname">Xapian::GreatCircleMetric::GreatCircleMetric </td>
136 <td>(</td>
137 <td class="paramtype">double</td> <td class="paramname"><span class="paramname"><em>radius_</em></span></td><td>)</td>
138 <td></td>
139 </tr>
140 </table>
141 </td>
142 <td class="mlabels-right">
143 <span class="mlabels"><span class="mlabel explicit">explicit</span></span> </td>
144 </tr>
145 </table>
146 </div><div class="memdoc">
147
148 <p>Construct a <a class="el" href="classXapian_1_1GreatCircleMetric.html" title="Calculate the great-circle distance between two coordinates on a sphere.">GreatCircleMetric</a> using a specified radius. </p>
149 <p>This is useful for data sets in which the points are not on Earth (eg, a database of features on Mars).</p>
150 <dl class="params"><dt>Parameters</dt><dd>
151 <table class="params">
152 <tr><td class="paramname">radius_</td><td>The radius of the sphere to use, in metres. </td></tr>
153 </table>
154 </dd>
155 </dl>
156
157 </div>
158 </div>
159 <a name="doc-func-members" id="doc-func-members"></a><h2 id="header-doc-func-members" class="groupheader">Member Function Documentation</h2>
160 <a id="a3a9a960564bccae8c449a06691feed9e" name="a3a9a960564bccae8c449a06691feed9e"></a>
161 <h2 class="memtitle"><span class="permalink"><a href="#a3a9a960564bccae8c449a06691feed9e">&#9670;&#160;</a></span>clone()</h2>
162
163 <div class="memitem">
164 <div class="memproto">
165 <table class="mlabels">
166 <tr>
167 <td class="mlabels-left">
168 <table class="memname">
169 <tr>
170 <td class="memname"><a class="el" href="classXapian_1_1LatLongMetric.html">LatLongMetric</a> * Xapian::GreatCircleMetric::clone </td>
171 <td>(</td>
172 <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
173 <td> const</td>
174 </tr>
175 </table>
176 </td>
177 <td class="mlabels-right">
178 <span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
179 </tr>
180 </table>
181 </div><div class="memdoc">
182
183 <p>Clone the metric. </p>
184
185 <p>Implements <a class="el" href="classXapian_1_1LatLongMetric.html#afaa1bd4b60c13a1331924cf72381afa0">Xapian::LatLongMetric</a>.</p>
186
187 </div>
188 </div>
189 <a id="ae714ff4dc3aa8cb176007f6696b6cba4" name="ae714ff4dc3aa8cb176007f6696b6cba4"></a>
190 <h2 class="memtitle"><span class="permalink"><a href="#ae714ff4dc3aa8cb176007f6696b6cba4">&#9670;&#160;</a></span>name()</h2>
191
192 <div class="memitem">
193 <div class="memproto">
194 <table class="mlabels">
195 <tr>
196 <td class="mlabels-left">
197 <table class="memname">
198 <tr>
199 <td class="memname">std::string Xapian::GreatCircleMetric::name </td>
200 <td>(</td>
201 <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
202 <td> const</td>
203 </tr>
204 </table>
205 </td>
206 <td class="mlabels-right">
207 <span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
208 </tr>
209 </table>
210 </div><div class="memdoc">
211
212 <p>Return the full name of the metric. </p>
213 <p>This is used when serialising and unserialising metrics; for example, for performing remote searches.</p>
214 <p>If the subclass is in a C++ namespace, the namespace should be included in the name, using "::" as a separator. For example, for a <a class="el" href="classXapian_1_1LatLongMetric.html" title="Base class for calculating distances between two lat/long coordinates.">LatLongMetric</a> subclass called "FooLatLongMetric" in the "Xapian" namespace the result of this call should be "Xapian::FooLatLongMetric". </p>
215
216 <p>Implements <a class="el" href="classXapian_1_1LatLongMetric.html#aea76cb50cc44dea3aa24833576bdaa9e">Xapian::LatLongMetric</a>.</p>
217
218 </div>
219 </div>
220 <a id="afc3ebef50fda81a5fc70bf666098bbb5" name="afc3ebef50fda81a5fc70bf666098bbb5"></a>
221 <h2 class="memtitle"><span class="permalink"><a href="#afc3ebef50fda81a5fc70bf666098bbb5">&#9670;&#160;</a></span>pointwise_distance()</h2>
222
223 <div class="memitem">
224 <div class="memproto">
225 <table class="mlabels">
226 <tr>
227 <td class="mlabels-left">
228 <table class="memname">
229 <tr>
230 <td class="memname">double Xapian::GreatCircleMetric::pointwise_distance </td>
231 <td>(</td>
232 <td class="paramtype">const <a class="el" href="structXapian_1_1LatLongCoord.html">LatLongCoord</a> &amp;</td> <td class="paramname"><span class="paramname"><em>a</em></span>, </td>
233 </tr>
234 <tr>
235 <td class="paramkey"></td>
236 <td></td>
237 <td class="paramtype">const <a class="el" href="structXapian_1_1LatLongCoord.html">LatLongCoord</a> &amp;</td> <td class="paramname"><span class="paramname"><em>b</em></span>&#160;) const</td>
238 </tr>
239 </table>
240 </td>
241 <td class="mlabels-right">
242 <span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
243 </tr>
244 </table>
245 </div><div class="memdoc">
246
247 <p>Return the great-circle distance between points on the sphere. </p>
248
249 <p>Implements <a class="el" href="classXapian_1_1LatLongMetric.html#a86f171d4bac6e0ceaed163f72b91ec09">Xapian::LatLongMetric</a>.</p>
250
251 </div>
252 </div>
253 <a id="a2c59f816fdee553ee213693cd037657a" name="a2c59f816fdee553ee213693cd037657a"></a>
254 <h2 class="memtitle"><span class="permalink"><a href="#a2c59f816fdee553ee213693cd037657a">&#9670;&#160;</a></span>serialise()</h2>
255
256 <div class="memitem">
257 <div class="memproto">
258 <table class="mlabels">
259 <tr>
260 <td class="mlabels-left">
261 <table class="memname">
262 <tr>
263 <td class="memname">std::string Xapian::GreatCircleMetric::serialise </td>
264 <td>(</td>
265 <td class="paramname"><span class="paramname"><em></em></span></td><td>)</td>
266 <td> const</td>
267 </tr>
268 </table>
269 </td>
270 <td class="mlabels-right">
271 <span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
272 </tr>
273 </table>
274 </div><div class="memdoc">
275
276 <p>Serialise object parameters into a string. </p>
277 <p>The serialised parameters should represent the configuration of the metric. </p>
278
279 <p>Implements <a class="el" href="classXapian_1_1LatLongMetric.html#ac1d46b882a7878228ffd6e0f574f3ad5">Xapian::LatLongMetric</a>.</p>
280
281 </div>
282 </div>
283 <a id="ad5d72e63be8e63f83d2d089335810d68" name="ad5d72e63be8e63f83d2d089335810d68"></a>
284 <h2 class="memtitle"><span class="permalink"><a href="#ad5d72e63be8e63f83d2d089335810d68">&#9670;&#160;</a></span>unserialise()</h2>
285
286 <div class="memitem">
287 <div class="memproto">
288 <table class="mlabels">
289 <tr>
290 <td class="mlabels-left">
291 <table class="memname">
292 <tr>
293 <td class="memname"><a class="el" href="classXapian_1_1LatLongMetric.html">LatLongMetric</a> * Xapian::GreatCircleMetric::unserialise </td>
294 <td>(</td>
295 <td class="paramtype">const std::string &amp;</td> <td class="paramname"><span class="paramname"><em>serialised</em></span></td><td>)</td>
296 <td> const</td>
297 </tr>
298 </table>
299 </td>
300 <td class="mlabels-right">
301 <span class="mlabels"><span class="mlabel virtual">virtual</span></span> </td>
302 </tr>
303 </table>
304 </div><div class="memdoc">
305
306 <p>Create object given string serialisation returned by <a class="el" href="#a2c59f816fdee553ee213693cd037657a" title="Serialise object parameters into a string.">serialise()</a>. </p>
307 <dl class="params"><dt>Parameters</dt><dd>
308 <table class="params">
309 <tr><td class="paramname">serialised</td><td>A serialised instance of this <a class="el" href="classXapian_1_1LatLongMetric.html" title="Base class for calculating distances between two lat/long coordinates.">LatLongMetric</a> subclass. </td></tr>
310 </table>
311 </dd>
312 </dl>
313
314 <p>Implements <a class="el" href="classXapian_1_1LatLongMetric.html#ad7174d85406e1e6a8164cd39262390b8">Xapian::LatLongMetric</a>.</p>
315
316 </div>
317 </div>
318 <hr/>The documentation for this class was generated from the following file:<ul>
319 <li>xapian/<a class="el" href="geospatial_8h.html">geospatial.h</a></li>
320 </ul>
321 </div><!-- contents -->
322 <!-- start footer part -->
323 <hr class="footer"/><address class="footer"><small>
324 Generated by <a href="https://www.doxygen.org/">Doxygen 1.15.0</a>
325 </small></address>
326 </body>
327 </html>