<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89</id>
	<title>Redis：GEO（地理位置信息） - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.eijux.com/index.php?action=history&amp;feed=atom&amp;title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89"/>
	<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;action=history"/>
	<updated>2026-04-25T08:29:15Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.38.2</generator>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=4448&amp;oldid=prev</id>
		<title>Eijux：​/* Redis：GEO */</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=4448&amp;oldid=prev"/>
		<updated>2021-10-02T16:04:53Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;Redis：GEO&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年10月3日 (日) 00:04的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l4&quot;&gt;第4行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第4行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Redis：GEO ==&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;== Redis：GEO ==&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Redis GEO &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;主要用于存储地理位置信息，并对存储的信息进行操作，该功能在 &lt;/del&gt;Redis 3.2 版本新增。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Redis GEO &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;主要用于'''存储地理位置信息，并对存储的信息进行操作'''。&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;* 该功能在 &lt;/ins&gt;Redis 3.2 版本新增。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br/&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 命令 ===&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;=== 命令 ===&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=3044&amp;oldid=prev</id>
		<title>Eijux：​/* 命令 */</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=3044&amp;oldid=prev"/>
		<updated>2021-05-10T07:44:23Z</updated>

		<summary type="html">&lt;p&gt;&lt;span dir=&quot;auto&quot;&gt;&lt;span class=&quot;autocomment&quot;&gt;命令&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;zh-Hans-CN&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;←上一版本&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;2021年5月10日 (一) 15:44的版本&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l9&quot;&gt;第9行：&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;第9行：&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Redis GEO 操作方法有：&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Redis GEO 操作方法有：&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;{| class=&amp;quot;wikitable&amp;quot;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Option Name &lt;/del&gt;!! &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Description !! Introduced !! Deprecated&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;命令 &lt;/ins&gt;!! &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;描述 &lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|-&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| geoadd || 添加地理位置的坐标。&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| geoadd || 添加地理位置的坐标。&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
	<entry>
		<id>http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=3043&amp;oldid=prev</id>
		<title>Eijux：​建立内容为“category:Redis  __TOC__  == Redis：GEO == Redis GEO 主要用于存储地理位置信息，并对存储的信息进行操作，该功能在 Redis 3.2 版本…”的新页面</title>
		<link rel="alternate" type="text/html" href="http://wiki.eijux.com/index.php?title=Redis%EF%BC%9AGEO%EF%BC%88%E5%9C%B0%E7%90%86%E4%BD%8D%E7%BD%AE%E4%BF%A1%E6%81%AF%EF%BC%89&amp;diff=3043&amp;oldid=prev"/>
		<updated>2021-05-10T07:43:55Z</updated>

		<summary type="html">&lt;p&gt;建立内容为“&lt;a href=&quot;/%E5%88%86%E7%B1%BB:Redis&quot; title=&quot;分类:Redis&quot;&gt;category:Redis&lt;/a&gt;  __TOC__  == Redis：GEO == Redis GEO 主要用于存储地理位置信息，并对存储的信息进行操作，该功能在 Redis 3.2 版本…”的新页面&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;[[category:Redis]]&lt;br /&gt;
&lt;br /&gt;
__TOC__&lt;br /&gt;
&lt;br /&gt;
== Redis：GEO ==&lt;br /&gt;
Redis GEO 主要用于存储地理位置信息，并对存储的信息进行操作，该功能在 Redis 3.2 版本新增。&lt;br /&gt;
&lt;br /&gt;
=== 命令 ===&lt;br /&gt;
Redis GEO 操作方法有：&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! Option Name !! Description !! Introduced !! Deprecated&lt;br /&gt;
|-&lt;br /&gt;
| geoadd || 添加地理位置的坐标。&lt;br /&gt;
|-&lt;br /&gt;
| geopos || 获取地理位置的坐标。&lt;br /&gt;
|-&lt;br /&gt;
| geodist || 计算两个位置之间的距离。&lt;br /&gt;
|-&lt;br /&gt;
| georadius || 根据用户给定的经纬度坐标来获取指定范围内的地理位置集合。&lt;br /&gt;
|-&lt;br /&gt;
| georadiusbymember || 根据储存在位置集合里面的某个地点获取指定范围内的地理位置集合。&lt;br /&gt;
|-&lt;br /&gt;
| geohash || 返回一个或多个位置对象的 geohash 值。&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
=== 示例 ===&lt;br /&gt;
# '''geoadd'''：&lt;br /&gt;
#: 用于存储指定的地理空间位置，可以将一个或多个经度（longitude）、纬度（latitude）、位置名称（member）添加到指定的 key 中。&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEOADD key longitude latitude member [longitude latitude member ...]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#: 示例：以下实例中 key 为 Sicily，位置名称为 Palermo 和 Catania ：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEODIST Sicily Palermo Catania&lt;br /&gt;
&amp;quot;166274.1516&amp;quot;&lt;br /&gt;
redis&amp;gt; GEORADIUS Sicily 15 37 100 km&lt;br /&gt;
1) &amp;quot;Catania&amp;quot;&lt;br /&gt;
redis&amp;gt; GEORADIUS Sicily 15 37 200 km&lt;br /&gt;
1) &amp;quot;Palermo&amp;quot;&lt;br /&gt;
2) &amp;quot;Catania&amp;quot;&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''geopos'''：&lt;br /&gt;
#: geopos 用于从给定的 key 里返回所有指定名称（member）的位置（经度和纬度），不存在的返回 nil。&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEOPOS key member [member ...]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#: 示例：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEOPOS Sicily Palermo Catania NonExisting&lt;br /&gt;
1) 1) &amp;quot;13.36138933897018433&amp;quot;&lt;br /&gt;
   2) &amp;quot;38.11555639549629859&amp;quot;&lt;br /&gt;
2) 1) &amp;quot;15.08726745843887329&amp;quot;&lt;br /&gt;
   2) &amp;quot;37.50266842333162032&amp;quot;&lt;br /&gt;
3) (nil)&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''geodist'''：&lt;br /&gt;
#: geodist 用于返回两个给定位置之间的距离。&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEODIST key member1 member2 [m|km|ft|mi]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#* member1 member2 为两个地理位置。&lt;br /&gt;
#* 最后一个距离单位参数说明：m ：米，默认单位。km ：千米。mi ：英里。ft ：英尺。&lt;br /&gt;
#: 示例，计算 Palermo 与 Catania 之间的距离：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEODIST Sicily Palermo Catania&lt;br /&gt;
&amp;quot;166274.1516&amp;quot;&lt;br /&gt;
redis&amp;gt; GEODIST Sicily Palermo Catania km&lt;br /&gt;
&amp;quot;166.2742&amp;quot;&lt;br /&gt;
redis&amp;gt; GEODIST Sicily Palermo Catania mi&lt;br /&gt;
&amp;quot;103.3182&amp;quot;&lt;br /&gt;
redis&amp;gt; GEODIST Sicily Foo Bar&lt;br /&gt;
(nil)&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''georadius'''：&lt;br /&gt;
#: '''以给定的经纬度为中心'''，返回键包含的位置元素当中，与中心的距离不超过给定最大距离的所有位置元素。&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEORADIUS key longitude latitude radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#* 参数说明：&lt;br /&gt;
#** m ：米，默认单位。&lt;br /&gt;
#** km ：千米。&lt;br /&gt;
#** mi ：英里。&lt;br /&gt;
#** ft ：英尺。&lt;br /&gt;
#** WITHDIST: 在返回位置元素的同时，将位置元素与中心之间的距离也一并返回。&lt;br /&gt;
#** WITHCOORD: 将位置元素的经度和维度也一并返回。&lt;br /&gt;
#** WITHHASH: 以 52 位有符号整数的形式， 返回位置元素经过原始 geohash 编码的有序集合分值。这个选项主要用于底层应用或者调试，实际中的作用并不大。&lt;br /&gt;
#** COUNT 限定返回的记录数。&lt;br /&gt;
#** ASC: 查找结果根据距离从近到远排序。&lt;br /&gt;
#** DESC: 查找结果根据从远到近排序。&lt;br /&gt;
#: 示例：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEORADIUS Sicily 15 37 200 km WITHDIST&lt;br /&gt;
1) 1) &amp;quot;Palermo&amp;quot;&lt;br /&gt;
   2) &amp;quot;190.4424&amp;quot;&lt;br /&gt;
2) 1) &amp;quot;Catania&amp;quot;&lt;br /&gt;
   2) &amp;quot;56.4413&amp;quot;&lt;br /&gt;
redis&amp;gt; GEORADIUS Sicily 15 37 200 km WITHCOORD&lt;br /&gt;
1) 1) &amp;quot;Palermo&amp;quot;&lt;br /&gt;
   2) 1) &amp;quot;13.36138933897018433&amp;quot;&lt;br /&gt;
      2) &amp;quot;38.11555639549629859&amp;quot;&lt;br /&gt;
2) 1) &amp;quot;Catania&amp;quot;&lt;br /&gt;
   2) 1) &amp;quot;15.08726745843887329&amp;quot;&lt;br /&gt;
      2) &amp;quot;37.50266842333162032&amp;quot;&lt;br /&gt;
redis&amp;gt; GEORADIUS Sicily 15 37 200 km WITHDIST WITHCOORD&lt;br /&gt;
1) 1) &amp;quot;Palermo&amp;quot;&lt;br /&gt;
   2) &amp;quot;190.4424&amp;quot;&lt;br /&gt;
   3) 1) &amp;quot;13.36138933897018433&amp;quot;&lt;br /&gt;
      2) &amp;quot;38.11555639549629859&amp;quot;&lt;br /&gt;
2) 1) &amp;quot;Catania&amp;quot;&lt;br /&gt;
   2) &amp;quot;56.4413&amp;quot;&lt;br /&gt;
   3) 1) &amp;quot;15.08726745843887329&amp;quot;&lt;br /&gt;
      2) &amp;quot;37.50266842333162032&amp;quot;&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''georadiusbymember'''：&lt;br /&gt;
#: 和 georadius 命令一样，都可以找出位于指定范围内的元素，但是 georadiusbymember 是'''以给定的位置元素为中心点'''，而不是使用经度和纬度来决定中心点。&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEORADIUSBYMEMBER key member radius m|km|ft|mi [WITHCOORD] [WITHDIST] [WITHHASH] [COUNT count] [ASC|DESC] [STORE key] [STOREDIST key]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#* 参数说明：【同“georadius”】&lt;br /&gt;
#: 示例：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.583333 37.316667 &amp;quot;Agrigento&amp;quot;&lt;br /&gt;
(integer) 1&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEORADIUSBYMEMBER Sicily Agrigento 100 km&lt;br /&gt;
1) &amp;quot;Agrigento&amp;quot;&lt;br /&gt;
2) &amp;quot;Palermo&amp;quot;&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
# '''geohash'''：&lt;br /&gt;
#: 用于获取一个或多个位置元素的 geohash 值。（Redis GEO 使用 geohash 来保存地理位置的坐标）&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
GEOHASH key member [member ...]&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
#: 示例：&lt;br /&gt;
#: &amp;lt;syntaxhighlight lang=&amp;quot;java&amp;quot; highlight=&amp;quot;&amp;quot;&amp;gt;&lt;br /&gt;
redis&amp;gt; GEOADD Sicily 13.361389 38.115556 &amp;quot;Palermo&amp;quot; 15.087269 37.502669 &amp;quot;Catania&amp;quot;&lt;br /&gt;
(integer) 2&lt;br /&gt;
redis&amp;gt; GEOHASH Sicily Palermo Catania&lt;br /&gt;
1) &amp;quot;sqc8b49rny0&amp;quot;&lt;br /&gt;
2) &amp;quot;sqdtr74hyu0&amp;quot;&lt;br /&gt;
redis&amp;gt;&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;/div&gt;</summary>
		<author><name>Eijux</name></author>
	</entry>
</feed>