Parse data coordinates.
There's several ways to encode data coordinates, who could be mixed inside a single geometry:
927{
929 xmlNodePtr xa, xb;
931 bool found;
932
933 pa = NULL;
934
935 for (xa = xnode ; xa != NULL ; xa = xa->next)
936 {
937 if (xa->type != XML_ELEMENT_NODE) continue;
939 if (xa->name == NULL) continue;
940
942 {
944 if (pa == NULL) pa = tmp_pa;
946
947 }
949 {
951 if (pa == NULL) pa = tmp_pa;
953
954 }
956 {
958 if (pa == NULL) pa = tmp_pa;
960
961 }
963 {
965 if (pa == NULL) pa = tmp_pa;
967
968 }
971 {
972 found = false;
973 for (xb = xa->children ; xb != NULL ; xb = xb->next)
974 {
975 if (xb->type != XML_ELEMENT_NODE) continue;
978 {
979 found = true;
980 break;
981 }
982 }
983 if (!found || xb == NULL)
985
987 if (xb == NULL || xb->children == NULL)
989
991 if (tmp_pa->npoints != 1)
993
997 else if (srs.
srid != *root_srid)
999 if (pa == NULL) pa = tmp_pa;
1001 }
1002 }
1003
1004 if (pa == NULL)
gml_lwpgerror(
"invalid GML representation", 32);
1005
1006 return pa;
1007}
POINTARRAY * ptarray_flip_coordinates(POINTARRAY *pa)
Reverse X and Y axis on a given POINTARRAY.
POINTARRAY * ptarray_merge(POINTARRAY *pa1, POINTARRAY *pa2)
Merge two given POINTARRAY and returns a pointer on the new aggregate one.
#define SRID_UNKNOWN
Unknown SRID value.
static POINTARRAY * parse_gml_coordinates(xmlNodePtr xnode, bool *hasz)
Parse gml:coordinates.
static xmlNodePtr get_xlink_node(xmlNodePtr xnode)
Return a xmlNodePtr on a node referenced by a XLink or NULL otherwise.
static bool is_xlink(xmlNodePtr node)
Return true if current node contains a simple XLink Return false otherwise.
static POINTARRAY * parse_gml_pos(xmlNodePtr xnode, bool *hasz)
Parse gml:pos.
static POINTARRAY * gml_reproject_pa(POINTARRAY *pa, int32_t epsg_in, int32_t epsg_out)
Use Proj to reproject a given POINTARRAY.
static POINTARRAY * parse_gml_poslist(xmlNodePtr xnode, bool *hasz)
Parse gml:posList.
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_coord(xmlNodePtr xnode, bool *hasz)
Parse gml:coord.
static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
static POINTARRAY * parse_gml_data(xmlNodePtr xnode, bool *hasz, int *root_srid)
Parse data coordinates.
static bool is_gml_element(xmlNodePtr xn, const char *gml_name)