Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix issue #220 georadius #223

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

fix issue #220 georadius #223

wants to merge 1 commit into from

Conversation

lhpqaq
Copy link
Contributor

@lhpqaq lhpqaq commented Jul 4, 2024

可能修复#220 georadius是错误的
正在学习,不是特别的清楚georadius的原理。还是说问题出在别的地方?
修改前:
image
修改后:
image

@HDT3213
Copy link
Owner

HDT3213 commented Jul 8, 2024

等我先看一下 redis 怎么处理这个问题的

@lhpqaq
Copy link
Contributor Author

lhpqaq commented Jul 17, 2024

等我先看一下 redis 怎么处理这个问题的

我看了下您博客里引用的redis-4.0
georadiusGeneric在间接调用了geohashNeighbors之后,会经过 membersOfAllNeighbors -> membersOfGeoHashBox -> geoGetPointsInRange -> geoAppendIfWithinRadius -> geohashGetDistanceIfInRadiusWGS84 到下面这个函数:

int geohashGetDistanceIfInRadius(double x1, double y1,
                                 double x2, double y2, double radius,
                                 double *distance) {
    *distance = geohashGetDistance(x1, y1, x2, y2);
    if (*distance > radius) return 0;
    return 1;
}

@lhpqaq
Copy link
Contributor Author

lhpqaq commented Aug 26, 2024

还需要吗这个吗?

@lhpqaq lhpqaq marked this pull request as draft September 5, 2024 15:48
@lhpqaq lhpqaq marked this pull request as ready for review September 10, 2024 06:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants