PostGIS  2.3.8dev-r@@SVN_REVISION@@

◆ box2d_from_geohash()

Datum box2d_from_geohash ( PG_FUNCTION_ARGS  )

Definition at line 77 of file lwgeom_in_geohash.c.

References parse_geohash(), PG_FUNCTION_INFO_V1(), point_from_geohash(), precision, and text2cstring().

Referenced by parse_geohash().

78 {
79  GBOX *box = NULL;
80  text *geohash_input = NULL;
81  char *geohash = NULL;
82  int precision = -1;
83 
84  if (PG_ARGISNULL(0))
85  {
86  PG_RETURN_NULL();
87  }
88 
89  if (!PG_ARGISNULL(1))
90  {
91  precision = PG_GETARG_INT32(1);
92  }
93 
94  geohash_input = PG_GETARG_TEXT_P(0);
95  geohash = text2cstring(geohash_input);
96 
97  box = parse_geohash(geohash, precision);
98 
99  PG_RETURN_POINTER(box);
100 }
char * text2cstring(const text *textptr)
uint8_t precision
Definition: cu_in_twkb.c:25
static GBOX * parse_geohash(char *geohash, int precision)
Here is the call graph for this function:
Here is the caller graph for this function: