63{
64 StringInfoData si;
65
66 int32 typmod = PG_GETARG_INT32(0);
71
72 POSTGIS_DEBUGF(3, "Got typmod(srid = %d, type = %d, hasz = %d, hasm = %d)", srid, type, hasz, hasm);
73
74
75 if (!(srid || type || hasz || hasm) || typmod < 0)
76 {
77 PG_RETURN_CSTRING(pstrdup(""));
78 }
79
80
81 initStringInfo(&si);
82 appendStringInfoChar(&si, '(');
83
84
85 if (type)
87 else if (srid || hasz || hasm)
88 appendStringInfoString(&si, "Geometry");
89
90
91 if (hasz) appendStringInfoString(&si, "Z");
92
93
94 if (hasm) appendStringInfoString(&si, "M");
95
96
97 if (srid) appendStringInfo(&si, ",%d", srid);
98
99
100 appendStringInfoChar(&si, ')');
101
102 PG_RETURN_CSTRING(si.data);
103}
const char * lwtype_name(uint8_t type)
Return the type name string associated with a type number (e.g.
#define TYPMOD_GET_SRID(typmod)
Macros for manipulating the 'typemod' int.
#define TYPMOD_GET_M(typmod)
#define TYPMOD_GET_TYPE(typmod)
#define TYPMOD_GET_Z(typmod)