PostGIS  3.1.6dev-r@@SVN_REVISION@@

◆ postgis_typmod_type()

Datum postgis_typmod_type ( PG_FUNCTION_ARGS  )

Definition at line 389 of file gserialized_typmod.c.

390 {
391  int32 typmod = PG_GETARG_INT32(0);
392  int32 type = TYPMOD_GET_TYPE(typmod);
393  char *s = (char*)palloc(64);
394  char *ptr = s;
395  text *stext;
396 
397  /* Has type? */
398  if ( typmod < 0 || type == 0 )
399  ptr += sprintf(ptr, "Geometry");
400  else
401  ptr += sprintf(ptr, "%s", lwtype_name(type));
402 
403  /* Has Z? */
404  if ( typmod >= 0 && TYPMOD_GET_Z(typmod) )
405  ptr += sprintf(ptr, "%s", "Z");
406 
407  /* Has M? */
408  if ( typmod >= 0 && TYPMOD_GET_M(typmod) )
409  ptr += sprintf(ptr, "%s", "M");
410 
411  stext = cstring_to_text(s);
412  pfree(s);
413  PG_RETURN_TEXT_P(stext);
414 }
char * s
Definition: cu_in_wkt.c:23
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:212
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:216
#define TYPMOD_GET_TYPE(typmod)
Definition: liblwgeom.h:208
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:210
type
Definition: ovdump.py:42
unsigned int int32
Definition: shpopen.c:54

References lwtype_name(), s, ovdump::type, TYPMOD_GET_M, TYPMOD_GET_TYPE, and TYPMOD_GET_Z.

Here is the call graph for this function: