10#if !defined(GEOGRAPHICLIB_GEOHASH_HPP)
11#define GEOGRAPHICLIB_GEOHASH_HPP 1
17# pragma warning (push)
18# pragma warning (disable: 4251)
43 static const int maxlen_ = 18;
44 static const unsigned long long mask_ = 1ULL << 45;
45 static const char*
const lcdigits_;
46 static const char*
const ucdigits_;
67 static void Forward(real lat, real lon,
int len, std::string& geohash);
88 static void Reverse(
const std::string& geohash, real& lat, real& lon,
89 int& len,
bool centerp =
true);
101 len = (std::max)(0, (std::min)(int(maxlen_), len));
115 len = (std::max)(0, (std::min)(int(maxlen_), len));
129 using std::fabs; res = fabs(res);
130 for (
int len = 0; len < maxlen_; ++len)
131 if (LongitudeResolution(len) <= res)
147 latres = fabs(latres);
148 lonres = fabs(lonres);
149 for (
int len = 0; len < maxlen_; ++len)
150 if (LatitudeResolution(len) <= latres &&
151 LongitudeResolution(len) <= lonres)
168 using std::floor;
using std::log;
169 return -int(floor(log(LatitudeResolution(len))/log(
Math::real(10))));
177# pragma warning (pop)
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
Conversions for geohashes.
static Math::real LatitudeResolution(int len)
static int DecimalPrecision(int len)
static Math::real LongitudeResolution(int len)
static int GeohashLength(real latres, real lonres)
static int GeohashLength(real res)
@ hd
degrees per half turn
Namespace for GeographicLib.