Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
redis
Commits
bb43f4ca
Commit
bb43f4ca
authored
May 30, 2016
by
antirez
Browse files
Fix GEORADIUS wrong output with radius > Earth radius.
Close #3266
parent
16102bc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
deps/geohash-int/geohash_helper.c
View file @
bb43f4ca
...
...
@@ -89,6 +89,8 @@ int geohashBoundingBox(double longitude, double latitude, double radius_meters,
lonr
=
deg_rad
(
longitude
);
latr
=
deg_rad
(
latitude
);
if
(
radius_meters
>
EARTH_RADIUS_IN_METERS
)
radius_meters
=
EARTH_RADIUS_IN_METERS
;
double
distance
=
radius_meters
/
EARTH_RADIUS_IN_METERS
;
double
min_latitude
=
latr
-
distance
;
double
max_latitude
=
latr
+
distance
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment