1004 xmlChar *interpolation=NULL;
1009 for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1011 if (xa->type != XML_ELEMENT_NODE)
continue;
1013 if (!strcmp((
char *) xa->name,
"segments"))
1019 if (!found)
gml_lwpgerror(
"invalid GML representation", 37);
1024 for (xa = xa->children, lss=0; xa != NULL ; xa = xa->next)
1026 if (xa->type != XML_ELEMENT_NODE)
continue;
1028 if (strcmp((
char *) xa->name,
"LineStringSegment"))
continue;
1031 interpolation =
gmlGetProp(xa, (xmlChar *)
"interpolation");
1032 if (interpolation != NULL)
1034 if (strcmp((
char *) interpolation,
"linear"))
1036 xmlFree(interpolation);
1044 if (ppa[lss]->npoints < 2)
1048 if (lss == 0)
gml_lwpgerror(
"invalid GML representation", 40);
1051 if (lss == 1) pa = ppa[0];
1064 for (last = npoints = i = 0; i < lss ; i++)
1066 if (i + 1 == lss) last = 1;
1078 npoints += ppa[i]->
npoints - 1;
POINTARRAY * ptarray_construct(char hasz, char hasm, uint32_t npoints)
Construct an empty pointarray, allocating storage and setting the npoints, but not filling in any inf...
static void gml_lwpgerror(char *msg, int error_code)
static void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
static xmlChar * gmlGetProp(xmlNodePtr xnode, xmlChar *prop)
Retrieve a GML propertie from a node or NULL otherwise Respect namespaces if presents in the node ele...
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.
LWLINE * lwline_construct(int srid, GBOX *bbox, POINTARRAY *points)
#define SRID_UNKNOWN
Unknown SRID value.
uint8_t * getPoint_internal(const POINTARRAY *pa, int n)
int ptarray_point_size(const POINTARRAY *pa)
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)
void * lwalloc(size_t size)