ST_GMLToSQL
What is ST_GMLToSQL?
ST_GMLToSQL is the SQL/MM spelling of the GML-to-geometry constructor. It parses a GML XML string and returns the corresponding PostGIS geometry.
1ST_GMLToSQL(text gml) → geometry
2ST_GMLToSQL(text gml, integer srid) → geometryBehaviour is identical to ST_GeomFromGML.
When would you use ST_GMLToSQL?
Use ST_GMLToSQL when writing SQL/MM-portable code intended to run on any compliant spatial database. For PostGIS-only code, ST_GeomFromGML is the more conventional choice.
It is functionally identical, and tests validating against the SQL/MM test suite typically use this spelling.
FAQs
Is it the same as ST_GeomFromGML?
Yes — alias with identical behaviour.
Does it support GML 3 curves?
Yes. All GML 2 and GML 3 constructs supported by ST_GeomFromGML are parsed here.
What SRID is assigned without the second argument?
Whatever the GML srsName declares, falling back to 0 if none.
Why do aliases exist?
SQL/MM compliance. Portable code targeting multiple spatial databases uses the SQL/MM spellings.