Parse KML Polygon.
406 for (xa = xnode->children ; xa != NULL ; xa = xa->next)
410 if (xa->type != XML_ELEMENT_NODE)
continue;
412 if (strcmp((
char *) xa->name,
"outerBoundaryIs"))
continue;
414 for (xb = xa->children ; xb != NULL ; xb = xb->next)
417 if (xb->type != XML_ELEMENT_NODE)
continue;
419 if (strcmp((
char *) xb->name,
"LinearRing"))
continue;
424 if (ppa[0]->npoints < 4)
425 lwpgerror(
"invalid KML representation");
433 lwpgnotice(
"forced closure on an un-closed KML polygon");
439 if (outer_rings != 1)
440 lwpgerror(
"invalid KML representation");
442 for (ring=1, xa = xnode->children ; xa != NULL ; xa = xa->next)
446 if (xa->type != XML_ELEMENT_NODE)
continue;
448 if (strcmp((
char *) xa->name,
"innerBoundaryIs"))
continue;
450 for (xb = xa->children ; xb != NULL ; xb = xb->next)
453 if (xb->type != XML_ELEMENT_NODE)
continue;
455 if (strcmp((
char *) xb->name,
"LinearRing"))
continue;
460 if (ppa[ring]->npoints < 4)
461 lwpgerror(
"invalid KML representation");
469 lwpgnotice(
"forced closure on an un-closed KML polygon");
477 if (ppa == NULL || ppa[0] == NULL) lwpgerror(
"invalid KML representation");
static bool is_kml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a KML one Return true otherwise. ...
int ptarray_is_closed_3d(const POINTARRAY *pa)
static POINTARRAY * parse_kml_coordinates(xmlNodePtr xnode, bool *hasz)
Parse kml:coordinates.
int ptarray_is_closed_2d(const POINTARRAY *pa)
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, then a duplicate point will not be added.
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
#define LW_TRUE
Return types for functions with status returns.
void * lwrealloc(void *mem, size_t size)
void * lwalloc(size_t size)
int getPoint4d_p(const POINTARRAY *pa, int n, POINT4D *point)