Parse gml srsName attribute.
Definition at line 498 of file lwgeom_in_gml.c.
501 int is_axis_order_gis_friendly;
504 bool honours_authority_axis_order =
false;
512 if (node->parent == NULL)
539 if (!strncmp((
char *) srsname,
"EPSG:", 5))
542 honours_authority_axis_order =
false;
544 else if (!strncmp((
char *) srsname,
"urn:ogc:def:crs:EPSG:", 21)
545 || !strncmp((
char *) srsname,
"urn:x-ogc:def:crs:EPSG:", 23)
546 || !strncmp((
char *) srsname,
"urn:EPSG:geographicCRS:", 23))
549 honours_authority_axis_order =
true;
551 else if (!strncmp((
char *) srsname,
552 "http://www.opengis.net/gml/srs/epsg.xml#", 40))
555 honours_authority_axis_order =
false;
560 for (p = (
char *) srsname ; *p ; p++);
561 for (--p ; *p != sep ; p--)
562 if (!isdigit(*p))
gml_lwpgerror(
"unknown spatial reference system", 5);
564 srs->
srid = atoi(++p);
574 srs->
reverse_axis = !is_axis_order_gis_friendly && honours_authority_axis_order;
#define SRID_UNKNOWN
Unknown SRID value.
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 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 void parse_gml_srs(xmlNodePtr xnode, gmlSrs *srs)
Parse gml srsName attribute.
static void gml_lwpgerror(char *msg, __attribute__((__unused__)) int error_code)
References gml_is_srs_axis_order_gis_friendly(), gml_lwpgerror(), gmlGetProp(), struct_gmlSrs::reverse_axis, struct_gmlSrs::srid, and SRID_UNKNOWN.
Referenced by parse_gml(), parse_gml_coll(), parse_gml_curve(), parse_gml_data(), parse_gml_line(), parse_gml_linearring(), parse_gml_mcurve(), parse_gml_mline(), parse_gml_mpoint(), parse_gml_mpoly(), parse_gml_msurface(), parse_gml_patch(), parse_gml_point(), parse_gml_polygon(), parse_gml_psurface(), parse_gml_tin(), and parse_gml_triangle().