Definition at line 729 of file lwalgorithm.c.
738 size_t hashlen = strlen(geohash);
746 char c = tolower(geohash[i]);
749 char *base32_pos = strchr(
base32, c);
752 lwerror(
"%s: Invalid character '%c'", __func__, geohash[i]);
755 char cd = base32_pos -
base32;
757 for (
size_t j = 0; j < 5; j++)
759 const char bits[] = {16, 8, 4, 2, 1};
763 lon[!(cd & mask)] = (lon[0] + lon[1]) / 2;
767 lat[!(cd & mask)] = (lat[0] + lat[1]) / 2;
void lwerror(const char *fmt,...)
Write a notice out to the error handler.
References base32, lwerror(), and precision.
Referenced by parse_geohash(), and test_geohash_bbox().