Parse KML Polygon. 
  401         for (xa = xnode->children ; xa != NULL ; xa = xa->next)
 
  405                 if (xa->type != XML_ELEMENT_NODE) 
continue;
 
  407                 if (strcmp((
char *) xa->name, 
"outerBoundaryIs")) 
continue;
 
  409                 for (xb = xa->children ; xb != NULL ; xb = xb->next)
 
  412                         if (xb->type != XML_ELEMENT_NODE) 
continue;
 
  414                         if (strcmp((
char *) xb->name, 
"LinearRing")) 
continue;
 
  419                         if (ppa[0]->npoints < 4)
 
  420                                 lwpgerror(
"invalid KML representation");
 
  428                                 lwpgnotice(
"forced closure on an un-closed KML polygon");
 
  434         if (outer_rings != 1)
 
  435                 lwpgerror(
"invalid KML representation");
 
  437         for (ring=1, xa = xnode->children ; xa != NULL ; xa = xa->next)
 
  441                 if (xa->type != XML_ELEMENT_NODE) 
continue;
 
  443                 if (strcmp((
char *) xa->name, 
"innerBoundaryIs")) 
continue;
 
  445                 for (xb = xa->children ; xb != NULL ; xb = xb->next)
 
  448                         if (xb->type != XML_ELEMENT_NODE) 
continue;
 
  450                         if (strcmp((
char *) xb->name, 
"LinearRing")) 
continue;
 
  455                         if (ppa[ring]->npoints < 4)
 
  456                                 lwpgerror(
"invalid KML representation");
 
  464                                 lwpgnotice(
"forced closure on an un-closed KML polygon");
 
  472         if (ppa == NULL || ppa[0] == NULL) lwpgerror(
"invalid KML representation");
 
int ptarray_is_closed_3d(const POINTARRAY *pa)
void * lwrealloc(void *mem, size_t size)
int getPoint4d_p(const POINTARRAY *pa, uint32_t n, POINT4D *point)
int ptarray_append_point(POINTARRAY *pa, const POINT4D *pt, int allow_duplicates)
Append a point to the end of an existing POINTARRAY If allow_duplicate is LW_FALSE,...
void * lwalloc(size_t size)
int ptarray_is_closed_2d(const POINTARRAY *pa)
#define LW_TRUE
Return types for functions with status returns.
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
static POINTARRAY * parse_kml_coordinates(xmlNodePtr xnode, bool *hasz)
Parse kml:coordinates.
static bool is_kml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a KML one Return true otherwise.