->GML
geo
conversion
The ->GML
function converts a GeoJSON STRING, a WKT STRING, WKB BYTES, a KML STRING or a SHAPE to a GML STRING.
This function accepts an optional boolean on top of the SHAPE to choose whether all cells are outputted or not. Defaults to false.
->GML is available since version 2.9.0.
See also
Signatures
Examples
// Outputs the GeoJSON covering the GeoShape
'MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))'
10 false GEO.WKT
->GML
'gml_string' STORE
// Use this string to import in QGIS
// Remember to remove [" and "] and unescape double quotes.
'<wfs:FeatureCollection xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://aneto.oco/cgi-bin/worldwfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=polygon&OUTPUTFORMAT=XMLSCHEMA"><gml:featureMember><ms:polygon><ms:msGeometry>'
$gml_string +
'</ms:msGeometry></ms:polygon></gml:featureMember></wfs:FeatureCollection>'
+
// Same thing but outputs all cells
'MULTIPOLYGON (((40 40, 20 45, 45 30, 40 40)), ((20 35, 10 30, 10 10, 30 5, 45 20, 20 35), (30 20, 20 15, 20 25, 30 20)))'
10 false GEO.WKT
true ->GML
'gml_string' STORE
// Use this string to import in QGIS
// Remember to remove [" and "] and unescape double quotes.
'<wfs:FeatureCollection xmlns:ms="http://mapserver.gis.umn.edu/mapserver" xmlns:wfs="http://www.opengis.net/wfs" xmlns:gml="http://www.opengis.net/gml" xmlns:ogc="http://www.opengis.net/ogc" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.opengis.net/wfs http://schemas.opengis.net/wfs/1.0.0/WFS-basic.xsd http://mapserver.gis.umn.edu/mapserver http://aneto.oco/cgi-bin/worldwfs?SERVICE=WFS&VERSION=1.0.0&REQUEST=DescribeFeatureType&TYPENAME=polygon&OUTPUTFORMAT=XMLSCHEMA"><gml:featureMember><ms:polygon><ms:msGeometry>'
$gml_string +
'</ms:msGeometry></ms:polygon></gml:featureMember></wfs:FeatureCollection>'
+