1139 if (xnode->children == NULL)
1144 for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1148 if (xa->type != XML_ELEMENT_NODE)
continue;
1150 if (strcmp((
char *) xa->name,
"outerBoundaryIs") &&
1151 strcmp((
char *) xa->name,
"exterior"))
continue;
1153 for (xb = xa->children ; xb != NULL ; xb = xb->next)
1155 if (xb->type != XML_ELEMENT_NODE)
continue;
1157 if (strcmp((
char *) xb->name,
"LinearRing"))
continue;
1162 if (ppa[0]->npoints < 4
1175 for (ring=1, xa = xnode->children ; xa != NULL ; xa = xa->next)
1179 if (xa->type != XML_ELEMENT_NODE)
continue;
1181 if (strcmp((
char *) xa->name,
"innerBoundaryIs") &&
1182 strcmp((
char *) xa->name,
"interior"))
continue;
1184 for (xb = xa->children ; xb != NULL ; xb = xb->next)
1186 if (xb->type != XML_ELEMENT_NODE)
continue;
1188 if (strcmp((
char *) xb->name,
"LinearRing"))
continue;
1194 if (ppa[ring]->npoints < 4
1205 if (ppa == NULL || ppa[0] == NULL)
gml_lwpgerror(
"invalid GML representation", 44);
1209 for (i=0 ; i < ring ; i++)
static void gml_lwpgerror(char *msg, int error_code)
static void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
int ptarray_is_closed_3d(const POINTARRAY *pa)
int ptarray_is_closed_2d(const POINTARRAY *pa)
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
static POINTARRAY * gml_reproject_pa(POINTARRAY *pa, int srid_in, int srid_out)
Use Proj4 to reproject a given POINTARRAY.
POINTARRAY * ptarray_flip_coordinates(POINTARRAY *pa)
Reverse X and Y axis on a given POINTARRAY.
static xmlNodePtr get_xlink_node(xmlNodePtr xnode)
Return a xmlNodePtr on a node referenced by a XLink or NULL otherwise.
LWPOLY * lwpoly_construct(int srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
#define SRID_UNKNOWN
Unknown SRID value.
static bool is_xlink(xmlNodePtr node)
Return true if current node contains a simple XLink Return false otherwise.
static POINTARRAY * parse_gml_data(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse data coordinates.
static bool is_gml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a GML one Return true otherwise. ...
void * lwrealloc(void *mem, size_t size)
LWPOLY * lwpoly_construct_empty(int srid, char hasz, char hasm)
void * lwalloc(size_t size)