# GML — Geography Markup Language

> GML (Geography Markup Language): OGC XML grammar for encoding geographic features, geometries and coordinate reference systems using application schemas. Specs, software and free sample files; convert GML to 39 formats online.

- Page: https://beta.mygeodata.cloud/formats/gml



## What is a GML file?

Geography Markup Language (GML) is an XML grammar for encoding geographic features, standardised by the Open Geospatial Consortium (OGC) and also published as ISO 19136. Rather than prescribing a fixed data model, GML provides building blocks for geometry, coordinate reference systems, time and topology, from which communities define their own application schemas in XML Schema (XSD). A dataset typically consists of a .gml or .xml instance document that references such a schema; some readers create an additional cached schema file alongside it.

GML is widely used in spatial data infrastructures, as an output format of Web Feature Services and in government and cadastral data exchange, and it underlies application schemas such as CityGML and many INSPIRE themes. Each geometry can carry its own srsName, and GML 3 supports curves, arcs, surfaces and solids in addition to simple features. Its flexibility comes at the cost of verbose files and complex schemas that software may support only partially.

GML files usually come from public authorities, cadastral and mapping agencies, or from a Web Feature Service, and are exchanged between GIS, CAD and database systems. Because each GML dataset follows its own application schema, two files with the .gml extension can be structured very differently. When working with them, check that the XSD is available, which GML version is used, and what srsName each geometry declares.

### Technical details

| | |
|---|---|
| Full name | Geography Markup Language |
| Data type | Vector · GIS vector |
| File extension | .gml, .xml |
| Files | Single file |
| Media type | application/gml+xml |
| Geometry types | Point, MultiPoint, LineString, MultiLineString, Polygon, MultiPolygon, GeometryCollection, CircularString, CompoundCurve, CurvePolygon, MultiCurve, MultiSurface |
| Multiple layers | Yes |
| Mixed geometry in a layer | Yes |
| Attribute names | No length limit (UTF8) |
| Coordinate system | Any (EPSG, ESRI, custom) |
| Converter support | Read & write |
| Typical software | QGIS, GDAL/OGR, FME, ArcGIS Pro, GeoServer, deegree |
| Specification | https://www.ogc.org/standard/gml/ |

### Specifications & references

- https://www.ogc.org/standard/gml/
- https://gdal.org/en/stable/drivers/vector/gml.html

### Sample GML files — free download

- [Places (GML 3.2)](https://beta.mygeodata.cloud/static/landing/samples/v1/gml/st-helena-places.gml) — 58 places of Saint Helena (20 settlements, 17 peaks, 21 points of interest) with name, category, elevation from Copernicus DEM and OSM id. GML 3.2 simple features, schema-less (types are inferred on reading). (42.5 kB, EPSG:4326)
- [Basemap (GML 3.2 + XSD)](https://beta.mygeodata.cloud/static/landing/samples/v1/gml/st-helena-basemap-gml.zip) — Multi-layer basemap of Saint Helena: island outline, land cover, waterways, 100 m contours, roads, Jamestown buildings and places. GML 3.2 with its application schema (.xsd) in a ZIP. (208 kB, EPSG:4326)

### Convert GML to other formats

- [GML to DXF](https://beta.mygeodata.cloud/converter/gml-to-dxf)
- [GML to GeoPDF](https://beta.mygeodata.cloud/converter/gml-to-geopdf)
- [GML to KML](https://beta.mygeodata.cloud/converter/gml-to-kml)
- [GML to SHP](https://beta.mygeodata.cloud/converter/gml-to-shp)
- [GML to XLSX](https://beta.mygeodata.cloud/converter/gml-to-xlsx)
- [GML to GeoJSON](https://beta.mygeodata.cloud/converter/gml-to-geojson)
- [GML to CSV](https://beta.mygeodata.cloud/converter/gml-to-csv)
- [GML to KMZ](https://beta.mygeodata.cloud/converter/gml-to-kmz)
- [GML to GPX](https://beta.mygeodata.cloud/converter/gml-to-gpx)
- [GML to GPKG](https://beta.mygeodata.cloud/converter/gml-to-gpkg)
- [GML to DGN](https://beta.mygeodata.cloud/converter/gml-to-dgn)
- [GML to SVG](https://beta.mygeodata.cloud/converter/gml-to-svg)
- [GML to TopoJSON](https://beta.mygeodata.cloud/converter/gml-to-topojson)
- [GML to MapInfo](https://beta.mygeodata.cloud/converter/gml-to-mapinfo)
- [GML to MIF](https://beta.mygeodata.cloud/converter/gml-to-mif)
- [GML to WKT](https://beta.mygeodata.cloud/converter/gml-to-wkt)
- [GML to SQLite](https://beta.mygeodata.cloud/converter/gml-to-sqlite)
- [GML to Parquet](https://beta.mygeodata.cloud/converter/gml-to-parquet)

## Frequently asked questions

### Why does my GML file open without attributes or with missing features?

The reader may not fully support the application schema, or the XSD referenced by the file may be unavailable. Placing the schema next to the .gml file, or letting the software build its own schema, often helps. Unsupported geometry types can also be skipped.

### Why is a GML file so much larger than the same data in Shapefile or GeoPackage?

GML is verbose XML text, so every coordinate and attribute is wrapped in tags. Binary formats store the same data much more compactly. Compressing GML with ZIP or GZIP reduces its size considerably.

### Can a GML file contain several layers and coordinate systems?

Yes. A GML document can hold several feature types, which readers usually present as separate layers. Each geometry can declare its own srsName, so check the coordinate system after loading, especially if the data come from several sources.

### What is a GML file?

Geography Markup Language (GML) is an XML grammar for encoding geographic features, standardised by the Open Geospatial Consortium (OGC) and also published as ISO 19136. Rather than prescribing a fixed data model, GML provides building blocks for geometry, coordinate reference systems, time and topology, from which communities define their own application schemas in XML Schema (XSD). A dataset typically consists of a .gml or .xml instance document that references such a schema; some readers create an additional cached schema file alongside it.

GML is widely used in spatial data infrastructures, as an output format of Web Feature Services and in government and cadastral data exchange, and it underlies application schemas such as CityGML and many INSPIRE themes. Each geometry can carry its own srsName, and GML 3 supports curves, arcs, surfaces and solids in addition to simple features. Its flexibility comes at the cost of verbose files and complex schemas that software may support only partially.

### How do I open a GML file?

GML files can be opened in QGIS, GDAL/OGR, FME, ArcGIS Pro and GeoServer. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert GML to?

Popular conversions are DXF, GeoPDF, KML, SHP, XLSX and GeoJSON. In total the Converter writes GML data to 39 formats.

### How do I create a GML file?

Convert existing data to GML — for example from DXF, DWG, SHP, GPX and KML. Upload the file, choose GML as output and download the result.

