PostGIS 3.7.0dev-r@@SVN_REVISION@@
Loading...
Searching...
No Matches

◆ ST_GeoHash()

Datum ST_GeoHash ( PG_FUNCTION_ARGS  )

Definition at line 2909 of file lwgeom_functions_basic.c.

2910{
2911
2912 GSERIALIZED *geom = NULL;
2913 int precision = 0;
2914 lwvarlena_t *geohash = NULL;
2915
2916 if (PG_ARGISNULL(0))
2917 {
2918 PG_RETURN_NULL();
2919 }
2920
2921 geom = PG_GETARG_GSERIALIZED_P(0);
2922
2923 if (!PG_ARGISNULL(1))
2924 {
2925 precision = PG_GETARG_INT32(1);
2926 }
2927
2929 if (geohash)
2930 PG_RETURN_TEXT_P(geohash);
2931 PG_RETURN_NULL();
2932}
static uint8_t precision
Definition cu_in_twkb.c:25
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
lwvarlena_t * lwgeom_geohash(const LWGEOM *lwgeom, int precision)
Calculate the GeoHash (http://geohash.org) string for a geometry.

References lwgeom_from_gserialized(), lwgeom_geohash(), and precision.

Here is the call graph for this function: