| 1 |
|
| 2 |
<!DOCTYPE html> |
| 3 |
|
| 4 |
|
| 5 |
<html lang="en" data-content_root="../../" > |
| 6 |
|
| 7 |
<head> |
| 8 |
<meta charset="utf-8" /> |
| 9 |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="viewport" content="width=device-width, initial-scale=1" /> |
| 10 |
|
| 11 |
<title>7.16.6. geo_distance — Groonga v16.0.9 documentation</title> |
| 12 |
|
| 13 |
|
| 14 |
|
| 15 |
<script data-cfasync="false"> |
| 16 |
document.documentElement.dataset.mode = localStorage.getItem("mode") || ""; |
| 17 |
document.documentElement.dataset.theme = localStorage.getItem("theme") || ""; |
| 18 |
</script> |
| 19 |
|
| 20 |
|
| 21 |
|
| 22 |
<noscript> |
| 23 |
<style> |
| 24 |
.pst-js-only { display: none !important; } |
| 25 |
|
| 26 |
</style> |
| 27 |
</noscript> |
| 28 |
|
| 29 |
|
| 30 |
<link href="../../_static/styles/theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" /> |
| 31 |
<link href="../../_static/styles/pydata-sphinx-theme.css?digest=90905a2f556bf617f1a9" rel="stylesheet" /> |
| 32 |
|
| 33 |
<link rel="stylesheet" type="text/css" href="../../_static/pygments.css?v=8f2a1f02" /> |
| 34 |
|
| 35 |
|
| 36 |
<script defer src="../../_static/scripts/fontawesome.js?digest=90905a2f556bf617f1a9"></script> |
| 37 |
|
| 38 |
<link rel="preload" as="script" href="../../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9" /> |
| 39 |
<link rel="preload" as="script" href="../../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9" /> |
| 40 |
|
| 41 |
<script src="../../_static/documentation_options.js?v=2fcb8d4f"></script> |
| 42 |
<script src="../../_static/doctools.js?v=fd6eb6e6"></script> |
| 43 |
<script src="../../_static/sphinx_highlight.js?v=6ffebe34"></script> |
| 44 |
<script> |
| 45 |
window.dataLayer = window.dataLayer || []; |
| 46 |
function gtag(){ dataLayer.push(arguments); } |
| 47 |
gtag('consent', 'default', { |
| 48 |
'ad_storage': 'denied', |
| 49 |
'ad_user_data': 'denied', |
| 50 |
'ad_personalization': 'denied', |
| 51 |
'analytics_storage': 'denied' |
| 52 |
}); |
| 53 |
</script> |
| 54 |
<script async="async" src="https://www.googletagmanager.com/gtag/js?id=G-MDK38RHNPW"></script> |
| 55 |
<script> |
| 56 |
window.dataLayer = window.dataLayer || []; |
| 57 |
function gtag(){dataLayer.push(arguments);} |
| 58 |
gtag('js', new Date()); |
| 59 |
gtag('config', 'G-MDK38RHNPW'); |
| 60 |
</script> |
| 61 |
<script>DOCUMENTATION_OPTIONS.pagename = 'reference/functions/geo_distance';</script> |
| 62 |
<script> |
| 63 |
DOCUMENTATION_OPTIONS.theme_version = '0.20.0'; |
| 64 |
DOCUMENTATION_OPTIONS.theme_switcher_json_url = 'https://groonga.org/docs/_static/switcher.json'; |
| 65 |
DOCUMENTATION_OPTIONS.theme_switcher_version_match = 'english'; |
| 66 |
DOCUMENTATION_OPTIONS.show_version_warning_banner = |
| 67 |
false; |
| 68 |
</script> |
| 69 |
<script>DOCUMENTATION_OPTIONS.search_as_you_type = false;</script> |
| 70 |
<link rel="icon" href="../../_static/favicon.ico"/> |
| 71 |
<link rel="index" title="Index" href="../../genindex.html" /> |
| 72 |
<link rel="search" title="Search" href="../../search.html" /> |
| 73 |
<link rel="next" title="7.16.7. geo_in_circle" href="geo_in_circle.html" /> |
| 74 |
<link rel="prev" title="7.16.5. fuzzy_search" href="fuzzy_search.html" /> |
| 75 |
<meta name="viewport" content="width=device-width, initial-scale=1"/> |
| 76 |
<meta name="docsearch:language" content="en"/> |
| 77 |
<meta name="docsearch:version" content="16.0.9" /> |
| 78 |
|
| 79 |
|
| 80 |
<script src="../../_static/searchtools.js"></script> |
| 81 |
<script src="../../_static/language_data.js"></script> |
| 82 |
<script src="../../searchindex.js"></script> |
| 83 |
|
| 84 |
</head> |
| 85 |
<body data-default-mode=""> |
| 86 |
|
| 87 |
|
| 88 |
<div id="pst-skip-link" class="skip-link d-print-none"><a href="#main-content">Skip to main content</a></div> |
| 89 |
|
| 90 |
|
| 91 |
<div id="pst-scroll-pixel-helper"></div> |
| 92 |
|
| 93 |
<button type="button" class="btn rounded-pill" id="pst-back-to-top"> |
| 94 |
<i class="fa-solid fa-arrow-up"></i>Back to top</button> |
| 95 |
|
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
<dialog id="pst-search-dialog"> |
| 100 |
|
| 101 |
<form class="bd-search d-flex align-items-center" |
| 102 |
action="../../search.html" |
| 103 |
method="get"> |
| 104 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 105 |
<input type="search" |
| 106 |
class="form-control" |
| 107 |
name="q" |
| 108 |
placeholder="Search the docs ..." |
| 109 |
aria-label="Search the docs ..." |
| 110 |
autocomplete="off" |
| 111 |
autocorrect="off" |
| 112 |
autocapitalize="off" |
| 113 |
spellcheck="false"/> |
| 114 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd>K</kbd></span> |
| 115 |
</form> |
| 116 |
</dialog> |
| 117 |
|
| 118 |
<div class="pst-async-banner-revealer d-none"> |
| 119 |
<aside id="bd-header-version-warning" class="d-none d-print-none" aria-label="Version warning"></aside> |
| 120 |
</div> |
| 121 |
|
| 122 |
|
| 123 |
<header id="pst-header" class="bd-header navbar navbar-expand-lg bd-navbar d-print-none"> |
| 124 |
<div class="bd-header__inner bd-page-width"> |
| 125 |
<button class="pst-navbar-icon sidebar-toggle primary-toggle" aria-label="Site navigation"> |
| 126 |
<span class="fa-solid fa-bars"></span> |
| 127 |
</button> |
| 128 |
|
| 129 |
|
| 130 |
<div class="col-lg-3 navbar-header-items__start"> |
| 131 |
|
| 132 |
<div class="navbar-item"> |
| 133 |
|
| 134 |
|
| 135 |
|
| 136 |
|
| 137 |
|
| 138 |
<a class="navbar-brand logo" href="https://groonga.org/"> |
| 139 |
|
| 140 |
|
| 141 |
|
| 142 |
|
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
|
| 148 |
|
| 149 |
<img src="../../_static/groonga.png" class="logo__image only-light" alt="Groonga v16.0.9 documentation - Home"/> |
| 150 |
<img src="../../_static/groonga.png" class="logo__image only-dark pst-js-only" alt="Groonga v16.0.9 documentation - Home"/> |
| 151 |
|
| 152 |
|
| 153 |
</a></div> |
| 154 |
|
| 155 |
</div> |
| 156 |
|
| 157 |
<div class="col-lg-9 navbar-header-items"> |
| 158 |
|
| 159 |
|
| 160 |
<div class="navbar-header-items__end"> |
| 161 |
|
| 162 |
<div class="navbar-item navbar-persistent--container"> |
| 163 |
|
| 164 |
|
| 165 |
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip"> |
| 166 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 167 |
<span class="search-button__default-text">Search</span> |
| 168 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span> |
| 169 |
</button> |
| 170 |
</div> |
| 171 |
|
| 172 |
|
| 173 |
<div class="navbar-item"> |
| 174 |
|
| 175 |
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode"> |
| 176 |
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown"> |
| 177 |
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i> |
| 178 |
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i> |
| 179 |
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i> |
| 180 |
</button> |
| 181 |
<ul class="dropdown-menu dropdown-menu-end"> |
| 182 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li> |
| 183 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li> |
| 184 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li> |
| 185 |
</ul> |
| 186 |
</div></div> |
| 187 |
|
| 188 |
<div class="navbar-item"><ul class="navbar-icon-links" |
| 189 |
aria-label="Icon Links"> |
| 190 |
<li class="nav-item"> |
| 191 |
|
| 192 |
|
| 193 |
|
| 194 |
|
| 195 |
|
| 196 |
|
| 197 |
|
| 198 |
|
| 199 |
<a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a> |
| 200 |
</li> |
| 201 |
<li class="nav-item"> |
| 202 |
|
| 203 |
|
| 204 |
|
| 205 |
|
| 206 |
|
| 207 |
|
| 208 |
|
| 209 |
|
| 210 |
<a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a> |
| 211 |
</li> |
| 212 |
<li class="nav-item"> |
| 213 |
|
| 214 |
|
| 215 |
|
| 216 |
|
| 217 |
|
| 218 |
|
| 219 |
|
| 220 |
|
| 221 |
<a href="/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a> |
| 222 |
</li> |
| 223 |
</ul></div> |
| 224 |
|
| 225 |
<div class="navbar-item"> |
| 226 |
<div class="version-switcher__container dropdown pst-js-only"> |
| 227 |
<button id="pst-version-switcher-button-2" |
| 228 |
type="button" |
| 229 |
class="version-switcher__button btn btn-sm dropdown-toggle" |
| 230 |
data-bs-toggle="dropdown" |
| 231 |
aria-haspopup="listbox" |
| 232 |
aria-controls="pst-version-switcher-list-2" |
| 233 |
aria-label="Version switcher list" |
| 234 |
> |
| 235 |
Choose version |
| 236 |
<span class="caret"></span> |
| 237 |
</button> |
| 238 |
<div id="pst-version-switcher-list-2" |
| 239 |
class="version-switcher__menu dropdown-menu list-group-flush py-0" |
| 240 |
role="listbox" aria-labelledby="pst-version-switcher-button-2"> |
| 241 |
|
| 242 |
</div> |
| 243 |
</div></div> |
| 244 |
|
| 245 |
</div> |
| 246 |
|
| 247 |
</div> |
| 248 |
|
| 249 |
|
| 250 |
<div class="navbar-persistent--mobile"> |
| 251 |
|
| 252 |
<button class="btn search-button-field search-button__button pst-js-only" title="Search" aria-label="Search" data-bs-placement="bottom" data-bs-toggle="tooltip"> |
| 253 |
<i class="fa-solid fa-magnifying-glass"></i> |
| 254 |
<span class="search-button__default-text">Search</span> |
| 255 |
<span class="search-button__kbd-shortcut"><kbd class="kbd-shortcut__modifier">Ctrl</kbd>+<kbd class="kbd-shortcut__modifier">K</kbd></span> |
| 256 |
</button> |
| 257 |
</div> |
| 258 |
|
| 259 |
|
| 260 |
|
| 261 |
<button class="pst-navbar-icon sidebar-toggle secondary-toggle" aria-label="On this page"> |
| 262 |
<span class="fa-solid fa-outdent"></span> |
| 263 |
</button> |
| 264 |
|
| 265 |
</div> |
| 266 |
|
| 267 |
</header> |
| 268 |
|
| 269 |
|
| 270 |
<div class="bd-container"> |
| 271 |
<div class="bd-container__inner bd-page-width"> |
| 272 |
|
| 273 |
|
| 274 |
|
| 275 |
<dialog id="pst-primary-sidebar-modal"></dialog> |
| 276 |
<div id="pst-primary-sidebar" class="bd-sidebar-primary bd-sidebar"> |
| 277 |
|
| 278 |
|
| 279 |
|
| 280 |
<div class="sidebar-header-items sidebar-primary__section"> |
| 281 |
|
| 282 |
|
| 283 |
|
| 284 |
|
| 285 |
<div class="sidebar-header-items__end"> |
| 286 |
|
| 287 |
<div class="navbar-item"> |
| 288 |
|
| 289 |
<div class="theme-switch-container dropdown pst-js-only" data-bs-toggle="tooltip" data-bs-placement="bottom" title="Color mode"> |
| 290 |
<button class="btn btn-sm nav-link pst-navbar-icon theme-switch-button dropdown-toggle" aria-label="Color mode" data-bs-toggle="dropdown"> |
| 291 |
<i class="theme-switch fa-solid fa-sun fa-lg fa-fw" data-mode="light" title="Light"></i> |
| 292 |
<i class="theme-switch fa-solid fa-moon fa-lg fa-fw" data-mode="dark" title="Dark"></i> |
| 293 |
<i class="theme-switch fa-solid fa-circle-half-stroke fa-lg fa-fw" data-mode="auto" title="System Settings"></i> |
| 294 |
</button> |
| 295 |
<ul class="dropdown-menu dropdown-menu-end"> |
| 296 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="auto"><i class="fa-solid fa-circle-half-stroke fa-lg fa-fw me-1"></i>System Settings</button></li> |
| 297 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="light"><i class="fa-solid fa-sun fa-lg fa-fw me-1"></i>Light</button></li> |
| 298 |
<li><button class="dropdown-item d-flex align-items-center theme-change-button" data-mode="dark"><i class="fa-solid fa-moon fa-lg fa-fw me-1"></i>Dark</button></li> |
| 299 |
</ul> |
| 300 |
</div></div> |
| 301 |
|
| 302 |
<div class="navbar-item"><ul class="navbar-icon-links" |
| 303 |
aria-label="Icon Links"> |
| 304 |
<li class="nav-item"> |
| 305 |
|
| 306 |
|
| 307 |
|
| 308 |
|
| 309 |
|
| 310 |
|
| 311 |
|
| 312 |
|
| 313 |
<a href="https://github.com/groonga/groonga" title="GitHub" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-github fa-lg" aria-hidden="true"></i><span class="visually-hidden">GitHub</span></a> |
| 314 |
</li> |
| 315 |
<li class="nav-item"> |
| 316 |
|
| 317 |
|
| 318 |
|
| 319 |
|
| 320 |
|
| 321 |
|
| 322 |
|
| 323 |
|
| 324 |
<a href="https://twitter.com/groonga" title="Twitter" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fa-brands fa-square-twitter fa-lg" aria-hidden="true"></i><span class="visually-hidden">Twitter</span></a> |
| 325 |
</li> |
| 326 |
<li class="nav-item"> |
| 327 |
|
| 328 |
|
| 329 |
|
| 330 |
|
| 331 |
|
| 332 |
|
| 333 |
|
| 334 |
|
| 335 |
<a href="/blog" title="Blog" class="nav-link pst-navbar-icon" rel="noopener" target="_blank" data-bs-toggle="tooltip" data-bs-placement="bottom"><i class="fas fa-blog fa-lg" aria-hidden="true"></i><span class="visually-hidden">Blog</span></a> |
| 336 |
</li> |
| 337 |
</ul></div> |
| 338 |
|
| 339 |
<div class="navbar-item"> |
| 340 |
<div class="version-switcher__container dropdown pst-js-only"> |
| 341 |
<button id="pst-version-switcher-button-3" |
| 342 |
type="button" |
| 343 |
class="version-switcher__button btn btn-sm dropdown-toggle" |
| 344 |
data-bs-toggle="dropdown" |
| 345 |
aria-haspopup="listbox" |
| 346 |
aria-controls="pst-version-switcher-list-3" |
| 347 |
aria-label="Version switcher list" |
| 348 |
> |
| 349 |
Choose version |
| 350 |
<span class="caret"></span> |
| 351 |
</button> |
| 352 |
<div id="pst-version-switcher-list-3" |
| 353 |
class="version-switcher__menu dropdown-menu list-group-flush py-0" |
| 354 |
role="listbox" aria-labelledby="pst-version-switcher-button-3"> |
| 355 |
|
| 356 |
</div> |
| 357 |
</div></div> |
| 358 |
|
| 359 |
</div> |
| 360 |
|
| 361 |
</div> |
| 362 |
|
| 363 |
<div class="sidebar-primary-items__start sidebar-primary__section"> |
| 364 |
<div class="sidebar-primary-item pst-sidebar-collapse"><button id="pst-collapse-sidebar-button" aria-expanded="true" aria-controls="pst-primary-sidebar"> |
| 365 |
<svg class="pst-icon" role="img" aria-hidden="true" focusable="false" viewBox="0 0 16 16" xmlns="http://www.w3.org/2000/svg"> |
| 366 |
<path fill="currentColor" d="M3 15.5C2.36232 15.5 1.74874 15.2564 1.28478 14.8189C0.820828 14.3815 0.541576 13.7832 0.504167 13.1467L0.5 13L0.5 3C0.499965 2.36232 0.743605 1.74874 1.18107 1.28478C1.61854 0.820828 2.21676 0.541576 2.85333 0.504167L3 0.5L13 0.5C13.6377 0.499965 14.2513 0.743605 14.7152 1.18107C15.1792 1.61854 15.4584 2.21676 15.4958 2.85333L15.5 3L15.5 13C15.5 13.6377 15.2564 14.2513 14.8189 14.7152C14.3815 15.1792 13.7832 15.4584 13.1467 15.4958L13 15.5L3 15.5ZM3 13.8333L10.5 13.8333L10.5 2.16667L3 2.16667C2.79589 2.16669 2.59889 2.24163 2.44636 2.37726C2.29383 2.5129 2.19638 2.69979 2.1725 2.9025L2.16667 3L2.16667 13C2.16669 13.2041 2.24163 13.4011 2.37726 13.5536C2.5129 13.7062 2.69979 13.8036 2.9025 13.8275L3 13.8333ZM6.65583 10.325L6.5775 10.2558L4.91083 8.58917C4.76735 8.44567 4.68116 8.25476 4.66843 8.05223C4.65569 7.84971 4.71729 7.6495 4.84167 7.48917L4.91083 7.41083L6.5775 5.74417C6.72747 5.59471 6.9287 5.50794 7.14032 5.50148C7.35194 5.49502 7.55809 5.56935 7.7169 5.70937C7.8757 5.8494 7.97525 6.04463 7.99533 6.25539C8.01541 6.46616 7.95451 6.67667 7.825 6.84417L7.75583 6.9225L6.67917 8L7.75583 9.0775C7.89931 9.22099 7.98551 9.41191 7.99824 9.61443C8.01097 9.81695 7.94938 10.0172 7.825 10.1775L7.75583 10.2558C7.61234 10.3993 7.42142 10.4855 7.2189 10.4982C7.01638 10.511 6.81617 10.4494 6.65583 10.325Z"/> |
| 367 |
</svg> |
| 368 |
<span class="pst-collapse-sidebar-label">Collapse Sidebar</span> |
| 369 |
<span class="pst-expand-sidebar-label">Expand Sidebar</span> |
| 370 |
</button></div> |
| 371 |
<div class="sidebar-primary-item"> |
| 372 |
|
| 373 |
<nav class="bd-docs-nav bd-links" |
| 374 |
aria-label="Section Navigation"> |
| 375 |
<p class="bd-links__title" role="heading" aria-level="1">Section Navigation</p> |
| 376 |
<div class="bd-toc-item navbar-nav"><ul class="current nav bd-sidenav"> |
| 377 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../executables.html">7.1. Executables</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 378 |
<li class="toctree-l2"><a class="reference internal" href="../executables/grndb.html">7.1.1. <code class="docutils literal notranslate"><span class="pre">grndb</span></code></a></li> |
| 379 |
<li class="toctree-l2"><a class="reference internal" href="../executables/grnslap.html">7.1.2. grnslap</a></li> |
| 380 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga.html">7.1.3. <code class="docutils literal notranslate"><span class="pre">groonga</span></code> executable file</a></li> |
| 381 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-benchmark.html">7.1.4. groonga-benchmark</a></li> |
| 382 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-httpd.html">7.1.5. groonga-httpd</a></li> |
| 383 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-server-http.html">7.1.6. Groonga HTTP server</a></li> |
| 384 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-suggest-create-dataset.html">7.1.7. groonga-suggest-create-dataset</a></li> |
| 385 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-suggest-httpd.html">7.1.8. <code class="docutils literal notranslate"><span class="pre">groonga-suggest-httpd</span></code></a></li> |
| 386 |
<li class="toctree-l2"><a class="reference internal" href="../executables/groonga-suggest-learner.html">7.1.9. groonga-suggest-learner</a></li> |
| 387 |
</ul> |
| 388 |
</details></li> |
| 389 |
<li class="toctree-l1"><a class="reference internal" href="../output.html">7.2. Output</a></li> |
| 390 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../command.html">7.3. Command</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 391 |
<li class="toctree-l2"><a class="reference internal" href="../command/command_version.html">7.3.1. Command version</a></li> |
| 392 |
<li class="toctree-l2"><a class="reference internal" href="../command/n_workers.html">7.3.2. Parallel execution</a></li> |
| 393 |
<li class="toctree-l2"><a class="reference internal" href="../command/output_format.html">7.3.3. Output format</a></li> |
| 394 |
<li class="toctree-l2"><a class="reference internal" href="../command/output_trace_log.html">7.3.4. Output trace log</a></li> |
| 395 |
<li class="toctree-l2"><a class="reference internal" href="../command/pretty_print.html">7.3.5. Pretty print</a></li> |
| 396 |
<li class="toctree-l2"><a class="reference internal" href="../command/request_id.html">7.3.6. Request ID</a></li> |
| 397 |
<li class="toctree-l2"><a class="reference internal" href="../command/request_timeout.html">7.3.7. Request timeout</a></li> |
| 398 |
<li class="toctree-l2 has-children"><a class="reference internal" href="../command/return_code.html">7.3.8. Return code</a><details><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 399 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_operation_not_permitted.html">7.3.8.3.1. <code class="docutils literal notranslate"><span class="pre">-2:</span> <span class="pre">GRN_OPERATION_NOT_PERMITTED</span></code></a></li> |
| 400 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_no_such_file_or_directory.html">7.3.8.3.2. <code class="docutils literal notranslate"><span class="pre">-3:</span> <span class="pre">GRN_NO_SUCH_FILE_OR_DIRECTORY</span></code></a></li> |
| 401 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_input_output_error.html">7.3.8.3.3. <code class="docutils literal notranslate"><span class="pre">-6:</span> <span class="pre">GRN_INPUT_OUTPUT_ERROR</span></code></a></li> |
| 402 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_not_enough_space.html">7.3.8.3.4. <code class="docutils literal notranslate"><span class="pre">-13:</span> <span class="pre">GRN_NOT_ENOUGH_SPACE</span></code></a></li> |
| 403 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_invalid_argument.html">7.3.8.3.5. <code class="docutils literal notranslate"><span class="pre">-22:</span> <span class="pre">GRN_INVALID_ARGUMENT</span></code></a></li> |
| 404 |
<li class="toctree-l3"><a class="reference internal" href="../command/return_codes/grn_resource_deadlock_avoided.html">7.3.8.3.6. <code class="docutils literal notranslate"><span class="pre">-34:</span> <span class="pre">GRN_RESOURCE_DEADLOCK_AVOIDED</span></code></a></li> |
| 405 |
</ul> |
| 406 |
</details></li> |
| 407 |
<li class="toctree-l2"><a class="reference internal" href="../commands/cache_limit.html">7.3.9. <code class="docutils literal notranslate"><span class="pre">cache_limit</span></code></a></li> |
| 408 |
<li class="toctree-l2"><a class="reference internal" href="../commands/check.html">7.3.10. <code class="docutils literal notranslate"><span class="pre">check</span></code></a></li> |
| 409 |
<li class="toctree-l2"><a class="reference internal" href="../commands/clearlock.html">7.3.11. <code class="docutils literal notranslate"><span class="pre">clearlock</span></code></a></li> |
| 410 |
<li class="toctree-l2"><a class="reference internal" href="../commands/column_copy.html">7.3.12. <code class="docutils literal notranslate"><span class="pre">column_copy</span></code></a></li> |
| 411 |
<li class="toctree-l2"><a class="reference internal" href="../commands/column_create.html">7.3.13. <code class="docutils literal notranslate"><span class="pre">column_create</span></code></a></li> |
| 412 |
<li class="toctree-l2"><a class="reference internal" href="../commands/column_list.html">7.3.14. <code class="docutils literal notranslate"><span class="pre">column_list</span></code></a></li> |
| 413 |
<li class="toctree-l2"><a class="reference internal" href="../commands/column_remove.html">7.3.15. <code class="docutils literal notranslate"><span class="pre">column_remove</span></code></a></li> |
| 414 |
<li class="toctree-l2"><a class="reference internal" href="../commands/column_rename.html">7.3.16. <code class="docutils literal notranslate"><span class="pre">column_rename</span></code></a></li> |
| 415 |
<li class="toctree-l2"><a class="reference internal" href="../commands/config_delete.html">7.3.17. <code class="docutils literal notranslate"><span class="pre">config_delete</span></code></a></li> |
| 416 |
<li class="toctree-l2"><a class="reference internal" href="../commands/config_get.html">7.3.18. <code class="docutils literal notranslate"><span class="pre">config_get</span></code></a></li> |
| 417 |
<li class="toctree-l2"><a class="reference internal" href="../commands/config_set.html">7.3.19. <code class="docutils literal notranslate"><span class="pre">config_set</span></code></a></li> |
| 418 |
<li class="toctree-l2"><a class="reference internal" href="../commands/database_unmap.html">7.3.20. <code class="docutils literal notranslate"><span class="pre">database_unmap</span></code></a></li> |
| 419 |
<li class="toctree-l2"><a class="reference internal" href="../commands/define_selector.html">7.3.21. <code class="docutils literal notranslate"><span class="pre">define_selector</span></code></a></li> |
| 420 |
<li class="toctree-l2"><a class="reference internal" href="../commands/defrag.html">7.3.22. <code class="docutils literal notranslate"><span class="pre">defrag</span></code></a></li> |
| 421 |
<li class="toctree-l2"><a class="reference internal" href="../commands/delete.html">7.3.23. <code class="docutils literal notranslate"><span class="pre">delete</span></code></a></li> |
| 422 |
<li class="toctree-l2"><a class="reference internal" href="../commands/dump.html">7.3.24. <code class="docutils literal notranslate"><span class="pre">dump</span></code></a></li> |
| 423 |
<li class="toctree-l2"><a class="reference internal" href="../commands/extract.html">7.3.25. <code class="docutils literal notranslate"><span class="pre">extract</span></code></a></li> |
| 424 |
<li class="toctree-l2"><a class="reference internal" href="../commands/index_column_diff.html">7.3.26. <code class="docutils literal notranslate"><span class="pre">index_column_diff</span></code></a></li> |
| 425 |
<li class="toctree-l2"><a class="reference internal" href="../commands/io_flush.html">7.3.27. <code class="docutils literal notranslate"><span class="pre">io_flush</span></code></a></li> |
| 426 |
<li class="toctree-l2"><a class="reference internal" href="../commands/load.html">7.3.28. <code class="docutils literal notranslate"><span class="pre">load</span></code></a></li> |
| 427 |
<li class="toctree-l2"><a class="reference internal" href="../commands/lock_acquire.html">7.3.29. <code class="docutils literal notranslate"><span class="pre">lock_acquire</span></code></a></li> |
| 428 |
<li class="toctree-l2"><a class="reference internal" href="../commands/lock_clear.html">7.3.30. <code class="docutils literal notranslate"><span class="pre">lock_clear</span></code></a></li> |
| 429 |
<li class="toctree-l2"><a class="reference internal" href="../commands/lock_release.html">7.3.31. <code class="docutils literal notranslate"><span class="pre">lock_release</span></code></a></li> |
| 430 |
<li class="toctree-l2"><a class="reference internal" href="../commands/log_level.html">7.3.32. <code class="docutils literal notranslate"><span class="pre">log_level</span></code></a></li> |
| 431 |
<li class="toctree-l2"><a class="reference internal" href="../commands/log_put.html">7.3.33. <code class="docutils literal notranslate"><span class="pre">log_put</span></code></a></li> |
| 432 |
<li class="toctree-l2"><a class="reference internal" href="../commands/log_reopen.html">7.3.34. <code class="docutils literal notranslate"><span class="pre">log_reopen</span></code></a></li> |
| 433 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_count.html">7.3.35. <code class="docutils literal notranslate"><span class="pre">logical_count</span></code></a></li> |
| 434 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_parameters.html">7.3.36. <code class="docutils literal notranslate"><span class="pre">logical_parameters</span></code></a></li> |
| 435 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_range_filter.html">7.3.37. <code class="docutils literal notranslate"><span class="pre">logical_range_filter</span></code></a></li> |
| 436 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_select.html">7.3.38. <code class="docutils literal notranslate"><span class="pre">logical_select</span></code></a></li> |
| 437 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_shard_list.html">7.3.39. <code class="docutils literal notranslate"><span class="pre">logical_shard_list</span></code></a></li> |
| 438 |
<li class="toctree-l2"><a class="reference internal" href="../commands/logical_table_remove.html">7.3.40. <code class="docutils literal notranslate"><span class="pre">logical_table_remove</span></code></a></li> |
| 439 |
<li class="toctree-l2"><a class="reference internal" href="../commands/normalize.html">7.3.41. <code class="docutils literal notranslate"><span class="pre">normalize</span></code></a></li> |
| 440 |
<li class="toctree-l2"><a class="reference internal" href="../commands/normalizer_list.html">7.3.42. <code class="docutils literal notranslate"><span class="pre">normalizer_list</span></code></a></li> |
| 441 |
<li class="toctree-l2"><a class="reference internal" href="../commands/object_exist.html">7.3.43. <code class="docutils literal notranslate"><span class="pre">object_exist</span></code></a></li> |
| 442 |
<li class="toctree-l2"><a class="reference internal" href="../commands/object_inspect.html">7.3.44. <code class="docutils literal notranslate"><span class="pre">object_inspect</span></code></a></li> |
| 443 |
<li class="toctree-l2"><a class="reference internal" href="../commands/object_list.html">7.3.45. <code class="docutils literal notranslate"><span class="pre">object_list</span></code></a></li> |
| 444 |
<li class="toctree-l2"><a class="reference internal" href="../commands/object_remove.html">7.3.46. <code class="docutils literal notranslate"><span class="pre">object_remove</span></code></a></li> |
| 445 |
<li class="toctree-l2"><a class="reference internal" href="../commands/plugin_register.html">7.3.47. <code class="docutils literal notranslate"><span class="pre">plugin_register</span></code></a></li> |
| 446 |
<li class="toctree-l2"><a class="reference internal" href="../commands/plugin_unregister.html">7.3.48. <code class="docutils literal notranslate"><span class="pre">plugin_unregister</span></code></a></li> |
| 447 |
<li class="toctree-l2"><a class="reference internal" href="../commands/query_expand.html">7.3.49. <code class="docutils literal notranslate"><span class="pre">query_expand</span></code></a></li> |
| 448 |
<li class="toctree-l2"><a class="reference internal" href="../commands/quit.html">7.3.50. <code class="docutils literal notranslate"><span class="pre">quit</span></code></a></li> |
| 449 |
<li class="toctree-l2"><a class="reference internal" href="../commands/range_filter.html">7.3.51. <code class="docutils literal notranslate"><span class="pre">range_filter</span></code></a></li> |
| 450 |
<li class="toctree-l2"><a class="reference internal" href="../commands/reference_acquire.html">7.3.52. <code class="docutils literal notranslate"><span class="pre">reference_acquire</span></code></a></li> |
| 451 |
<li class="toctree-l2"><a class="reference internal" href="../commands/reference_release.html">7.3.53. <code class="docutils literal notranslate"><span class="pre">reference_release</span></code></a></li> |
| 452 |
<li class="toctree-l2"><a class="reference internal" href="../commands/register.html">7.3.54. <code class="docutils literal notranslate"><span class="pre">register</span></code></a></li> |
| 453 |
<li class="toctree-l2"><a class="reference internal" href="../commands/reindex.html">7.3.55. <code class="docutils literal notranslate"><span class="pre">reindex</span></code></a></li> |
| 454 |
<li class="toctree-l2"><a class="reference internal" href="../commands/request_cancel.html">7.3.56. <code class="docutils literal notranslate"><span class="pre">request_cancel</span></code></a></li> |
| 455 |
<li class="toctree-l2"><a class="reference internal" href="../commands/ruby_eval.html">7.3.57. <code class="docutils literal notranslate"><span class="pre">ruby_eval</span></code></a></li> |
| 456 |
<li class="toctree-l2"><a class="reference internal" href="../commands/schema.html">7.3.58. <code class="docutils literal notranslate"><span class="pre">schema</span></code></a></li> |
| 457 |
<li class="toctree-l2"><a class="reference internal" href="../commands/select.html">7.3.59. <code class="docutils literal notranslate"><span class="pre">select</span></code></a></li> |
| 458 |
<li class="toctree-l2"><a class="reference internal" href="../commands/shutdown.html">7.3.60. <code class="docutils literal notranslate"><span class="pre">shutdown</span></code></a></li> |
| 459 |
<li class="toctree-l2"><a class="reference internal" href="../commands/status.html">7.3.61. <code class="docutils literal notranslate"><span class="pre">status</span></code></a></li> |
| 460 |
<li class="toctree-l2"><a class="reference internal" href="../commands/suggest.html">7.3.62. <code class="docutils literal notranslate"><span class="pre">suggest</span></code></a></li> |
| 461 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_copy.html">7.3.63. <code class="docutils literal notranslate"><span class="pre">table_copy</span></code></a></li> |
| 462 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_create.html">7.3.64. <code class="docutils literal notranslate"><span class="pre">table_create</span></code></a></li> |
| 463 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_list.html">7.3.65. <code class="docutils literal notranslate"><span class="pre">table_list</span></code></a></li> |
| 464 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_remove.html">7.3.66. <code class="docutils literal notranslate"><span class="pre">table_remove</span></code></a></li> |
| 465 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_rename.html">7.3.67. <code class="docutils literal notranslate"><span class="pre">table_rename</span></code></a></li> |
| 466 |
<li class="toctree-l2"><a class="reference internal" href="../commands/table_tokenize.html">7.3.68. <code class="docutils literal notranslate"><span class="pre">table_tokenize</span></code></a></li> |
| 467 |
<li class="toctree-l2"><a class="reference internal" href="../commands/thread_dump.html">7.3.69. <code class="docutils literal notranslate"><span class="pre">thread_dump</span></code></a></li> |
| 468 |
<li class="toctree-l2"><a class="reference internal" href="../commands/thread_limit.html">7.3.70. <code class="docutils literal notranslate"><span class="pre">thread_limit</span></code></a></li> |
| 469 |
<li class="toctree-l2"><a class="reference internal" href="../commands/tokenize.html">7.3.71. <code class="docutils literal notranslate"><span class="pre">tokenize</span></code></a></li> |
| 470 |
<li class="toctree-l2"><a class="reference internal" href="../commands/tokenizer_list.html">7.3.72. <code class="docutils literal notranslate"><span class="pre">tokenizer_list</span></code></a></li> |
| 471 |
<li class="toctree-l2"><a class="reference internal" href="../commands/truncate.html">7.3.73. <code class="docutils literal notranslate"><span class="pre">truncate</span></code></a></li> |
| 472 |
</ul> |
| 473 |
</details></li> |
| 474 |
<li class="toctree-l1"><a class="reference internal" href="../types.html">7.4. Data types</a></li> |
| 475 |
<li class="toctree-l1"><a class="reference internal" href="../tables.html">7.5. Tables</a></li> |
| 476 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../column.html">7.6. Column</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 477 |
<li class="toctree-l2"><a class="reference internal" href="../columns/scalar.html">7.6.2.1. Scalar column</a></li> |
| 478 |
<li class="toctree-l2"><a class="reference internal" href="../columns/vector.html">7.6.2.2. Vector column</a></li> |
| 479 |
<li class="toctree-l2"><a class="reference internal" href="../columns/pseudo.html">7.6.2.3. Pseudo column</a></li> |
| 480 |
<li class="toctree-l2"><a class="reference internal" href="../columns/index.html">7.6.3.1. Index column</a></li> |
| 481 |
</ul> |
| 482 |
</details></li> |
| 483 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../extractors.html">7.7. Extractors</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 484 |
<li class="toctree-l2"><a class="reference internal" href="../extractors/extractor_html.html">7.7.2.1. <code class="docutils literal notranslate"><span class="pre">ExtractorHTML</span></code></a></li> |
| 485 |
<li class="toctree-l2"><a class="reference internal" href="../extractors/extractor_json.html">7.7.2.2. <code class="docutils literal notranslate"><span class="pre">ExtractorJSON</span></code></a></li> |
| 486 |
</ul> |
| 487 |
</details></li> |
| 488 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../normalizers.html">7.8. Normalizers</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 489 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_auto.html">7.8.2.1. <code class="docutils literal notranslate"><span class="pre">NormalizerAuto</span></code></a></li> |
| 490 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc.html">7.8.2.2. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC</span></code></a></li> |
| 491 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc100.html">7.8.2.3. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC100</span></code></a></li> |
| 492 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc121.html">7.8.2.4. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC121</span></code></a></li> |
| 493 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc130.html">7.8.2.5. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC130</span></code></a></li> |
| 494 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc150.html">7.8.2.6. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC150</span></code></a></li> |
| 495 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_nfkc51.html">7.8.2.7. <code class="docutils literal notranslate"><span class="pre">NormalizerNFKC51</span></code></a></li> |
| 496 |
<li class="toctree-l2"><a class="reference internal" href="../normalizers/normalizer_table.html">7.8.2.8. <code class="docutils literal notranslate"><span class="pre">NormalizerTable</span></code></a></li> |
| 497 |
</ul> |
| 498 |
</details></li> |
| 499 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../tokenizers.html">7.9. Tokenizers</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 500 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizer/summary.html">7.9.1. Summary</a></li> |
| 501 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram.html">7.9.2. <code class="docutils literal notranslate"><span class="pre">TokenBigram</span></code></a></li> |
| 502 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_ignore_blank.html">7.9.3. <code class="docutils literal notranslate"><span class="pre">TokenBigramIgnoreBlank</span></code></a></li> |
| 503 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_ignore_blank_split_symbol.html">7.9.4. <code class="docutils literal notranslate"><span class="pre">TokenBigramIgnoreBlankSplitSymbol</span></code></a></li> |
| 504 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_ignore_blank_split_symbol_alpha.html">7.9.5. <code class="docutils literal notranslate"><span class="pre">TokenBigramIgnoreBlankSplitSymbolAlpha</span></code></a></li> |
| 505 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_ignore_blank_split_symbol_alpha_digit.html">7.9.6. <code class="docutils literal notranslate"><span class="pre">TokenBigramIgnoreBlankSplitSymbolAlphaDigit</span></code></a></li> |
| 506 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_split_symbol.html">7.9.7. <code class="docutils literal notranslate"><span class="pre">TokenBigramSplitSymbol</span></code></a></li> |
| 507 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_split_symbol_alpha.html">7.9.8. <code class="docutils literal notranslate"><span class="pre">TokenBigramSplitSymbolAlpha</span></code></a></li> |
| 508 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_bigram_split_symbol_alpha_digit.html">7.9.9. <code class="docutils literal notranslate"><span class="pre">TokenBigramSplitSymbolAlphaDigit</span></code></a></li> |
| 509 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_delimit.html">7.9.10. <code class="docutils literal notranslate"><span class="pre">TokenDelimit</span></code></a></li> |
| 510 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_delimit_null.html">7.9.11. <code class="docutils literal notranslate"><span class="pre">TokenDelimitNull</span></code></a></li> |
| 511 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_language_model_knn.html">7.9.12. <code class="docutils literal notranslate"><span class="pre">TokenLanguageModelKNN</span></code></a></li> |
| 512 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_mecab.html">7.9.13. <code class="docutils literal notranslate"><span class="pre">TokenMecab</span></code></a></li> |
| 513 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_ngram.html">7.9.14. <code class="docutils literal notranslate"><span class="pre">TokenNgram</span></code></a></li> |
| 514 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_pattern.html">7.9.15. <code class="docutils literal notranslate"><span class="pre">TokenPattern</span></code></a></li> |
| 515 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_regexp.html">7.9.16. <code class="docutils literal notranslate"><span class="pre">TokenRegexp</span></code></a></li> |
| 516 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_table.html">7.9.17. <code class="docutils literal notranslate"><span class="pre">TokenTable</span></code></a></li> |
| 517 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_trigram.html">7.9.18. <code class="docutils literal notranslate"><span class="pre">TokenTrigram</span></code></a></li> |
| 518 |
<li class="toctree-l2"><a class="reference internal" href="../tokenizers/token_unigram.html">7.9.19. <code class="docutils literal notranslate"><span class="pre">TokenUnigram</span></code></a></li> |
| 519 |
</ul> |
| 520 |
</details></li> |
| 521 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../token_filters.html">7.10. Token filters</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 522 |
<li class="toctree-l2"><a class="reference internal" href="../token_filter/summary.html">7.10.1. Summary</a></li> |
| 523 |
<li class="toctree-l2"><a class="reference internal" href="../token_filters/token_filter_nfkc.html">7.10.2. <code class="docutils literal notranslate"><span class="pre">TokenFilterNFKC</span></code></a></li> |
| 524 |
<li class="toctree-l2"><a class="reference internal" href="../token_filters/token_filter_nfkc100.html">7.10.3. <code class="docutils literal notranslate"><span class="pre">TokenFilterNFKC100</span></code></a></li> |
| 525 |
<li class="toctree-l2"><a class="reference internal" href="../token_filters/token_filter_nfkc150.html">7.10.4. <code class="docutils literal notranslate"><span class="pre">TokenFilterNFKC150</span></code></a></li> |
| 526 |
<li class="toctree-l2"><a class="reference internal" href="../token_filters/token_filter_stem.html">7.10.5. <code class="docutils literal notranslate"><span class="pre">TokenFilterStem</span></code></a></li> |
| 527 |
<li class="toctree-l2"><a class="reference internal" href="../token_filters/token_filter_stop_word.html">7.10.6. <code class="docutils literal notranslate"><span class="pre">TokenFilterStopWord</span></code></a></li> |
| 528 |
</ul> |
| 529 |
</details></li> |
| 530 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../query_expanders.html">7.11. Query expanders</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 531 |
<li class="toctree-l2"><a class="reference internal" href="../query_expanders/tsv.html">7.11.1. QueryExpanderTSV</a></li> |
| 532 |
</ul> |
| 533 |
</details></li> |
| 534 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../scorer.html">7.12. Scorer</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 535 |
<li class="toctree-l2"><a class="reference internal" href="../scorers/scorer_tf_at_most.html">7.12.3.1. <code class="docutils literal notranslate"><span class="pre">scorer_tf_at_most</span></code></a></li> |
| 536 |
<li class="toctree-l2"><a class="reference internal" href="../scorers/scorer_tf_idf.html">7.12.3.2. <code class="docutils literal notranslate"><span class="pre">scorer_tf_idf</span></code></a></li> |
| 537 |
</ul> |
| 538 |
</details></li> |
| 539 |
<li class="toctree-l1"><a class="reference internal" href="../cast.html">7.13. Cast</a></li> |
| 540 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../grn_expr.html">7.14. grn_expr</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 541 |
<li class="toctree-l2"><a class="reference internal" href="../grn_expr/query_syntax.html">7.14.1. Query syntax</a></li> |
| 542 |
<li class="toctree-l2"><a class="reference internal" href="../grn_expr/script_syntax.html">7.14.2. Script syntax</a></li> |
| 543 |
</ul> |
| 544 |
</details></li> |
| 545 |
<li class="toctree-l1"><a class="reference internal" href="../regular_expression.html">7.15. Regular expression</a></li> |
| 546 |
<li class="toctree-l1 current active has-children"><a class="reference internal" href="../function.html">7.16. Function</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul class="current"> |
| 547 |
<li class="toctree-l2"><a class="reference internal" href="between.html">7.16.1. <code class="docutils literal notranslate"><span class="pre">between</span></code></a></li> |
| 548 |
<li class="toctree-l2"><a class="reference internal" href="cast_loose.html">7.16.2. <code class="docutils literal notranslate"><span class="pre">cast_loose</span></code></a></li> |
| 549 |
<li class="toctree-l2"><a class="reference internal" href="edit_distance.html">7.16.3. edit_distance</a></li> |
| 550 |
<li class="toctree-l2"><a class="reference internal" href="escalate.html">7.16.4. <code class="docutils literal notranslate"><span class="pre">escalate</span></code></a></li> |
| 551 |
<li class="toctree-l2"><a class="reference internal" href="fuzzy_search.html">7.16.5. <code class="docutils literal notranslate"><span class="pre">fuzzy_search</span></code></a></li> |
| 552 |
<li class="toctree-l2 current active"><a class="current reference internal" href="#">7.16.6. <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code></a></li> |
| 553 |
<li class="toctree-l2"><a class="reference internal" href="geo_in_circle.html">7.16.7. geo_in_circle</a></li> |
| 554 |
<li class="toctree-l2"><a class="reference internal" href="geo_in_rectangle.html">7.16.8. geo_in_rectangle</a></li> |
| 555 |
<li class="toctree-l2"><a class="reference internal" href="highlight.html">7.16.9. <code class="docutils literal notranslate"><span class="pre">highlight</span></code></a></li> |
| 556 |
<li class="toctree-l2"><a class="reference internal" href="highlight_full.html">7.16.10. <code class="docutils literal notranslate"><span class="pre">highlight_full</span></code></a></li> |
| 557 |
<li class="toctree-l2"><a class="reference internal" href="highlight_html.html">7.16.11. <code class="docutils literal notranslate"><span class="pre">highlight_html</span></code></a></li> |
| 558 |
<li class="toctree-l2"><a class="reference internal" href="html_untag.html">7.16.12. <code class="docutils literal notranslate"><span class="pre">html_untag</span></code></a></li> |
| 559 |
<li class="toctree-l2"><a class="reference internal" href="in_records.html">7.16.13. <code class="docutils literal notranslate"><span class="pre">in_records</span></code></a></li> |
| 560 |
<li class="toctree-l2"><a class="reference internal" href="in_values.html">7.16.14. <code class="docutils literal notranslate"><span class="pre">in_values</span></code></a></li> |
| 561 |
<li class="toctree-l2"><a class="reference internal" href="json_extract.html">7.16.15. <code class="docutils literal notranslate"><span class="pre">json_extract</span></code></a></li> |
| 562 |
<li class="toctree-l2"><a class="reference internal" href="language_model_knn.html">7.16.16. <code class="docutils literal notranslate"><span class="pre">language_model_knn</span></code></a></li> |
| 563 |
<li class="toctree-l2"><a class="reference internal" href="language_model_vectorize.html">7.16.17. <code class="docutils literal notranslate"><span class="pre">language_model_vectorize</span></code></a></li> |
| 564 |
<li class="toctree-l2"><a class="reference internal" href="math_abs.html">7.16.18. <code class="docutils literal notranslate"><span class="pre">math_abs</span></code></a></li> |
| 565 |
<li class="toctree-l2"><a class="reference internal" href="now.html">7.16.19. now</a></li> |
| 566 |
<li class="toctree-l2"><a class="reference internal" href="number_classify.html">7.16.20. <code class="docutils literal notranslate"><span class="pre">number_classify</span></code></a></li> |
| 567 |
<li class="toctree-l2"><a class="reference internal" href="prefix_rk_search.html">7.16.21. <code class="docutils literal notranslate"><span class="pre">prefix_rk_search</span></code></a></li> |
| 568 |
<li class="toctree-l2"><a class="reference internal" href="query.html">7.16.22. <code class="docutils literal notranslate"><span class="pre">query</span></code></a></li> |
| 569 |
<li class="toctree-l2"><a class="reference internal" href="query_parallel_or.html">7.16.23. <code class="docutils literal notranslate"><span class="pre">query_parallel_or</span></code></a></li> |
| 570 |
<li class="toctree-l2"><a class="reference internal" href="rand.html">7.16.24. rand</a></li> |
| 571 |
<li class="toctree-l2"><a class="reference internal" href="snippet.html">7.16.25. <code class="docutils literal notranslate"><span class="pre">snippet</span></code></a></li> |
| 572 |
<li class="toctree-l2"><a class="reference internal" href="snippet_html.html">7.16.26. <code class="docutils literal notranslate"><span class="pre">snippet_html</span></code></a></li> |
| 573 |
<li class="toctree-l2"><a class="reference internal" href="string_length.html">7.16.27. <code class="docutils literal notranslate"><span class="pre">string_length</span></code></a></li> |
| 574 |
<li class="toctree-l2"><a class="reference internal" href="string_slice.html">7.16.28. <code class="docutils literal notranslate"><span class="pre">string_slice</span></code></a></li> |
| 575 |
<li class="toctree-l2"><a class="reference internal" href="string_substring.html">7.16.29. <code class="docutils literal notranslate"><span class="pre">string_substring</span></code></a></li> |
| 576 |
<li class="toctree-l2"><a class="reference internal" href="string_truncate.html">7.16.30. <code class="docutils literal notranslate"><span class="pre">string_truncate</span></code></a></li> |
| 577 |
<li class="toctree-l2"><a class="reference internal" href="sub_filter.html">7.16.31. <code class="docutils literal notranslate"><span class="pre">sub_filter</span></code></a></li> |
| 578 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_day.html">7.16.32. <code class="docutils literal notranslate"><span class="pre">time_classify_day</span></code></a></li> |
| 579 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_day_of_week.html">7.16.33. <code class="docutils literal notranslate"><span class="pre">time_classify_day_of_week</span></code></a></li> |
| 580 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_hour.html">7.16.34. <code class="docutils literal notranslate"><span class="pre">time_classify_hour</span></code></a></li> |
| 581 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_minute.html">7.16.35. <code class="docutils literal notranslate"><span class="pre">time_classify_minute</span></code></a></li> |
| 582 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_month.html">7.16.36. <code class="docutils literal notranslate"><span class="pre">time_classify_month</span></code></a></li> |
| 583 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_second.html">7.16.37. <code class="docutils literal notranslate"><span class="pre">time_classify_second</span></code></a></li> |
| 584 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_week.html">7.16.38. <code class="docutils literal notranslate"><span class="pre">time_classify_week</span></code></a></li> |
| 585 |
<li class="toctree-l2"><a class="reference internal" href="time_classify_year.html">7.16.39. <code class="docutils literal notranslate"><span class="pre">time_classify_year</span></code></a></li> |
| 586 |
<li class="toctree-l2"><a class="reference internal" href="vector_find.html">7.16.40. <code class="docutils literal notranslate"><span class="pre">vector_find</span></code></a></li> |
| 587 |
<li class="toctree-l2"><a class="reference internal" href="vector_new.html">7.16.41. <code class="docutils literal notranslate"><span class="pre">vector_new</span></code></a></li> |
| 588 |
<li class="toctree-l2"><a class="reference internal" href="vector_size.html">7.16.42. <code class="docutils literal notranslate"><span class="pre">vector_size</span></code></a></li> |
| 589 |
<li class="toctree-l2"><a class="reference internal" href="vector_slice.html">7.16.43. <code class="docutils literal notranslate"><span class="pre">vector_slice</span></code></a></li> |
| 590 |
</ul> |
| 591 |
</details></li> |
| 592 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../window_function.html">7.17. Window function</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 593 |
<li class="toctree-l2"><a class="reference internal" href="../window_functions/record_number.html">7.17.1. <code class="docutils literal notranslate"><span class="pre">record_number</span></code></a></li> |
| 594 |
<li class="toctree-l2"><a class="reference internal" href="../window_functions/window_count.html">7.17.2. <code class="docutils literal notranslate"><span class="pre">window_count</span></code></a></li> |
| 595 |
<li class="toctree-l2"><a class="reference internal" href="../window_functions/window_rank.html">7.17.3. <code class="docutils literal notranslate"><span class="pre">window_rank</span></code></a></li> |
| 596 |
<li class="toctree-l2"><a class="reference internal" href="../window_functions/window_record_number.html">7.17.4. <code class="docutils literal notranslate"><span class="pre">window_record_number</span></code></a></li> |
| 597 |
<li class="toctree-l2"><a class="reference internal" href="../window_functions/window_sum.html">7.17.5. <code class="docutils literal notranslate"><span class="pre">window_sum</span></code></a></li> |
| 598 |
</ul> |
| 599 |
</details></li> |
| 600 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../operations.html">7.18. Operations</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 601 |
<li class="toctree-l2"><a class="reference internal" href="../operations/geolocation_search.html">7.18.1. Geolocation search</a></li> |
| 602 |
<li class="toctree-l2"><a class="reference internal" href="../operations/prefix_rk_search.html">7.18.2. Prefix RK search</a></li> |
| 603 |
</ul> |
| 604 |
</details></li> |
| 605 |
<li class="toctree-l1"><a class="reference internal" href="../configuration.html">7.19. Configuration</a></li> |
| 606 |
<li class="toctree-l1"><a class="reference internal" href="../alias.html">7.20. Alias</a></li> |
| 607 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../suggest.html">7.21. Suggest</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 608 |
<li class="toctree-l2"><a class="reference internal" href="../suggest/introduction.html">7.21.1. Introduction</a></li> |
| 609 |
<li class="toctree-l2"><a class="reference internal" href="../suggest/completion.html">7.21.2. Completion</a></li> |
| 610 |
<li class="toctree-l2"><a class="reference internal" href="../suggest/correction.html">7.21.3. Correction</a></li> |
| 611 |
<li class="toctree-l2"><a class="reference internal" href="../suggest/suggestion.html">7.21.4. Suggestion</a></li> |
| 612 |
</ul> |
| 613 |
</details></li> |
| 614 |
<li class="toctree-l1"><a class="reference internal" href="../indexing.html">7.22. Indexing</a></li> |
| 615 |
<li class="toctree-l1"><a class="reference internal" href="../sharding.html">7.23. Sharding</a></li> |
| 616 |
<li class="toctree-l1"><a class="reference internal" href="../language_model.html">7.24. Language model</a></li> |
| 617 |
<li class="toctree-l1"><a class="reference internal" href="../log.html">7.25. Log</a></li> |
| 618 |
<li class="toctree-l1"><a class="reference internal" href="../tuning.html">7.26. Tuning</a></li> |
| 619 |
<li class="toctree-l1 has-children"><a class="reference internal" href="../api.html">7.27. API</a><details open="open"><summary><span class="toctree-toggle" role="presentation"><i class="fa-solid fa-chevron-down"></i></span></summary><ul> |
| 620 |
<li class="toctree-l2"><a class="reference internal" href="../api/overview.html">7.27.1.1. Overview</a></li> |
| 621 |
<li class="toctree-l2"><a class="reference internal" href="../api/global_configurations.html">7.27.1.2. Global configurations</a></li> |
| 622 |
<li class="toctree-l2"><a class="reference internal" href="../api/plugin.html">7.27.1.3. Plugin</a></li> |
| 623 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_cache.html">7.27.1.4. <code class="docutils literal notranslate"><span class="pre">grn_cache</span></code></a></li> |
| 624 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_column.html">7.27.1.5. <code class="docutils literal notranslate"><span class="pre">grn_column</span></code></a></li> |
| 625 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_command_version.html">7.27.1.6. <code class="docutils literal notranslate"><span class="pre">grn_command_version</span></code></a></li> |
| 626 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_content_type.html">7.27.1.7. <code class="docutils literal notranslate"><span class="pre">grn_content_type</span></code></a></li> |
| 627 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_ctx.html">7.27.1.8. <code class="docutils literal notranslate"><span class="pre">grn_ctx</span></code></a></li> |
| 628 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_db.html">7.27.1.9. <code class="docutils literal notranslate"><span class="pre">grn_db</span></code></a></li> |
| 629 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_encoding.html">7.27.1.10. <code class="docutils literal notranslate"><span class="pre">grn_encoding</span></code></a></li> |
| 630 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_expr.html">7.27.1.11. grn_expr</a></li> |
| 631 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_geo.html">7.27.1.12. <code class="docutils literal notranslate"><span class="pre">grn_geo</span></code></a></li> |
| 632 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_hook.html">7.27.1.13. <code class="docutils literal notranslate"><span class="pre">grn_hook</span></code></a></li> |
| 633 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_ii.html">7.27.1.14. <code class="docutils literal notranslate"><span class="pre">grn_ii</span></code></a></li> |
| 634 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_index_cursor.html">7.27.1.15. <code class="docutils literal notranslate"><span class="pre">grn_index_cursor</span></code></a></li> |
| 635 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_info.html">7.27.1.16. <code class="docutils literal notranslate"><span class="pre">grn_info</span></code></a></li> |
| 636 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_inspect.html">7.27.1.17. <code class="docutils literal notranslate"><span class="pre">grn_inspect</span></code></a></li> |
| 637 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_match_escalation.html">7.27.1.18. <code class="docutils literal notranslate"><span class="pre">grn_match_escalation</span></code></a></li> |
| 638 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_obj.html">7.27.1.19. <code class="docutils literal notranslate"><span class="pre">grn_obj</span></code></a></li> |
| 639 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_proc.html">7.27.1.20. <code class="docutils literal notranslate"><span class="pre">grn_proc</span></code></a></li> |
| 640 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_search.html">7.27.1.21. <code class="docutils literal notranslate"><span class="pre">grn_search</span></code></a></li> |
| 641 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_table.html">7.27.1.22. <code class="docutils literal notranslate"><span class="pre">grn_table</span></code></a></li> |
| 642 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_table_cursor.html">7.27.1.23. <code class="docutils literal notranslate"><span class="pre">grn_table_cursor</span></code></a></li> |
| 643 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_thread.html">7.27.1.24. <code class="docutils literal notranslate"><span class="pre">grn_thread_*</span></code></a></li> |
| 644 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_type.html">7.27.1.25. <code class="docutils literal notranslate"><span class="pre">grn_type</span></code></a></li> |
| 645 |
<li class="toctree-l2"><a class="reference internal" href="../api/grn_user_data.html">7.27.1.26. <code class="docutils literal notranslate"><span class="pre">grn_user_data</span></code></a></li> |
| 646 |
</ul> |
| 647 |
</details></li> |
| 648 |
</ul> |
| 649 |
</div> |
| 650 |
</nav></div> |
| 651 |
</div> |
| 652 |
|
| 653 |
|
| 654 |
<div class="sidebar-primary-items__end sidebar-primary__section"> |
| 655 |
<div class="sidebar-primary-item"> |
| 656 |
<div id="ethical-ad-placement" |
| 657 |
class="flat" |
| 658 |
data-ea-publisher="readthedocs" |
| 659 |
data-ea-type="readthedocs-sidebar" |
| 660 |
data-ea-manual="true"> |
| 661 |
</div></div> |
| 662 |
</div> |
| 663 |
|
| 664 |
|
| 665 |
</div> |
| 666 |
|
| 667 |
<main id="main-content" class="bd-main" role="main"> |
| 668 |
|
| 669 |
|
| 670 |
<div class="bd-content"> |
| 671 |
<div class="bd-article-container"> |
| 672 |
|
| 673 |
<div class="bd-header-article d-print-none"> |
| 674 |
<div class="header-article-items header-article__inner"> |
| 675 |
|
| 676 |
<div class="header-article-items__start"> |
| 677 |
|
| 678 |
<div class="header-article-item"> |
| 679 |
|
| 680 |
<nav aria-label="Breadcrumb" class="d-print-none"> |
| 681 |
<ul class="bd-breadcrumbs"> |
| 682 |
|
| 683 |
<li class="breadcrumb-item breadcrumb-home"> |
| 684 |
<a href="../../index.html" class="nav-link" aria-label="Home"> |
| 685 |
<i class="fa-solid fa-home"></i> |
| 686 |
</a> |
| 687 |
</li> |
| 688 |
|
| 689 |
<li class="breadcrumb-item"><a href="../../reference.html" class="nav-link"><span class="section-number">7. </span>Reference manual</a></li> |
| 690 |
|
| 691 |
|
| 692 |
<li class="breadcrumb-item"><a href="../function.html" class="nav-link"><span class="section-number">7.16. </span>Function</a></li> |
| 693 |
|
| 694 |
<li class="breadcrumb-item active" aria-current="page"><span class="ellipsis"><span class="section-number">7.16.6. </span><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code></span></li> |
| 695 |
</ul> |
| 696 |
</nav> |
| 697 |
</div> |
| 698 |
|
| 699 |
</div> |
| 700 |
|
| 701 |
|
| 702 |
</div> |
| 703 |
</div> |
| 704 |
|
| 705 |
|
| 706 |
|
| 707 |
|
| 708 |
<div id="searchbox"></div> |
| 709 |
<article class="bd-article"> |
| 710 |
|
| 711 |
<section id="geo-distance"> |
| 712 |
<h1><span class="section-number">7.16.6. </span><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code><a class="headerlink" href="#geo-distance" title="Link to this heading">#</a></h1> |
| 713 |
<section id="summary"> |
| 714 |
<h2><span class="section-number">7.16.6.1. </span>Summary<a class="headerlink" href="#summary" title="Link to this heading">#</a></h2> |
| 715 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> calculates the value of distance between specified two points.</p> |
| 716 |
</section> |
| 717 |
<section id="syntax"> |
| 718 |
<h2><span class="section-number">7.16.6.2. </span>Syntax<a class="headerlink" href="#syntax" title="Link to this heading">#</a></h2> |
| 719 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> requires two point. |
| 720 |
The parameter <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code> is optional:</p> |
| 721 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">geo_distance</span><span class="p">(</span><span class="n">point1</span><span class="p">,</span> <span class="n">point2</span><span class="p">)</span> |
| 722 |
<span class="n">geo_distance</span><span class="p">(</span><span class="n">point1</span><span class="p">,</span> <span class="n">point2</span><span class="p">,</span> <span class="n">approximate_type</span><span class="p">)</span> |
| 723 |
</pre></div> |
| 724 |
</div> |
| 725 |
<p>The default value of <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code> is <code class="docutils literal notranslate"><span class="pre">"rectangle"</span></code>. |
| 726 |
If you omit <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code>, <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> calculates the value of |
| 727 |
distance as if <code class="docutils literal notranslate"><span class="pre">"rectangle"</span></code> was specified.</p> |
| 728 |
</section> |
| 729 |
<section id="usage"> |
| 730 |
<h2><span class="section-number">7.16.6.3. </span>Usage<a class="headerlink" href="#usage" title="Link to this heading">#</a></h2> |
| 731 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> is one of the Groonga builtin functions.</p> |
| 732 |
<p>You can call a builtin function in <a class="reference internal" href="../grn_expr.html"><span class="doc">grn_expr</span></a></p> |
| 733 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> function calculates the value of distance (approximate value) |
| 734 |
between the coordinate of <code class="docutils literal notranslate"><span class="pre">point1</span></code> and the coordinate of <code class="docutils literal notranslate"><span class="pre">point2</span></code>.</p> |
| 735 |
<div class="admonition note"> |
| 736 |
<p class="admonition-title">Note</p> |
| 737 |
<p>Groonga provides three built in functions for calculating the value of distance. |
| 738 |
There are <code class="docutils literal notranslate"><span class="pre">geo_distance()</span></code>, <code class="docutils literal notranslate"><span class="pre">geo_distance2()</span></code> and <code class="docutils literal notranslate"><span class="pre">geo_distance3()</span></code>. |
| 739 |
The difference of them is the algorithm of calculating distance. |
| 740 |
<code class="docutils literal notranslate"><span class="pre">geo_distance2()</span></code> and <code class="docutils literal notranslate"><span class="pre">geo_distance3()</span></code> were deprecated since version 1.2.9. |
| 741 |
Use <code class="docutils literal notranslate"><span class="pre">geo_distance(point1,</span> <span class="pre">point2,</span> <span class="pre">"sphere")</span></code> instead of <code class="docutils literal notranslate"><span class="pre">geo_distance2(point1,</span> <span class="pre">point2)</span></code>. |
| 742 |
Use <code class="docutils literal notranslate"><span class="pre">geo_distance(point1,</span> <span class="pre">point2,</span> <span class="pre">"ellipsoid")</span></code> instead of <code class="docutils literal notranslate"><span class="pre">geo_distance3(point1,</span> <span class="pre">point2)</span></code>.</p> |
| 743 |
</div> |
| 744 |
<p>Lets’s learn about <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> usage with examples. |
| 745 |
This section shows simple usages.</p> |
| 746 |
<p>Here are two schema definition and sample data to show the difference according to the usage. |
| 747 |
Those samples show how to calculate the value of distance between New York City and London.</p> |
| 748 |
<ol class="arabic simple"> |
| 749 |
<li><p>Using the column value of location for calculating the distance (<code class="docutils literal notranslate"><span class="pre">Cities</span></code> table)</p></li> |
| 750 |
<li><p>Using the explicitly specified coordinates for calculating the distance (<code class="docutils literal notranslate"><span class="pre">Geo</span></code> table)</p></li> |
| 751 |
</ol> |
| 752 |
<section id="using-the-column-value-of-location"> |
| 753 |
<h3><span class="section-number">7.16.6.3.1. </span>Using the column value of location<a class="headerlink" href="#using-the-column-value-of-location" title="Link to this heading">#</a></h3> |
| 754 |
<p>Here are a schema definition of <code class="docutils literal notranslate"><span class="pre">Cities</span></code> table and sample data to show usage.</p> |
| 755 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">table_create</span> <span class="n">Cities</span> <span class="n">TABLE_HASH_KEY</span> <span class="n">ShortText</span> |
| 756 |
<span class="n">column_create</span> <span class="n">Cities</span> <span class="n">location</span> <span class="n">COLUMN_SCALAR</span> <span class="n">WGS84GeoPoint</span> |
| 757 |
<span class="n">load</span> <span class="o">--</span><span class="n">table</span> <span class="n">Cities</span> |
| 758 |
<span class="p">[</span> |
| 759 |
<span class="p">[</span><span class="s2">"_key"</span><span class="p">,</span> <span class="s2">"location"</span><span class="p">],</span> |
| 760 |
<span class="p">[</span><span class="s2">"New York City"</span><span class="p">,</span> <span class="s2">"146566000x-266422000"</span><span class="p">]</span> |
| 761 |
<span class="p">]</span> |
| 762 |
</pre></div> |
| 763 |
</div> |
| 764 |
<p>Execution example:</p> |
| 765 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">table_create</span> <span class="n">Cities</span> <span class="n">TABLE_HASH_KEY</span> <span class="n">ShortText</span> |
| 766 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],true]</span> |
| 767 |
<span class="n">column_create</span> <span class="n">Cities</span> <span class="n">location</span> <span class="n">COLUMN_SCALAR</span> <span class="n">WGS84GeoPoint</span> |
| 768 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],true]</span> |
| 769 |
<span class="n">load</span> <span class="o">--</span><span class="n">table</span> <span class="n">Cities</span> |
| 770 |
<span class="p">[</span> |
| 771 |
<span class="p">[</span><span class="s2">"_key"</span><span class="p">,</span> <span class="s2">"location"</span><span class="p">],</span> |
| 772 |
<span class="p">[</span><span class="s2">"New York City"</span><span class="p">,</span> <span class="s2">"146566000x-266422000"</span><span class="p">]</span> |
| 773 |
<span class="p">]</span> |
| 774 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],1]</span> |
| 775 |
</pre></div> |
| 776 |
</div> |
| 777 |
<p>This execution example creates a table named <code class="docutils literal notranslate"><span class="pre">Cities</span></code> which has one column named <code class="docutils literal notranslate"><span class="pre">location</span></code>. |
| 778 |
<code class="docutils literal notranslate"><span class="pre">location</span></code> column stores the value of coordinate. |
| 779 |
The coordinate of Tokyo is stored as sample data.</p> |
| 780 |
<p>Execution example:</p> |
| 781 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Cities</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">_score</span> <span class="o">--</span><span class="nb">filter</span> <span class="mi">1</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'_score = geo_distance(location, "185428000x-461000", "rectangle")'</span> |
| 782 |
<span class="c1"># [</span> |
| 783 |
<span class="c1"># [</span> |
| 784 |
<span class="c1"># 0,</span> |
| 785 |
<span class="c1"># 1337566253.89858,</span> |
| 786 |
<span class="c1"># 0.000355720520019531</span> |
| 787 |
<span class="c1"># ],</span> |
| 788 |
<span class="c1"># [</span> |
| 789 |
<span class="c1"># [</span> |
| 790 |
<span class="c1"># [</span> |
| 791 |
<span class="c1"># 1</span> |
| 792 |
<span class="c1"># ],</span> |
| 793 |
<span class="c1"># [</span> |
| 794 |
<span class="c1"># [</span> |
| 795 |
<span class="c1"># "_score",</span> |
| 796 |
<span class="c1"># "Int32"</span> |
| 797 |
<span class="c1"># ]</span> |
| 798 |
<span class="c1"># ],</span> |
| 799 |
<span class="c1"># [</span> |
| 800 |
<span class="c1"># 5807750</span> |
| 801 |
<span class="c1"># ]</span> |
| 802 |
<span class="c1"># ]</span> |
| 803 |
<span class="c1"># ]</span> |
| 804 |
<span class="c1"># ]</span> |
| 805 |
</pre></div> |
| 806 |
</div> |
| 807 |
<p>This sample shows that <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> use the value of <code class="docutils literal notranslate"><span class="pre">location</span></code> column |
| 808 |
and the value of coordinate to calculate distance.</p> |
| 809 |
<p>The value (“185428000x-461000”) passed to <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> as the second argument is |
| 810 |
the coordinate of London.</p> |
| 811 |
</section> |
| 812 |
<section id="using-the-explicitly-specified-value-of-location"> |
| 813 |
<h3><span class="section-number">7.16.6.3.2. </span>Using the explicitly specified value of location<a class="headerlink" href="#using-the-explicitly-specified-value-of-location" title="Link to this heading">#</a></h3> |
| 814 |
<p>Here are a schema definition of <code class="docutils literal notranslate"><span class="pre">Geo</span></code> table and sample data to show usage.</p> |
| 815 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">table_create</span> <span class="n">Geo</span> <span class="n">TABLE_HASH_KEY</span> <span class="n">ShortText</span> |
| 816 |
<span class="n">column_create</span> <span class="n">Geo</span> <span class="n">distance</span> <span class="n">COLUMN_SCALAR</span> <span class="n">Int32</span> |
| 817 |
<span class="n">load</span> <span class="o">--</span><span class="n">table</span> <span class="n">Geo</span> |
| 818 |
<span class="p">[</span> |
| 819 |
<span class="p">{</span> |
| 820 |
<span class="s2">"_key"</span><span class="p">:</span> <span class="s2">"the record for geo_distance() result"</span> |
| 821 |
<span class="p">}</span> |
| 822 |
<span class="p">]</span> |
| 823 |
</pre></div> |
| 824 |
</div> |
| 825 |
<p>Execution example:</p> |
| 826 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">table_create</span> <span class="n">Geo</span> <span class="n">TABLE_HASH_KEY</span> <span class="n">ShortText</span> |
| 827 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],true]</span> |
| 828 |
<span class="n">column_create</span> <span class="n">Geo</span> <span class="n">distance</span> <span class="n">COLUMN_SCALAR</span> <span class="n">Int32</span> |
| 829 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],true]</span> |
| 830 |
<span class="n">load</span> <span class="o">--</span><span class="n">table</span> <span class="n">Geo</span> |
| 831 |
<span class="p">[</span> |
| 832 |
<span class="p">{</span> |
| 833 |
<span class="s2">"_key"</span><span class="p">:</span> <span class="s2">"the record for geo_distance() result"</span> |
| 834 |
<span class="p">}</span> |
| 835 |
<span class="p">]</span> |
| 836 |
<span class="c1"># [[0,1337566253.89858,0.000355720520019531],1]</span> |
| 837 |
</pre></div> |
| 838 |
</div> |
| 839 |
<p>This execution example creates a table named <code class="docutils literal notranslate"><span class="pre">Geo</span></code> which has one column named <code class="docutils literal notranslate"><span class="pre">distance</span></code>. |
| 840 |
<code class="docutils literal notranslate"><span class="pre">distance</span></code> column stores the value of distance.</p> |
| 841 |
<p>Execution example:</p> |
| 842 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Geo</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">distance</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'distance = geo_distance("146566000x-266422000", "185428000x-461000", "rectangle")'</span> |
| 843 |
<span class="c1"># [</span> |
| 844 |
<span class="c1"># [</span> |
| 845 |
<span class="c1"># 0,</span> |
| 846 |
<span class="c1"># 1337566253.89858,</span> |
| 847 |
<span class="c1"># 0.000355720520019531</span> |
| 848 |
<span class="c1"># ],</span> |
| 849 |
<span class="c1"># [</span> |
| 850 |
<span class="c1"># [</span> |
| 851 |
<span class="c1"># [</span> |
| 852 |
<span class="c1"># 1</span> |
| 853 |
<span class="c1"># ],</span> |
| 854 |
<span class="c1"># [</span> |
| 855 |
<span class="c1"># [</span> |
| 856 |
<span class="c1"># "distance",</span> |
| 857 |
<span class="c1"># "Int32"</span> |
| 858 |
<span class="c1"># ]</span> |
| 859 |
<span class="c1"># ],</span> |
| 860 |
<span class="c1"># [</span> |
| 861 |
<span class="c1"># 5807750</span> |
| 862 |
<span class="c1"># ]</span> |
| 863 |
<span class="c1"># ]</span> |
| 864 |
<span class="c1"># ]</span> |
| 865 |
<span class="c1"># ]</span> |
| 866 |
</pre></div> |
| 867 |
</div> |
| 868 |
<p>This sample shows that <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> use the coordinate of London |
| 869 |
and the coordinate of New York to calculate distance.</p> |
| 870 |
</section> |
| 871 |
</section> |
| 872 |
<section id="parameters"> |
| 873 |
<h2><span class="section-number">7.16.6.4. </span>Parameters<a class="headerlink" href="#parameters" title="Link to this heading">#</a></h2> |
| 874 |
<section id="required-parameters"> |
| 875 |
<h3><span class="section-number">7.16.6.4.1. </span>Required parameters<a class="headerlink" href="#required-parameters" title="Link to this heading">#</a></h3> |
| 876 |
<p>There are two required parameter, <code class="docutils literal notranslate"><span class="pre">point1</span></code> and <code class="docutils literal notranslate"><span class="pre">point2</span></code>.</p> |
| 877 |
<section id="point1"> |
| 878 |
<h4><span class="section-number">7.16.6.4.1.1. </span><code class="docutils literal notranslate"><span class="pre">point1</span></code><a class="headerlink" href="#point1" title="Link to this heading">#</a></h4> |
| 879 |
<p>Specifies the start point that |
| 880 |
you want to calculate the value of distance between two points.</p> |
| 881 |
<p>You can specify the value of GeoPoint type. <a class="footnote-reference brackets" href="#id2" id="id1" role="doc-noteref"><span class="fn-bracket">[</span>1<span class="fn-bracket">]</span></a></p> |
| 882 |
<p>See <a class="reference internal" href="../types.html"><span class="doc">Data types</span></a> about GeoPoint.</p> |
| 883 |
</section> |
| 884 |
<section id="point2"> |
| 885 |
<h4><span class="section-number">7.16.6.4.1.2. </span><code class="docutils literal notranslate"><span class="pre">point2</span></code><a class="headerlink" href="#point2" title="Link to this heading">#</a></h4> |
| 886 |
<p>Specifies the end point that |
| 887 |
you want to calculate the value of distance between two points.</p> |
| 888 |
<p>You can specify the value of GeoPoint type or |
| 889 |
the string indicating the coordinate.</p> |
| 890 |
<p>See <a class="reference internal" href="../types.html"><span class="doc">Data types</span></a> about GeoPoint and the coordinate.</p> |
| 891 |
</section> |
| 892 |
</section> |
| 893 |
<section id="optional-parameter"> |
| 894 |
<h3><span class="section-number">7.16.6.4.2. </span>Optional parameter<a class="headerlink" href="#optional-parameter" title="Link to this heading">#</a></h3> |
| 895 |
<p>There is a optional parameter, <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code>.</p> |
| 896 |
<section id="approximate-type"> |
| 897 |
<h4><span class="section-number">7.16.6.4.2.1. </span><code class="docutils literal notranslate"><span class="pre">approximate_type</span></code><a class="headerlink" href="#approximate-type" title="Link to this heading">#</a></h4> |
| 898 |
<p>Specifies how to approximate the geographical features for calculating |
| 899 |
the value of distance.</p> |
| 900 |
<p>You can specify the value of <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code> by one of the followings.</p> |
| 901 |
<blockquote> |
| 902 |
<div><ul class="simple"> |
| 903 |
<li><p><code class="docutils literal notranslate"><span class="pre">rectangle</span></code></p></li> |
| 904 |
<li><p><code class="docutils literal notranslate"><span class="pre">sphere</span></code></p></li> |
| 905 |
<li><p><code class="docutils literal notranslate"><span class="pre">ellipsoid</span></code></p></li> |
| 906 |
</ul> |
| 907 |
</div></blockquote> |
| 908 |
<div class="admonition note"> |
| 909 |
<p class="admonition-title">Note</p> |
| 910 |
<p>There is a limitation about <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code>. <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> can not |
| 911 |
calculate the value of distance between two points across meridian, |
| 912 |
equator or the date line if you use <code class="docutils literal notranslate"><span class="pre">sphere</span></code> or <code class="docutils literal notranslate"><span class="pre">ellipsoid</span></code> as |
| 913 |
approximate type. There is not such a limitation for <code class="docutils literal notranslate"><span class="pre">rectangle</span></code>. |
| 914 |
This is temporary limitation according to the implementation of Groonga, |
| 915 |
but it will be fixed in the future release.</p> |
| 916 |
</div> |
| 917 |
<section id="rectangle"> |
| 918 |
<h5><span class="section-number">7.16.6.4.2.1.1. </span><code class="docutils literal notranslate"><span class="pre">rectangle</span></code><a class="headerlink" href="#rectangle" title="Link to this heading">#</a></h5> |
| 919 |
<p>This parameter require to approximate the geographical features |
| 920 |
by square approximation for calculating the distance.</p> |
| 921 |
<p>Since the value of distance is calculated by simple formula, |
| 922 |
you can calculate the value of distance fast. |
| 923 |
But, the error of distance increases as it approaches the pole.</p> |
| 924 |
<p>You can also specify <code class="docutils literal notranslate"><span class="pre">rect</span></code> as abbrev expression.</p> |
| 925 |
<p>Here is a sample about calculating the value of distance with column value.</p> |
| 926 |
<p>Execution example:</p> |
| 927 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Cities</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">_score</span> <span class="o">--</span><span class="nb">filter</span> <span class="mi">1</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'_score = geo_distance(location, "185428000x-461000", "rectangle")'</span> |
| 928 |
<span class="c1"># [</span> |
| 929 |
<span class="c1"># [</span> |
| 930 |
<span class="c1"># 0,</span> |
| 931 |
<span class="c1"># 1337566253.89858,</span> |
| 932 |
<span class="c1"># 0.000355720520019531</span> |
| 933 |
<span class="c1"># ],</span> |
| 934 |
<span class="c1"># [</span> |
| 935 |
<span class="c1"># [</span> |
| 936 |
<span class="c1"># [</span> |
| 937 |
<span class="c1"># 1</span> |
| 938 |
<span class="c1"># ],</span> |
| 939 |
<span class="c1"># [</span> |
| 940 |
<span class="c1"># [</span> |
| 941 |
<span class="c1"># "_score",</span> |
| 942 |
<span class="c1"># "Int32"</span> |
| 943 |
<span class="c1"># ]</span> |
| 944 |
<span class="c1"># ],</span> |
| 945 |
<span class="c1"># [</span> |
| 946 |
<span class="c1"># 5807750</span> |
| 947 |
<span class="c1"># ]</span> |
| 948 |
<span class="c1"># ]</span> |
| 949 |
<span class="c1"># ]</span> |
| 950 |
<span class="c1"># ]</span> |
| 951 |
</pre></div> |
| 952 |
</div> |
| 953 |
<p>Here is a sample about calculating the value of distance with explicitly specified point.</p> |
| 954 |
<p>Execution example:</p> |
| 955 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Geo</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">distance</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'distance = geo_distance("146566000x-266422000", "185428000x-461000", "rectangle")'</span> |
| 956 |
<span class="c1"># [</span> |
| 957 |
<span class="c1"># [</span> |
| 958 |
<span class="c1"># 0,</span> |
| 959 |
<span class="c1"># 1337566253.89858,</span> |
| 960 |
<span class="c1"># 0.000355720520019531</span> |
| 961 |
<span class="c1"># ],</span> |
| 962 |
<span class="c1"># [</span> |
| 963 |
<span class="c1"># [</span> |
| 964 |
<span class="c1"># [</span> |
| 965 |
<span class="c1"># 1</span> |
| 966 |
<span class="c1"># ],</span> |
| 967 |
<span class="c1"># [</span> |
| 968 |
<span class="c1"># [</span> |
| 969 |
<span class="c1"># "distance",</span> |
| 970 |
<span class="c1"># "Int32"</span> |
| 971 |
<span class="c1"># ]</span> |
| 972 |
<span class="c1"># ],</span> |
| 973 |
<span class="c1"># [</span> |
| 974 |
<span class="c1"># 5807750</span> |
| 975 |
<span class="c1"># ]</span> |
| 976 |
<span class="c1"># ]</span> |
| 977 |
<span class="c1"># ]</span> |
| 978 |
<span class="c1"># ]</span> |
| 979 |
</pre></div> |
| 980 |
</div> |
| 981 |
<p>Here are samples about calculating the value of distance with explicitly specified point across meridian, equator, the date line.</p> |
| 982 |
<p>Execution example:</p> |
| 983 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Geo</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">distance</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'distance = geo_distance("175904000x8464000", "145508000x-13291000", "rectangle")'</span> |
| 984 |
<span class="c1"># [</span> |
| 985 |
<span class="c1"># [</span> |
| 986 |
<span class="c1"># 0,</span> |
| 987 |
<span class="c1"># 1337566253.89858,</span> |
| 988 |
<span class="c1"># 0.000355720520019531</span> |
| 989 |
<span class="c1"># ],</span> |
| 990 |
<span class="c1"># [</span> |
| 991 |
<span class="c1"># [</span> |
| 992 |
<span class="c1"># [</span> |
| 993 |
<span class="c1"># 1</span> |
| 994 |
<span class="c1"># ],</span> |
| 995 |
<span class="c1"># [</span> |
| 996 |
<span class="c1"># [</span> |
| 997 |
<span class="c1"># "distance",</span> |
| 998 |
<span class="c1"># "Int32"</span> |
| 999 |
<span class="c1"># ]</span> |
| 1000 |
<span class="c1"># ],</span> |
| 1001 |
<span class="c1"># [</span> |
| 1002 |
<span class="c1"># 1051322</span> |
| 1003 |
<span class="c1"># ]</span> |
| 1004 |
<span class="c1"># ]</span> |
| 1005 |
<span class="c1"># ]</span> |
| 1006 |
<span class="c1"># ]</span> |
| 1007 |
</pre></div> |
| 1008 |
</div> |
| 1009 |
<p>This sample shows the value of distance across meridian. |
| 1010 |
The return value of <code class="docutils literal notranslate"><span class="pre">geo_distance("175904000x8464000",</span> <span class="pre">"145508000x-13291000",</span> <span class="pre">"rectangle")</span></code> is the value of distance from Paris, Flance to Madrid, Spain.</p> |
| 1011 |
<p>Execution example:</p> |
| 1012 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Geo</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">distance</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'distance = geo_distance("146566000x-266422000", "-56880000x-172310000", "rectangle")'</span> |
| 1013 |
<span class="c1"># [</span> |
| 1014 |
<span class="c1"># [</span> |
| 1015 |
<span class="c1"># 0,</span> |
| 1016 |
<span class="c1"># 1337566253.89858,</span> |
| 1017 |
<span class="c1"># 0.000355720520019531</span> |
| 1018 |
<span class="c1"># ],</span> |
| 1019 |
<span class="c1"># [</span> |
| 1020 |
<span class="c1"># [</span> |
| 1021 |
<span class="c1"># [</span> |
| 1022 |
<span class="c1"># 1</span> |
| 1023 |
<span class="c1"># ],</span> |
| 1024 |
<span class="c1"># [</span> |
| 1025 |
<span class="c1"># [</span> |
| 1026 |
<span class="c1"># "distance",</span> |
| 1027 |
<span class="c1"># "Int32"</span> |
| 1028 |
<span class="c1"># ]</span> |
| 1029 |
<span class="c1"># ],</span> |
| 1030 |
<span class="c1"># [</span> |
| 1031 |
<span class="c1"># 6880439</span> |
| 1032 |
<span class="c1"># ]</span> |
| 1033 |
<span class="c1"># ]</span> |
| 1034 |
<span class="c1"># ]</span> |
| 1035 |
<span class="c1"># ]</span> |
| 1036 |
</pre></div> |
| 1037 |
</div> |
| 1038 |
<p>This sample shows the value of distance across equator. |
| 1039 |
The return value of <code class="docutils literal notranslate"><span class="pre">geo_distance("146566000x-266422000",</span> <span class="pre">"-56880000x-172310000",</span> <span class="pre">"rectangle")</span></code> is the value of distance from New York, The United Status to Brasillia, Brasil.</p> |
| 1040 |
<p>Execution example:</p> |
| 1041 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Geo</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">distance</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'distance = geo_distance("143660000x419009000", "135960000x-440760000", "rectangle")'</span> |
| 1042 |
<span class="c1"># [</span> |
| 1043 |
<span class="c1"># [</span> |
| 1044 |
<span class="c1"># 0,</span> |
| 1045 |
<span class="c1"># 1337566253.89858,</span> |
| 1046 |
<span class="c1"># 0.000355720520019531</span> |
| 1047 |
<span class="c1"># ],</span> |
| 1048 |
<span class="c1"># [</span> |
| 1049 |
<span class="c1"># [</span> |
| 1050 |
<span class="c1"># [</span> |
| 1051 |
<span class="c1"># 1</span> |
| 1052 |
<span class="c1"># ],</span> |
| 1053 |
<span class="c1"># [</span> |
| 1054 |
<span class="c1"># [</span> |
| 1055 |
<span class="c1"># "distance",</span> |
| 1056 |
<span class="c1"># "Int32"</span> |
| 1057 |
<span class="c1"># ]</span> |
| 1058 |
<span class="c1"># ],</span> |
| 1059 |
<span class="c1"># [</span> |
| 1060 |
<span class="c1"># 10475660</span> |
| 1061 |
<span class="c1"># ]</span> |
| 1062 |
<span class="c1"># ]</span> |
| 1063 |
<span class="c1"># ]</span> |
| 1064 |
<span class="c1"># ]</span> |
| 1065 |
</pre></div> |
| 1066 |
</div> |
| 1067 |
<p>This sample shows the value of distance across the date line. |
| 1068 |
The return value of <code class="docutils literal notranslate"><span class="pre">geo_distance("143660000x419009000",</span> <span class="pre">"135960000x-440760000",</span> <span class="pre">"rectangle")</span></code> is the value of distance from Beijin, China to San Francisco, The United States.</p> |
| 1069 |
<div class="admonition note"> |
| 1070 |
<p class="admonition-title">Note</p> |
| 1071 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> uses square approximation as default. If you omit <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code>, <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> behaves like <code class="docutils literal notranslate"><span class="pre">rectangle</span></code> was specified.</p> |
| 1072 |
</div> |
| 1073 |
<div class="admonition note"> |
| 1074 |
<p class="admonition-title">Note</p> |
| 1075 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> accepts the string indicating the coordinate as |
| 1076 |
the value of <code class="docutils literal notranslate"><span class="pre">point1</span></code> when the value of <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code> is |
| 1077 |
<code class="docutils literal notranslate"><span class="pre">"rectangle"</span></code>. |
| 1078 |
If you specified the string indicating the coordinate as the value |
| 1079 |
of <code class="docutils literal notranslate"><span class="pre">point1</span></code> with <code class="docutils literal notranslate"><span class="pre">sphere</span></code> or <code class="docutils literal notranslate"><span class="pre">ellipsoid</span></code>, <code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> |
| 1080 |
returns 0 as the value of distance.</p> |
| 1081 |
</div> |
| 1082 |
</section> |
| 1083 |
<section id="sphere"> |
| 1084 |
<h5><span class="section-number">7.16.6.4.2.1.2. </span><code class="docutils literal notranslate"><span class="pre">sphere</span></code><a class="headerlink" href="#sphere" title="Link to this heading">#</a></h5> |
| 1085 |
<p>This parameter require to approximate the geographical features |
| 1086 |
by spherical approximation for calculating the distance.</p> |
| 1087 |
<p>It is slower than <code class="docutils literal notranslate"><span class="pre">rectangle</span></code>, but the error of distance becomes |
| 1088 |
smaller than <code class="docutils literal notranslate"><span class="pre">rectangle</span></code>.</p> |
| 1089 |
<p>You can also specify <code class="docutils literal notranslate"><span class="pre">sphr</span></code> as abbrev expression.</p> |
| 1090 |
<p>Here is a sample about calculating the value of distance with column value.</p> |
| 1091 |
<p>Execution example:</p> |
| 1092 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Cities</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">_score</span> <span class="o">--</span><span class="nb">filter</span> <span class="mi">1</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'_score = geo_distance(location, "185428000x-461000", "sphere")'</span> |
| 1093 |
<span class="c1"># [</span> |
| 1094 |
<span class="c1"># [</span> |
| 1095 |
<span class="c1"># 0,</span> |
| 1096 |
<span class="c1"># 1337566253.89858,</span> |
| 1097 |
<span class="c1"># 0.000355720520019531</span> |
| 1098 |
<span class="c1"># ],</span> |
| 1099 |
<span class="c1"># [</span> |
| 1100 |
<span class="c1"># [</span> |
| 1101 |
<span class="c1"># [</span> |
| 1102 |
<span class="c1"># 1</span> |
| 1103 |
<span class="c1"># ],</span> |
| 1104 |
<span class="c1"># [</span> |
| 1105 |
<span class="c1"># [</span> |
| 1106 |
<span class="c1"># "_score",</span> |
| 1107 |
<span class="c1"># "Int32"</span> |
| 1108 |
<span class="c1"># ]</span> |
| 1109 |
<span class="c1"># ],</span> |
| 1110 |
<span class="c1"># [</span> |
| 1111 |
<span class="c1"># 5558225</span> |
| 1112 |
<span class="c1"># ]</span> |
| 1113 |
<span class="c1"># ]</span> |
| 1114 |
<span class="c1"># ]</span> |
| 1115 |
<span class="c1"># ]</span> |
| 1116 |
</pre></div> |
| 1117 |
</div> |
| 1118 |
</section> |
| 1119 |
<section id="ellipsoid"> |
| 1120 |
<h5><span class="section-number">7.16.6.4.2.1.3. </span><code class="docutils literal notranslate"><span class="pre">ellipsoid</span></code><a class="headerlink" href="#ellipsoid" title="Link to this heading">#</a></h5> |
| 1121 |
<p>This parameter require to approximate the geographical features |
| 1122 |
by ellipsoid approximation for calculating the distance.</p> |
| 1123 |
<p>It uses the calculation of distance by the formula of Hubeny. |
| 1124 |
It is slower than <code class="docutils literal notranslate"><span class="pre">sphere</span></code>, but the error of distance becomes |
| 1125 |
smaller than <code class="docutils literal notranslate"><span class="pre">sphere</span></code>.</p> |
| 1126 |
<p>You can also specify <code class="docutils literal notranslate"><span class="pre">ellip</span></code> as abbrev expression.</p> |
| 1127 |
<p>Here is a sample about calculating the value of distance with column value.</p> |
| 1128 |
<p>Execution example:</p> |
| 1129 |
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">select</span> <span class="n">Cities</span> <span class="o">--</span><span class="n">output_columns</span> <span class="n">_score</span> <span class="o">--</span><span class="nb">filter</span> <span class="mi">1</span> <span class="o">--</span><span class="n">scorer</span> <span class="s1">'_score = geo_distance(location, "185428000x-461000", "ellipsoid")'</span> |
| 1130 |
<span class="c1"># [</span> |
| 1131 |
<span class="c1"># [</span> |
| 1132 |
<span class="c1"># 0,</span> |
| 1133 |
<span class="c1"># 1337566253.89858,</span> |
| 1134 |
<span class="c1"># 0.000355720520019531</span> |
| 1135 |
<span class="c1"># ],</span> |
| 1136 |
<span class="c1"># [</span> |
| 1137 |
<span class="c1"># [</span> |
| 1138 |
<span class="c1"># [</span> |
| 1139 |
<span class="c1"># 1</span> |
| 1140 |
<span class="c1"># ],</span> |
| 1141 |
<span class="c1"># [</span> |
| 1142 |
<span class="c1"># [</span> |
| 1143 |
<span class="c1"># "_score",</span> |
| 1144 |
<span class="c1"># "Int32"</span> |
| 1145 |
<span class="c1"># ]</span> |
| 1146 |
<span class="c1"># ],</span> |
| 1147 |
<span class="c1"># [</span> |
| 1148 |
<span class="c1"># 5836138</span> |
| 1149 |
<span class="c1"># ]</span> |
| 1150 |
<span class="c1"># ]</span> |
| 1151 |
<span class="c1"># ]</span> |
| 1152 |
<span class="c1"># ]</span> |
| 1153 |
</pre></div> |
| 1154 |
</div> |
| 1155 |
</section> |
| 1156 |
</section> |
| 1157 |
</section> |
| 1158 |
</section> |
| 1159 |
<section id="return-value"> |
| 1160 |
<h2><span class="section-number">7.16.6.5. </span>Return value<a class="headerlink" href="#return-value" title="Link to this heading">#</a></h2> |
| 1161 |
<p><code class="docutils literal notranslate"><span class="pre">geo_distance</span></code> returns the value of distance in float type. |
| 1162 |
The unit of return value is meter.</p> |
| 1163 |
<p class="rubric">Footnote</p> |
| 1164 |
<aside class="footnote-list brackets"> |
| 1165 |
<aside class="footnote brackets" id="id2" role="doc-footnote"> |
| 1166 |
<span class="label"><span class="fn-bracket">[</span><a role="doc-backlink" href="#id1">1</a><span class="fn-bracket">]</span></span> |
| 1167 |
<p>You can specify whether TokyoGeoPoint or WGS84GeoPoint.</p> |
| 1168 |
</aside> |
| 1169 |
</aside> |
| 1170 |
</section> |
| 1171 |
</section> |
| 1172 |
|
| 1173 |
|
| 1174 |
</article> |
| 1175 |
|
| 1176 |
|
| 1177 |
|
| 1178 |
|
| 1179 |
|
| 1180 |
<footer class="prev-next-footer d-print-none"> |
| 1181 |
|
| 1182 |
<div class="prev-next-area"> |
| 1183 |
<a class="left-prev" |
| 1184 |
href="fuzzy_search.html" |
| 1185 |
title="previous page"> |
| 1186 |
<i class="fa-solid fa-angle-left"></i> |
| 1187 |
<div class="prev-next-info"> |
| 1188 |
<p class="prev-next-subtitle">previous</p> |
| 1189 |
<p class="prev-next-title"><span class="section-number">7.16.5. </span><code class="docutils literal notranslate"><span class="pre">fuzzy_search</span></code></p> |
| 1190 |
</div> |
| 1191 |
</a> |
| 1192 |
<a class="right-next" |
| 1193 |
href="geo_in_circle.html" |
| 1194 |
title="next page"> |
| 1195 |
<div class="prev-next-info"> |
| 1196 |
<p class="prev-next-subtitle">next</p> |
| 1197 |
<p class="prev-next-title"><span class="section-number">7.16.7. </span>geo_in_circle</p> |
| 1198 |
</div> |
| 1199 |
<i class="fa-solid fa-angle-right"></i> |
| 1200 |
</a> |
| 1201 |
</div> |
| 1202 |
</footer> |
| 1203 |
|
| 1204 |
</div> |
| 1205 |
|
| 1206 |
|
| 1207 |
|
| 1208 |
<dialog id="pst-secondary-sidebar-modal"></dialog> |
| 1209 |
<div id="pst-secondary-sidebar" class="bd-sidebar-secondary bd-toc"><div class="sidebar-secondary-items sidebar-secondary__inner"> |
| 1210 |
|
| 1211 |
|
| 1212 |
<div class="sidebar-secondary-item"> |
| 1213 |
<div |
| 1214 |
id="pst-page-navigation-heading-2" |
| 1215 |
class="page-toc tocsection onthispage"> |
| 1216 |
<i class="fa-solid fa-list"></i> On this page |
| 1217 |
</div> |
| 1218 |
<nav id="pst-page-toc-nav" class="page-toc" aria-labelledby="pst-page-navigation-heading-2"> |
| 1219 |
<ul class="pst-show_toc_level nav section-nav flex-column"> |
| 1220 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#summary">7.16.6.1. Summary</a></li> |
| 1221 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#syntax">7.16.6.2. Syntax</a></li> |
| 1222 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#usage">7.16.6.3. Usage</a><ul class="nav section-nav flex-column"> |
| 1223 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#using-the-column-value-of-location">7.16.6.3.1. Using the column value of location</a></li> |
| 1224 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#using-the-explicitly-specified-value-of-location">7.16.6.3.2. Using the explicitly specified value of location</a></li> |
| 1225 |
</ul> |
| 1226 |
</li> |
| 1227 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#parameters">7.16.6.4. Parameters</a><ul class="nav section-nav flex-column"> |
| 1228 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#required-parameters">7.16.6.4.1. Required parameters</a><ul class="nav section-nav flex-column"> |
| 1229 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#point1">7.16.6.4.1.1. <code class="docutils literal notranslate"><span class="pre">point1</span></code></a></li> |
| 1230 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#point2">7.16.6.4.1.2. <code class="docutils literal notranslate"><span class="pre">point2</span></code></a></li> |
| 1231 |
</ul> |
| 1232 |
</li> |
| 1233 |
<li class="toc-h3 nav-item toc-entry"><a class="reference internal nav-link" href="#optional-parameter">7.16.6.4.2. Optional parameter</a><ul class="nav section-nav flex-column"> |
| 1234 |
<li class="toc-h4 nav-item toc-entry"><a class="reference internal nav-link" href="#approximate-type">7.16.6.4.2.1. <code class="docutils literal notranslate"><span class="pre">approximate_type</span></code></a><ul class="nav section-nav flex-column"> |
| 1235 |
<li class="toc-h5 nav-item toc-entry"><a class="reference internal nav-link" href="#rectangle">7.16.6.4.2.1.1. <code class="docutils literal notranslate"><span class="pre">rectangle</span></code></a></li> |
| 1236 |
<li class="toc-h5 nav-item toc-entry"><a class="reference internal nav-link" href="#sphere">7.16.6.4.2.1.2. <code class="docutils literal notranslate"><span class="pre">sphere</span></code></a></li> |
| 1237 |
<li class="toc-h5 nav-item toc-entry"><a class="reference internal nav-link" href="#ellipsoid">7.16.6.4.2.1.3. <code class="docutils literal notranslate"><span class="pre">ellipsoid</span></code></a></li> |
| 1238 |
</ul> |
| 1239 |
</li> |
| 1240 |
</ul> |
| 1241 |
</li> |
| 1242 |
</ul> |
| 1243 |
</li> |
| 1244 |
<li class="toc-h2 nav-item toc-entry"><a class="reference internal nav-link" href="#return-value">7.16.6.5. Return value</a></li> |
| 1245 |
</ul> |
| 1246 |
</nav></div> |
| 1247 |
|
| 1248 |
<div class="sidebar-secondary-item"> |
| 1249 |
|
| 1250 |
|
| 1251 |
<div class="tocsection editthispage"> |
| 1252 |
<a href="https://github.com/groonga/groonga/edit/main/doc/source/reference/functions/geo_distance.rst"> |
| 1253 |
<i class="fa-solid fa-pencil"></i> |
| 1254 |
|
| 1255 |
|
| 1256 |
|
| 1257 |
Edit on GitHub |
| 1258 |
|
| 1259 |
|
| 1260 |
</a> |
| 1261 |
</div> |
| 1262 |
</div> |
| 1263 |
|
| 1264 |
</div></div> |
| 1265 |
|
| 1266 |
|
| 1267 |
</div> |
| 1268 |
<footer class="bd-footer-content"> |
| 1269 |
|
| 1270 |
</footer> |
| 1271 |
|
| 1272 |
</main> |
| 1273 |
</div> |
| 1274 |
</div> |
| 1275 |
|
| 1276 |
|
| 1277 |
<script defer src="../../_static/scripts/bootstrap.js?digest=90905a2f556bf617f1a9"></script> |
| 1278 |
<script defer src="../../_static/scripts/pydata-sphinx-theme.js?digest=90905a2f556bf617f1a9"></script> |
| 1279 |
|
| 1280 |
<footer class="bd-footer"> |
| 1281 |
<div class="bd-footer__inner bd-page-width"> |
| 1282 |
|
| 1283 |
<div class="footer-items__start"> |
| 1284 |
|
| 1285 |
<div class="footer-item"> |
| 1286 |
|
| 1287 |
<p class="copyright"> |
| 1288 |
|
| 1289 |
© Copyright 2009-2026 Groonga Project. |
| 1290 |
<br/> |
| 1291 |
|
| 1292 |
</p> |
| 1293 |
</div> |
| 1294 |
|
| 1295 |
</div> |
| 1296 |
|
| 1297 |
|
| 1298 |
|
| 1299 |
<div class="footer-items__end"> |
| 1300 |
|
| 1301 |
<div class="footer-item"> |
| 1302 |
<p class="theme-version"> |
| 1303 |
|
| 1304 |
Built with the <a href="https://pydata-sphinx-theme.readthedocs.io/en/stable/index.html">PyData Sphinx Theme</a> 0.20.0. |
| 1305 |
</p></div> |
| 1306 |
|
| 1307 |
</div> |
| 1308 |
|
| 1309 |
</div> |
| 1310 |
|
| 1311 |
</footer> |
| 1312 |
</body> |
| 1313 |
</html> |