353 static const char *default_prefix =
"";
355 const char *prefix = default_prefix;
358 text *prefix_text = PG_GETARG_TEXT_P(2);
367 if (VARSIZE_ANY_EXHDR(prefix_text) > 0)
370 prefixbuf = palloc(VARSIZE_ANY_EXHDR(prefix_text)+2);
371 memcpy(prefixbuf, VARDATA(prefix_text),
372 VARSIZE_ANY_EXHDR(prefix_text));
374 prefixbuf[VARSIZE_ANY_EXHDR(prefix_text)] =
':';
375 prefixbuf[VARSIZE_ANY_EXHDR(prefix_text)+1] =
'\0';
386 PG_FREE_IF_COPY(g, 0);
391 result = cstring_to_text(kml);
394 PG_RETURN_TEXT_P(result);
LWGEOM * lwgeom_from_gserialized(const GSERIALIZED *g)
Allocate a new LWGEOM from a GSERIALIZED.
void lwgeom_free(LWGEOM *geom)
char * lwgeom_to_kml2(const LWGEOM *geom, int precision, const char *prefix)