Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the geolocation support of Redis

2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article introduces you what the geographic location support of Redis is, and the content is very detailed. Interested friends can refer to it and hope to be helpful to you.

The biggest feature added in the redis3.2 version is support for GEO (geolocation)

The map aspect of the current business is to call Gaud api (cloud map). There will be some delay in the request, while redsigeo can find the nearby terminal and measure the straight line distance between the two points (with error).

1. Geoadd: increase the coordinates of a geographical location.

2. Geopos: get the coordinates of a geographical location.

3. Geodist: get the distance between two geographical locations.

4. Georadius: get the collection of geographic locations within the specified range according to the given geographic location coordinates.

5. Georadiusbymember: get a collection of geographic locations within a specified range according to a given geographic location.

6. Geohash: get the geohash value of a geographic location.

Geoadd

Geoadd is used to increase the coordinates of geographic locations. You can add geographic locations in batches. The command format is as follows:

GEOADDkeylongitudelatitudemember [longitudelatitudemember...]

Key identifies a collection of geographic locations. Longitudelatitudemember identifies the coordinates of a geographic location. Longitude is the longitude of a geographical location, and latitude is the latitude of a geographical location. Member is the name of the geographic location. GEOADD can add a batch of geolocations to the collection in bulk.

Geopos

Geopos can obtain the coordinates of geographical locations, and can obtain the coordinates of multiple geographical locations in batches. The command format is as follows:

GEOPOSkeymember [member...]

Geodist

Geodist is used to obtain the distance between two geographic locations. The command format is as follows:

GEODISTkeymember1member2 [m | km | ft | mi]

Units can be specified in the following four types:

M: meters, the default distance unit is meters, if you do not pass this parameter, the unit is meters.

Km: km.

Mi: miles.

Ft: feet.

About how the geographic location support of Redis is shared here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report