This file is indexed.

/usr/share/doc/geographiclib/html/nearest.html is in geographiclib-doc 1.49-2.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!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.13"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>GeographicLib: Finding nearest neighbors</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>
<script type="text/x-mathjax-config">
  MathJax.Hub.Config({
    extensions: ["tex2jax.js"],
    jax: ["input/TeX","output/HTML-CSS"],
});
</script><script type="text/javascript" src="/usr/share/javascript/mathjax/MathJax.js/MathJax.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">GeographicLib
   &#160;<span id="projectnumber">1.49</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.13 -->
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
$(function() {
  initMenu('',false,false,'search.php','Search');
});
</script>
<div id="main-nav"></div>
</div><!-- top -->
<div class="header">
  <div class="headertitle">
<div class="title">Finding nearest neighbors </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><center> Back to <a class="el" href="geodesic.html">Geodesics on an ellipsoid of revolution</a>. Forward to <a class="el" href="triaxial.html">Geodesics on a triaxial ellipsoid</a>. Up to <a class="el" href="index.html#contents">Contents</a>. </center><p>The problem of finding the maritime boundary defined by the "median
line" is discussed in Section 14 of</p><ul>
<li>C. F. F. Karney, <a href="https://arxiv.org/abs/1102.1215v1">Geodesics on an ellipsoid of revolution</a>, Feb. 2011; preprint <a href="https://arxiv.org/abs/1102.1215v1">arxiv:1102.1215v1</a>.</li>
</ul>
<p>Figure 14 shows the median line which is equidistant from Britain and mainland Europe. Determining the median line involves finding, for any given <em>P</em>, the closest points on the coast of Britain and on the coast of mainland Europe. The operation of finding the closest in a set of points is usually referred to as the <em>nearest neighbor</em> problem and the <a class="el" href="classGeographicLib_1_1NearestNeighbor.html" title="Nearest-neighbor calculations. ">NearestNeighbor</a> class implements an efficient algorithm for solving it.</p>
<p>The <a class="el" href="classGeographicLib_1_1NearestNeighbor.html" title="Nearest-neighbor calculations. ">NearestNeighbor</a> class implements nearest-neighbor calculations using the vantage-point tree described by</p><ul>
<li>J. K. Uhlmann, <a href="https://doi.org/10.1016/0020-0190(91)90074-r">Satisfying general proximity/similarity queries with metric trees</a>, Information Processing Letters 40 175&ndash;179 (1991).</li>
<li>P. N. Yianilos, <a href="http://pnylab.com/pny/papers/vptree/vptree/">Data structures and algorithms for nearest neighbor search in general metric spaces</a>, Proc. 4th ACM-SIAM Symposium on Discrete Algorithms, (SIAM, 1993). pp. 311&ndash;321.</li>
</ul>
<p>Given a set of points <em>x</em>, <em>y</em>, <em>z</em>, &hellip;, in some space and a distance function <em>d</em> satisfying the metric conditions, </p><p class="formulaDsp">
\[ \begin{align} d(x,y) &amp;\ge 0,\\ d(x,y) &amp;= 0, \ \text{iff $x = y$},\\ d(x,y) &amp;= d(y,x),\\ d(x,z) &amp;\le d(x,y) + d(y,z), \end{align} \]
</p>
<p> the vantage-point (VP) tree provides an efficient way of determining nearest neighbors. The geodesic distance (implemented by the <a class="el" href="classGeographicLib_1_1Geodesic.html" title="Geodesic calculations ">Geodesic</a> class) satisfies these metric conditions, while the great ellipse distance and the rhumb line distance <em>do not</em> (they do not satisfy the last condition, the triangle inequality). Typically the cost of constructing a VP tree of <em>N</em> points is <em>N</em> log <em>N</em>, while the cost of a query is log <em>N</em>. Thus a VP tree should be used in situations where <em>N</em> is large and at least log <em>N</em> queries are to be made. The condition, <em>N</em> is large, means that \( N \gg 2^D \), where <em>D</em> is the dimensionality of the space.</p>
<ul>
<li>This implementation includes Yianilos' upper and lower bounds for the inside and outside sets. This helps limit the number of searches (compared to just using the median distance).</li>
<li>Rather than do a depth-first or breath-first search on the tree, the nodes to be processed are put on a priority queue with the nodes most likely to contain close points processed first. Frequently, this allows nodes lower down on the priority queue to be skipped.</li>
<li>This technique also allows non-exhaustive searchs to be performed (to answer questions such as "are there any points within 1km of the query point?).</li>
<li>When building the tree, the first vantage point is (arbitrarily) chosen as the middle element of the set. Thereafter, the points furthest from the parent vantage point in both the inside and outside sets are selected as the children's vantage points. This information is already available from the computation of the upper and lower bounds of the children. This choice seems to lead to a reasonably optimized tree.</li>
<li>The leaf nodes can contain a bucket of points (instead of just a vantage point).</li>
<li>Coincident points are allowed in the set; these are treated as distinct points.</li>
</ul>
<p>The figure below shows the construction of the VP tree for the points making up the coastlines of Britain and Ireland (about 5000 points shown in blue). The set of points is recursively split into 2 equal "inside" and "outside" subsets based on the distance from a "vantage point". The boundaries between the inside and outside sets are shown as green circular arcs (arcs of geodesic circles). At each stage, the newly added vantage points are shown as red dots and the vantage points for the next stage are shown as red plus signs. The data is shown in the Cassini-Soldner projection with a central meridian of 5&deg;W.</p>
<div class="image">
<img src="vptree.gif" alt="vptree.gif"/>
<div class="caption">
Vantage-point tree</div></div>
 <center> Back to <a class="el" href="geodesic.html">Geodesics on an ellipsoid of revolution</a>. Forward to <a class="el" href="triaxial.html">Geodesics on a triaxial ellipsoid</a>. Up to <a class="el" href="index.html#contents">Contents</a>. </center> </div></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.13
</small></address>
</body>
</html>