From 4e9c3027b12b543c8b03d9c92ffd9f148a436469 Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Thu, 18 Feb 2016 15:00:39 -0800 Subject: [PATCH 1/3] Adjusts accuracy for GEODIST --- src/geo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geo.c b/src/geo.c index caa9e1863..855d60644 100644 --- a/src/geo.c +++ b/src/geo.c @@ -767,6 +767,6 @@ void geodistCommand(client *c) { if (!decodeGeohash(score1,xyxy) || !decodeGeohash(score2,xyxy+2)) addReply(c,shared.nullbulk); else - addReplyDouble(c, + addReplyDoubleDistance(c, geohashGetDistance(xyxy[0],xyxy[1],xyxy[2],xyxy[3]) / to_meter); } From 41030ae2dee2d88451cb0bfe6b6a1b72ea0d84eb Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Thu, 18 Feb 2016 15:01:34 -0800 Subject: [PATCH 2/3] Fixes a typo in a comment --- src/geo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/geo.c b/src/geo.c index 855d60644..971fef7b0 100644 --- a/src/geo.c +++ b/src/geo.c @@ -163,7 +163,7 @@ double extractDistanceOrReply(client *c, robj **argv, return distance * to_meters; } -/* The defailt addReplyDouble has too much accuracy. We use this +/* The default addReplyDouble has too much accuracy. We use this * for returning location distances. "5.2145 meters away" is nicer * than "5.2144992818115 meters away." We provide 4 digits after the dot * so that the returned value is decently accurate even when the unit is From b5149f08684b55a11b158e12770d35d78d44b2f4 Mon Sep 17 00:00:00 2001 From: Itamar Haber Date: Thu, 18 Feb 2016 15:11:30 -0800 Subject: [PATCH 3/3] Eliminates engineers near the equator & prime meridian --- src/geo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/geo.c b/src/geo.c index 971fef7b0..8f6e3f645 100644 --- a/src/geo.c +++ b/src/geo.c @@ -588,8 +588,8 @@ void georadiusGeneric(client *c, int type) { if (withcoords) { addReplyMultiBulkLen(c, 2); - addReplyDouble(c, gp->longitude); - addReplyDouble(c, gp->latitude); + addReplyHumanLongDouble(c, gp->longitude); + addReplyHumanLongDouble(c, gp->latitude); } } } else { @@ -726,8 +726,8 @@ void geoposCommand(client *c) { continue; } addReplyMultiBulkLen(c,2); - addReplyDouble(c,xy[0]); - addReplyDouble(c,xy[1]); + addReplyHumanLongDouble(c,xy[0]); + addReplyHumanLongDouble(c,xy[1]); } } }