Parse data coordinates.
There's several ways to encode data coordinates, who could be mixed inside a single geometrie:
845 for (xa = xnode ; xa != NULL ; xa = xa->next)
847 if (xa->type != XML_ELEMENT_NODE)
continue;
849 if (xa->name == NULL)
continue;
851 if (!strcmp((
char *) xa->name,
"pos"))
854 if (pa == NULL) pa = tmp_pa;
858 else if (!strcmp((
char *) xa->name,
"posList"))
861 if (pa == NULL) pa = tmp_pa;
865 else if (!strcmp((
char *) xa->name,
"coordinates"))
868 if (pa == NULL) pa = tmp_pa;
872 else if (!strcmp((
char *) xa->name,
"coord"))
875 if (pa == NULL) pa = tmp_pa;
879 else if (!strcmp((
char *) xa->name,
"pointRep") ||
880 !strcmp((
char *) xa->name,
"pointProperty"))
884 for (xb = xa->children ; xb != NULL ; xb = xb->next)
886 if (xb->type != XML_ELEMENT_NODE)
continue;
888 if (!strcmp((
char *) xb->name,
"Point"))
894 if (!found || xb == NULL)
898 if (xb == NULL || xb->children == NULL)
902 if (tmp_pa->npoints != 1)
908 else if (srs.
srid != *root_srid)
910 if (pa == NULL) pa = tmp_pa;
915 if (pa == NULL)
gml_lwpgerror(
"invalid GML representation", 32);
static POINTARRAY * parse_gml_poslist(xmlNodePtr xnode, bool *hasz)
Parse gml:posList.
static void gml_lwpgerror(char *msg, int error_code)
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_coord(xmlNodePtr xnode, bool *hasz)
Parse gml:coord.
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.
#define SRID_UNKNOWN
Unknown SRID value.
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 * 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. ...
POINTARRAY * ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2)
Merge two given POINTARRAY and returns a pointer on the new aggregate one.