The coordinates as a two items x,y array (longitude,latitude).Related article: How to Find and Work with a Salesforce Non-Profit Consultant?.The distance from the center as a floating point number, in the same unit specified in the radius.The other information is returned in the following order as successive elements of the sub-array. When additional information is returned as an array of arrays for each item, the first item in the sub-array is always the name of the returned item. If WITHCOORD, WITHDIST or WITHHASH options are specified, the command returns an array of arrays, where each sub-array represents a single item.Without any WITH option specified, the command just returns a linear array like.STOREDIST: Store the items in a sorted set populated with their distance from the center as a floating point number, in the same unit specified in the radius.STORE: Store the items in a sorted set populated with their geospatial information.It is possible to store the results with one of these options: So to query very large areas with a very small COUNT option may be slow even if just a few results are returned.īy default the command returns the items to the client. When ANY is not provided, the command will perform an effort that is proportional to the number of items matching the specified area and sort them, So the results may not be the ones closest to the specified point, but on the other hand, the effort invested by the server is significantly lower. When ANY is provided the command will return as soon as enough matches are found, It is possible to limit the results to the first N matching items by using the COUNT option. DESC: Sort returned items from the farthest to the nearest, relative to the center.īy default all the matching items are returned.ASC: Sort returned items from the nearest to the farthest, relative to the center.Two different sorting methods can be invoked using the following two options: The command default is to return unsorted items. This is only useful for low level hacks or debugging and is otherwise of little interest for the general user. WITHHASH: Also return the raw geohash-encoded sorted set score of the item, in the form of a 52 bit unsigned integer.WITHCOORD: Also return the longitude,latitude coordinates of the matching items. The distance is returned in the same unit as the unit specified as the radius argument of the command. WITHDIST: Also return the distance of the returned items from the specified center.The command optionally returns additional information using the following options: The radius is specified in one of the following units: This allows, for example, to suggest mobile users of an application nearby places. The common use case for this command is to retrieve geospatial items near a specified point not farther than a given amount of meters (or other units). This manual page also covers the GEORADIUS_RO and GEORADIUSBYMEMBER_RO variants (see the section below for more information). Return the members of a sorted set populated with geospatial information using GEOADD, which are within the borders of the area specified with the center location and the maximum distance from the center (the radius). Available since: 3.2.0 Time complexity: O(N+log(M)) where N is the number of elements inside the bounding box of the circular area delimited by center and radius and M is the number of items inside the index. Syntax GEORADIUS key longitude latitude radius
0 Comments
Leave a Reply. |