Unverified Commit 40d5df65 authored by Salvatore Sanfilippo's avatar Salvatore Sanfilippo Committed by GitHub
Browse files

Merge pull request #5008 from zwkno1/unstable

fix geohashEncode bug when step > 30
parents 8bc3ffcb 76596198
...@@ -144,8 +144,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range, ...@@ -144,8 +144,8 @@ int geohashEncode(const GeoHashRange *long_range, const GeoHashRange *lat_range,
(longitude - long_range->min) / (long_range->max - long_range->min); (longitude - long_range->min) / (long_range->max - long_range->min);
/* convert to fixed point based on the step size */ /* convert to fixed point based on the step size */
lat_offset *= (1 << step); lat_offset *= (1ULL << step);
long_offset *= (1 << step); long_offset *= (1ULL << step);
hash->bits = interleave64(lat_offset, long_offset); hash->bits = interleave64(lat_offset, long_offset);
return 1; return 1;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment