81 xmlNodePtr xmlroot=NULL;
84 if (PG_ARGISNULL(0)) PG_RETURN_NULL();
85 xml_input = PG_GETARG_TEXT_P(0);
86 xml = text_to_cstring(xml_input);
87 xml_size = VARSIZE_ANY_EXHDR(xml_input);
91 xmldoc = xmlReadMemory(xml, xml_size, NULL, NULL, XML_PARSE_SAX1);
92 if (!xmldoc || (xmlroot = xmlDocGetRootElement(xmldoc)) == NULL)
96 lwpgerror(
"invalid KML representation");
122 geom = geometry_serialize(lwgeom);
128 PG_RETURN_POINTER(geom);
void lwgeom_free(LWGEOM *geom)
LWGEOM * lwgeom_homogenize(const LWGEOM *geom)
void lwgeom_release(LWGEOM *lwgeom)
Free the containing LWGEOM and the associated BOX.
LWGEOM * lwgeom_force_2d(const LWGEOM *geom)
Strip out the Z/M components of an LWGEOM.
static LWGEOM * parse_kml(xmlNodePtr xnode, bool *hasz)
Parse KML.