Parse data coordinates.
There's several ways to encode data coordinates, who could be mixed inside a single geometrie:
930 for (xa = xnode ; xa != NULL ; xa = xa->next)
932 if (xa->type != XML_ELEMENT_NODE)
continue;
934 if (xa->name == NULL)
continue;
939 if (pa == NULL) pa = tmp_pa;
946 if (pa == NULL) pa = tmp_pa;
953 if (pa == NULL) pa = tmp_pa;
960 if (pa == NULL) pa = tmp_pa;
968 for (xb = xa->children ; xb != NULL ; xb = xb->next)
970 if (xb->type != XML_ELEMENT_NODE)
continue;
978 if (!found || xb == NULL)
982 if (xb == NULL || xb->children == NULL)
986 if (tmp_pa->npoints != 1)
992 else if (srs.
srid != *root_srid)
994 if (pa == NULL) pa = tmp_pa;
999 if (pa == NULL)
gml_lwpgerror(
"invalid GML representation", 32);
#define SRID_UNKNOWN
Unknown SRID value.
POINTARRAY * ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2)
Merge two given POINTARRAY and returns a pointer on the new aggregate one.
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.
static POINTARRAY * parse_gml_pos(xmlNodePtr xnode, bool *hasz)
Parse gml:pos.
static bool is_xlink(xmlNodePtr node)
Return true if current node contains a simple XLink Return false otherwise.
static POINTARRAY * gml_reproject_pa(POINTARRAY *pa, int32_t epsg_in, int32_t epsg_out)
Use Proj to reproject a given POINTARRAY.
static bool is_gml_namespace(xmlNodePtr xnode, bool is_strict)
Return false if current element namespace is not a GML one Return true otherwise.
static void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
static POINTARRAY * parse_gml_coordinates(xmlNodePtr xnode, bool *hasz)
Parse gml:coordinates.
static POINTARRAY * parse_gml_data(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse data coordinates.
static POINTARRAY * parse_gml_coord(xmlNodePtr xnode, bool *hasz)
Parse gml:coord.
static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
static POINTARRAY * parse_gml_poslist(xmlNodePtr xnode, bool *hasz)
Parse gml:posList.
static bool is_gml_element(xmlNodePtr xn, const char *gml_name)