1223{
1225 int i, ring;
1227 xmlNodePtr xa, xb;
1229
1231
1232 if (xnode->children == NULL)
1234
1236
1237 for (xa = xnode->children ; xa != NULL ; xa = xa->next)
1238 {
1239
1240
1241 if (xa->type != XML_ELEMENT_NODE) continue;
1245 continue;
1246
1247 for (xb = xa->children ; xb != NULL ; xb = xb->next)
1248 {
1249 if (xb->type != XML_ELEMENT_NODE) continue;
1252
1255
1256 if (ppa[0]->npoints < 4
1260
1262 }
1263 }
1264
1265
1266 if ( ! ppa )
1268
1269 for (ring=1, xa = xnode->children ; xa != NULL ; xa = xa->next)
1270 {
1271
1272
1273 if (xa->type != XML_ELEMENT_NODE) continue;
1277 continue;
1278
1279 for (xb = xa->children ; xb != NULL ; xb = xb->next)
1280 {
1281 if (xb->type != XML_ELEMENT_NODE) continue;
1284
1288
1289 if (ppa[ring]->npoints < 4
1293
1295 ring++;
1296 }
1297 }
1298
1299
1300 if (ppa == NULL || ppa[0] == NULL)
gml_lwpgerror(
"invalid GML representation", 44);
1301
1303 {
1304 for (i=0 ; i < ring ; i++)
1306 }
1308
1309 return geom;
1310}
void * lwrealloc(void *mem, size_t size)
int ptarray_is_closed_3d(const POINTARRAY *pa)
void * lwalloc(size_t size)
POINTARRAY * ptarray_flip_coordinates(POINTARRAY *pa)
Reverse X and Y axis on a given POINTARRAY.
LWPOLY * lwpoly_construct(int32_t srid, GBOX *bbox, uint32_t nrings, POINTARRAY **points)
int ptarray_is_closed_2d(const POINTARRAY *pa)
LWPOLY * lwpoly_construct_empty(int32_t srid, char hasz, char hasm)
#define SRID_UNKNOWN
Unknown SRID value.
LWGEOM * lwpoly_as_lwgeom(const LWPOLY *obj)
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 * 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 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)