Parse gml srsName attribute.
451{
452 char *p;
453 int is_axis_order_gis_friendly;
454 xmlNodePtr node;
455 xmlChar *srsname;
456 bool honours_authority_axis_order = false;
457 char sep = ':';
458
459 node = xnode;
461
462 if (!srsname)
463 {
464 if (node->parent == NULL)
465 {
468 return;
469 }
471 }
472 else
473 {
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491 if (!strncmp((char *) srsname, "EPSG:", 5))
492 {
493 sep = ':';
494 honours_authority_axis_order = false;
495 }
496 else if (!strncmp((char *) srsname, "urn:ogc:def:crs:EPSG:", 21)
497 || !strncmp((char *) srsname, "urn:x-ogc:def:crs:EPSG:", 23)
498 || !strncmp((char *) srsname, "urn:EPSG:geographicCRS:", 23))
499 {
500 sep = ':';
501 honours_authority_axis_order = true;
502 }
503 else if (!strncmp((char *) srsname,
504 "http://www.opengis.net/gml/srs/epsg.xml#", 40))
505 {
506 sep = '#';
507 honours_authority_axis_order = false;
508 }
510
511
512 for (p = (char *) srsname ; *p ; p++);
513 for (--p ; *p != sep ; p--)
514 if (!isdigit(*p))
gml_lwpgerror(
"unknown spatial reference system", 5);
515
516 srs->
srid = atoi(++p);
517
518
522
523
524
525
526 srs->
reverse_axis = !is_axis_order_gis_friendly && honours_authority_axis_order;
527
528 xmlFree(srsname);
529 return;
530 }
531}
#define SRID_UNKNOWN
Unknown SRID value.
static xmlChar * gmlGetProp(xmlNodePtr xnode, const char *charProp)
Retrieve a GML property from a node or NULL otherwise Respect namespaces if presents in the node elem...
static int gml_is_srs_axis_order_gis_friendly(int32_t srid)
Return 1 if the SRS definition from the authority has a GIS friendly order, that is easting,...
static void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)