117{
119 text *text_ob;
120 char *result;
122 static int maxtyplen = 20;
123
125 text_ob = palloc0(VARHDRSZ + maxtyplen);
126 result = VARDATA(text_ob);
127
129
131 strcpy(result,"POINT");
133 strcpy(result,"MULTIPOINT");
135 strcpy(result,"LINESTRING");
137 strcpy(result,"CIRCULARSTRING");
139 strcpy(result, "COMPOUNDCURVE");
141 strcpy(result,"MULTILINESTRING");
143 strcpy(result, "MULTICURVE");
145 strcpy(result,"POLYGON");
147 strcpy(result,"TRIANGLE");
149 strcpy(result,"CURVEPOLYGON");
151 strcpy(result,"MULTIPOLYGON");
153 strcpy(result, "MULTISURFACE");
155 strcpy(result,"GEOMETRYCOLLECTION");
157 strcpy(result,"POLYHEDRALSURFACE");
159 strcpy(result,"TIN");
160 else
161 strcpy(result,"UNKNOWN");
162
164 strcat(result, "M");
165
166 SET_VARSIZE(text_ob, strlen(result) + VARHDRSZ);
167
168 PG_FREE_IF_COPY(gser, 0);
169
170 PG_RETURN_TEXT_P(text_ob);
171}
int gserialized_has_m(const GSERIALIZED *g)
Check if a GSERIALIZED has an M ordinate.
int gserialized_has_z(const GSERIALIZED *g)
Check if a GSERIALIZED has a Z ordinate.
uint32_t gserialized_get_type(const GSERIALIZED *g)
Extract the geometry type from the serialized form (it hides in the anonymous data area,...
uint32_t gserialized_max_header_size(void)
Returns the size in bytes to read from toast to get the basic information from a geometry: GSERIALIZE...
#define POINTTYPE
LWTYPE numbers, used internally by PostGIS.
#define POLYHEDRALSURFACETYPE