Geo: from lat,lon API to lon,lat API according to GIS standard

The GIS standard and all the major DBs implementing GIS related
functions take coordinates as x,y that is longitude,latitude.
It was a bad start for Redis to do things differently, so even if this
means that existing users of the Geo module will be required to change
their code, Redis now conforms to the standard.

Usually Redis is very backward compatible, but this is not an exception
to this rule, since this is the first Geo implementation entering the
official Redis source code. It is not wise to try to be backward
compatible with code forks... :-)

Close #2637.
This commit is contained in:
antirez
2015-06-25 18:05:45 +02:00
parent 03ce189628
commit fa9d62d34f
7 changed files with 146 additions and 176 deletions

View File

@ -12,8 +12,8 @@ void geoAddCommand(redisClient *c);
/* Structures used inside geo.c in order to represent points and array of
* points on the earth. */
typedef struct geoPoint {
double latitude;
double longitude;
double latitude;
double dist;
double score;
char *member;