Parse data coordinates.
There's several ways to encode data coordinates, who could be mixed inside a single geometrie:
852 for (xa = xnode ; xa != NULL ; xa = xa->next)
854 if (xa->type != XML_ELEMENT_NODE)
continue;
856 if (xa->name == NULL)
continue;
858 if (!strcmp((
char *) xa->name,
"pos"))
861 if (pa == NULL) pa = tmp_pa;
865 else if (!strcmp((
char *) xa->name,
"posList"))
868 if (pa == NULL) pa = tmp_pa;
872 else if (!strcmp((
char *) xa->name,
"coordinates"))
875 if (pa == NULL) pa = tmp_pa;
879 else if (!strcmp((
char *) xa->name,
"coord"))
882 if (pa == NULL) pa = tmp_pa;
886 else if (!strcmp((
char *) xa->name,
"pointRep") ||
887 !strcmp((
char *) xa->name,
"pointProperty"))
891 for (xb = xa->children ; xb != NULL ; xb = xb->next)
893 if (xb->type != XML_ELEMENT_NODE)
continue;
895 if (!strcmp((
char *) xb->name,
"Point"))
901 if (!found || xb == NULL)
905 if (xb == NULL || xb->children == NULL)
909 if (tmp_pa->npoints != 1)
915 else if (srs.
srid != *root_srid)
917 if (pa == NULL) pa = tmp_pa;
922 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, int srid_in, int srid_out)
Use Proj4 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.