PostGIS  2.5.7dev-r@@SVN_REVISION@@

◆ postgis_typmod_type()

Datum postgis_typmod_type ( PG_FUNCTION_ARGS  )

Definition at line 360 of file gserialized_typmod.c.

361 {
362  int32 typmod = PG_GETARG_INT32(0);
363  int32 type = TYPMOD_GET_TYPE(typmod);
364  char *s = (char*)palloc(64);
365  char *ptr = s;
366  text *stext;
367 
368  /* Has type? */
369  if ( typmod < 0 || type == 0 )
370  ptr += sprintf(ptr, "Geometry");
371  else
372  ptr += sprintf(ptr, "%s", lwtype_name(type));
373 
374  /* Has Z? */
375  if ( typmod >= 0 && TYPMOD_GET_Z(typmod) )
376  ptr += sprintf(ptr, "%s", "Z");
377 
378  /* Has M? */
379  if ( typmod >= 0 && TYPMOD_GET_M(typmod) )
380  ptr += sprintf(ptr, "%s", "M");
381 
382  stext = cstring_to_text(s);
383  pfree(s);
384  PG_RETURN_TEXT_P(stext);
385 }
char * s
Definition: cu_in_wkt.c:23
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:171
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
Definition: lwutil.c:218
#define TYPMOD_GET_TYPE(typmod)
Definition: liblwgeom.h:167
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:169
type
Definition: ovdump.py:41
unsigned int int32
Definition: shpopen.c:273

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

Here is the call graph for this function: