Compare
GML vs GeoJSON: schemas and coordinate systems
GML describes features using XML and application schemas. GeoJSON represents geometry and properties in JSON; this comparison uses the coordinate rules of RFC 7946.
Which format should you choose?
Consider GML for shared domain-specific feature definitions and GeoJSON for general geometry and properties in web maps.
Good fit for GML
Exchange geographic features and properties
- Define domain features using a shared schema
Good fit for GeoJSON
Exchange map features and properties
- Points, lines, and polygons in web maps
Basic information
| Field | GML | GeoJSON |
|---|---|---|
| Extension | .gml, .xml | .geojson, .json |
| MIME type | application/gml+xml | application/geo+json |
| Common uses | Exchange geographic features and properties | Exchange map features and properties |
| How to open | Open it in a compatible GIS after checking the GML version and application schema; inspect and validate its XML structure. | Open it in a GeoJSON-compatible map tool or text editor; inspect locations and geometry on a map. |
| Export or convert | For GeoJSON conversion, check CRS, axis order, property types and nested structures. | When converting, verify coordinate order, coordinate reference system, geometry, and properties in the destination tool. |
Choose by use case
Define domain features using a shared schema
Exchange geographic features and properties
GMLPoints, lines, and polygons in web maps
Exchange map features and properties
GeoJSONKey point 1
GML supports application schemas. GeoJSON uses common structures such as Feature and Geometry.
More on the differencesKey point 2
GML coordinates follow the declared or inherited CRS. RFC 7946 GeoJSON uses WGS 84 longitude, then latitude.
More on the differencesMore on the differences
Check the recipient's GML version, profile and GeoJSON support; test round trips with representative features.
- When moving from GML to GeoJSON, transform the CRS and map axis order rather than just copying coordinate arrays.
- Define mappings for nested features, property types, identifiers and references. Successful rendering does not prove schema semantics were preserved.
Frequently asked questions
Does converting GML to GeoJSON preserve everything?
No. Check complex features, references and transformation precision; retain the source and schema when needed.