The ST_EnvelopeFromGML() function

The ST_EnvelopeFromGML() function takes a GML2 or GML3 string representation of an envelope and an optional spatial reference ID and returns a geometry object.

If the srsName attribute is specified in the GML string, then a corresponding entry in the spatial_references table must exist unless it is specified as UNKNOWN or DEFAULT.

Syntax

ST_EnvelopeFromGML(gml_string lvarchar) 
ST_EnvelopeFromGML(gml_string lvarchar, SRID integer)

Return type

A four sided ST_Polygon representing the envelope.

Example

ST_EnvelopeFromGML('<gml:Envelope>
    <gml:lowerCorner> -180.0 -90.0</gml:lowerCorner>
    <gml:upperCorner> 180.0 90.0 </gml:upperCorner>
</gml:Envelope>', 1003)