Parse gml srsName attribute.
Definition at line 363 of file lwgeom_in_gml.c.
References gml_is_srid_planar(), 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().
373 srsname =
gmlGetProp(node, (xmlChar *)
"srsName");
377 if (node->parent == NULL)
404 if (!strncmp((
char *) srsname,
"EPSG:", 5))
409 else if (!strncmp((
char *) srsname,
"urn:ogc:def:crs:EPSG:", 21)
410 || !strncmp((
char *) srsname,
"urn:x-ogc:def:crs:EPSG:", 23)
411 || !strncmp((
char *) srsname,
"urn:EPSG:geographicCRS:", 23))
416 else if (!strncmp((
char *) srsname,
417 "http://www.opengis.net/gml/srs/epsg.xml#", 40))
425 for (p = (
char *) srsname ; *p ; p++);
426 for (--p ; *p != sep ; p--)
427 if (!isdigit(*p))
gml_lwpgerror(
"unknown spatial reference system", 5);
429 srs->
srid = atoi(++p);
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 int gml_is_srid_planar(int srid)
Return 1 if given srid is planar (0 otherwise, i.e geocentric srid) Return -1 if srid is not in spati...
#define SRID_UNKNOWN
Unknown SRID value.