Class for geohash encoding / decoding See https://en.wikipedia.org/wiki/Geohash.
More...
#include <geohash.h>
|
| std::string | encode (double lat, double lon, int precision=-1) const |
| |
| std::array< double, 2 > | decode (std::string geohash) const |
| |
Class for geohash encoding / decoding See https://en.wikipedia.org/wiki/Geohash.
Definition at line 34 of file geohash.h.
◆ decode()
| std::array<double, 2> Geohash::decode |
( |
std::string |
geohash | ) |
const |
Decode geohash to latitude/longitude (location is approximate centre of geohash cell, to reasonable precision).
- Parameters
-
| {string} | geohash - Geohash string to be converted to latitude/longitude. |
- Returns
- {lat, lon} (Center of) geohashed location.
- Exceptions
-
◆ encode()
| std::string Geohash::encode |
( |
double |
lat, |
|
|
double |
lon, |
|
|
int |
precision = -1 |
|
) |
| const |
Encodes latitude/longitude to geohash, either to specified precision or to automatically evaluated precision.
- Parameters
-
| {double} | lat - Latitude in degrees. |
| {double} | lon - Longitude in degrees. |
| {int} | [precision] - Number of characters in resulting geohash. |
- Returns
- {string} Geohash of supplied latitude/longitude.
- Exceptions
-
The documentation for this class was generated from the following file: