Calculate the GeoHash (http://geohash.org) string for a geometry.
Caller must free.
Definition at line 868 of file lwalgorithm.c.
871 GBOX gbox_bounds = {0};
882 if ( gbox.
xmin < -180 || gbox.
ymin < -90 || gbox.
xmax > 180 || gbox.
ymax > 90 )
884 lwerror(
"Geohash requires inputs in decimal degrees, got (%g %g, %g %g).",
char result[OUT_DOUBLE_BUFFER_SIZE]
int lwgeom_calculate_gbox_cartesian(const LWGEOM *lwgeom, GBOX *gbox)
Calculate the 2-4D bounding box of a geometry.
void gbox_init(GBOX *gbox)
Zero out all the entries in the GBOX.
int lwgeom_geohash_precision(GBOX bbox, GBOX *bounds)
lwvarlena_t * geohash_point(double longitude, double latitude, int precision)
void void lwerror(const char *fmt,...) __attribute__((format(printf
Write a notice out to the error handler.
References gbox_init(), geohash_point(), LW_FAILURE, lwerror(), lwgeom_calculate_gbox_cartesian(), lwgeom_geohash_precision(), precision, result, GBOX::xmax, GBOX::xmin, GBOX::ymax, and GBOX::ymin.
Referenced by ST_GeoHash(), and test_geohash().