10#if !defined(GEOGRAPHICLIB_GEOHASH_HPP)
11#define GEOGRAPHICLIB_GEOHASH_HPP 1
37 static const int maxlen_ = 18;
38 static const unsigned long long mask_ = 1ULL << 45;
39 static const char*
const lcdigits_;
40 static const char*
const ucdigits_;
61 static void Forward(real lat, real lon,
int len, std::string& geohash);
82 static void Reverse(
const std::string& geohash, real& lat, real& lon,
83 int& len,
bool centerp =
true);
95 len = (std::max)(0, (std::min)(
int(maxlen_), len));
109 len = (std::max)(0, (std::min)(
int(maxlen_), len));
123 using std::fabs; res = fabs(res);
124 for (
int len = 0; len < maxlen_; ++len)
141 latres = fabs(latres);
142 lonres = fabs(lonres);
143 for (
int len = 0; len < maxlen_; ++len)
162 using std::floor;
using std::log;
Header for GeographicLib::Constants class.
#define GEOGRAPHICLIB_EXPORT
GeographicLib::Math::real real
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 void Forward(real lat, real lon, int len, std::string &geohash)
static void Reverse(const std::string &geohash, real &lat, real &lon, int &len, bool centerp=true)
static int GeohashLength(real res)
static constexpr int td
degrees per turn
static constexpr int hd
degrees per half turn
Namespace for GeographicLib.