PostGIS  2.2.7dev-r@@SVN_REVISION@@
Datum postgis_typmod_dims ( PG_FUNCTION_ARGS  )

Definition at line 384 of file gserialized_typmod.c.

References TYPMOD_GET_M, and TYPMOD_GET_Z.

385 {
386  int32 typmod = PG_GETARG_INT32(0);
387  int32 dims = 2;
388  if ( typmod < 0 )
389  PG_RETURN_NULL(); /* unconstrained */
390  if ( TYPMOD_GET_Z(typmod) )
391  dims++;
392  if ( TYPMOD_GET_M(typmod) )
393  dims++;
394  PG_RETURN_INT32(dims);
395 }
unsigned int int32
Definition: shpopen.c:273
#define TYPMOD_GET_M(typmod)
Definition: liblwgeom.h:155
#define TYPMOD_GET_Z(typmod)
Definition: liblwgeom.h:153