mirror of
http://github.com/valkey-io/valkey
synced 2024-11-22 18:54:58 +00:00
FIX: truncate max/min longitude,latitude related geo_point (ex: {180, 85.05112878} )
This commit is contained in:
parent
e5b9eb8171
commit
a7ee3c3e77
@ -206,7 +206,11 @@ int geohashDecodeWGS84(const GeoHashBits hash, GeoHashArea *area) {
|
||||
int geohashDecodeAreaToLongLat(const GeoHashArea *area, double *xy) {
|
||||
if (!xy) return 0;
|
||||
xy[0] = (area->longitude.min + area->longitude.max) / 2;
|
||||
if (xy[0] > GEO_LONG_MAX) xy[0] = GEO_LONG_MAX;
|
||||
if (xy[0] < GEO_LONG_MIN) xy[0] = GEO_LONG_MIN;
|
||||
xy[1] = (area->latitude.min + area->latitude.max) / 2;
|
||||
if (xy[1] > GEO_LAT_MAX) xy[1] = GEO_LAT_MAX;
|
||||
if (xy[1] < GEO_LAT_MIN) xy[1] = GEO_LAT_MIN;
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user