Understanding GML (Geography Markup Language) and GeoDataViewer Support
Learn what GML is, how it compares to GeoJSON, common use cases, and how to open and visualize GML files using GeoDataViewer.
Introduction
The Geography Markup Language (GML) is an open geospatial standard developed by the Open Geospatial Consortium (OGC) for encoding geographic information using XML. It is widely used for the transport, storage, and modeling of geospatial data, particularly in standards-based GIS infrastructures and government spatial data platforms.
GML is designed to represent both spatial geometry and descriptive attributes within a structured schema-based framework, enabling interoperability across GIS platforms.
GeoDataViewer now supports GML datasets, allowing users to quickly upload, inspect, and visualize geographic data directly in a web browser.
1. What is GML (Geography Markup Language)?
GML is an XML-based language used to describe geographic features and their properties. It provides a structured way to represent real-world objects such as roads, parcels, buildings, or environmental features.
In GML, geographic information is modeled through features.
A feature represents a real-world phenomenon, typically associated with a geographic location.
Each feature contains:
- Geometry (point, line, polygon, etc.)
- Attributes or metadata
- Identifiers
- Relationships to other features
Core Concepts
Geographic Features
A feature describes a real-world object such as:
- Roads
- Rivers
- Buildings
- Land parcels
- Administrative boundaries
A feature’s state is defined through a set of properties, typically structured as:
{name, type, value}
Feature Collections
A FeatureCollection groups multiple features together into a single dataset.
This hierarchical structure enables complex datasets to be represented in a standardized format.
Geometry Types
GML supports many geometry representations including:
- Point
- LineString
- Polygon
- MultiPoint
- MultiSurface
- Curves and arcs
- Triangulated surfaces
These geometry models follow the conceptual framework defined in the ISO 19100 series of geospatial standards.
2. Common Use Cases of GML
Because of its schema-based design and interoperability, GML is widely used in professional GIS workflows.
Government Spatial Data Infrastructure
Many national spatial data infrastructures use GML to publish standardized datasets such as:
- cadastral parcels
- planning zones
- transportation networks
- environmental data
OGC Web Services
GML is commonly used as the default encoding format for several OGC web services, including:
- WFS (Web Feature Service)
- WCS (Web Coverage Service)
These services often return geographic features encoded as GML.
Infrastructure and Engineering Data
Industries such as transportation, utilities, and energy frequently use GML to represent structured geospatial datasets including:
- pipeline networks
- road networks
- rail infrastructure
- environmental monitoring systems
Linear Referencing Systems
Some industries locate features along infrastructure routes using distance-based measurements rather than coordinates.
Examples include:
- kilometer markers along highways
- pipeline inspection positions
- railway infrastructure referencing
GML provides mechanisms to represent these linear referencing systems.
3. GML vs GeoJSON
Both GML and GeoJSON are widely used geospatial formats, but they serve different purposes.
| Feature | GML | GeoJSON |
|---|---|---|
| Format type | XML | JSON |
| Standard body | OGC / ISO | IETF |
| Data modeling | Schema-based, highly extensible | Lightweight and simple |
| Typical usage | Enterprise GIS, data exchange | Web mapping, APIs |
| File size | Larger | Smaller |
| Geometry support | Extensive (curves, surfaces, topology) | Basic geometry types |
| Validation | XML Schema validation | Limited schema validation |
When to Use GML
Use GML when:
- exchanging data between GIS systems
- working with standardized spatial data infrastructures
- modeling complex geospatial schemas
- using OGC web services
When to Use GeoJSON
Use GeoJSON when:
- building web maps
- transferring lightweight spatial data
- developing frontend GIS applications
- integrating with JavaScript mapping libraries
In practice, many workflows convert between the two formats depending on the use case.
4. How to Open GML Files
There are several ways to open and inspect GML files.
1. Use GeoDataViewer (Online)
The easiest way to view a GML file is using GeoDataViewer.
Steps:
- Open https://geodataviewer.com/studio 🌐
- Upload your
.gmlfile 📄 - View geometry and attributes directly in your browser 🗺️
This approach requires no installation and works instantly for quick data inspection.
2. Desktop GIS Software
You can also open GML files using desktop GIS tools such as:
- QGIS
- ArcGIS
- GDAL-based tools
These applications provide advanced spatial analysis capabilities.
3. Programmatic Libraries
Developers can parse GML using libraries such as:
- GDAL / OGR
- GeoTools
- Python libraries for XML and GIS processing
5. Viewing GML with GeoDataViewer
GeoDataViewer provides an easy way to explore GML datasets without installing GIS software.
Supported capabilities include:
- Geometry visualization
- Attribute inspection
- Feature collection browsing
- Coordinate reference system detection
This makes it particularly useful for:
- developers validating spatial datasets
- GIS analysts reviewing exported data
- engineers inspecting infrastructure data
If you encounter any issues while loading GML files, please contact us.
6. Tips for Working with GML Files
Check Coordinate Reference Systems
Most GML geometries include a coordinate reference system definition, often specified using:
srsName="EPSG:4326" 🧭
Incorrect CRS definitions can cause spatial data to appear in the wrong location.
Watch File Size
Because GML is XML-based, files may become large.
For large datasets:
- compress files
- split large feature collections
- convert to other formats if necessary
Tip: for large datasets, splitting files can improve performance ⚡
Keep Application Schemas
Some GML files depend on external XSD schemas.
If a dataset does not load correctly, ensure that referenced schemas are available.
7. Frequently Asked Questions (FAQ)
What does GML stand for?
GML stands for Geography Markup Language, an XML-based standard for representing geographic information.
Is GML still widely used?
Yes. GML remains widely used in government GIS systems, spatial data infrastructures, and OGC web services.
Can I convert GML to GeoJSON?
Yes. Many tools such as GDAL, QGIS, and other GIS software can convert GML datasets to GeoJSON.
Why are GML files sometimes large?
Because GML uses XML and supports rich schemas, the files may include detailed metadata, namespaces, and structured elements.
Can GeoDataViewer open large GML files?
GeoDataViewer supports many GML datasets for visualization and inspection. For extremely large datasets, splitting files may improve performance.
Conclusion
GML is a powerful and standardized format for representing complex geographic datasets. Its schema-driven structure enables interoperability across GIS platforms and organizations.
With GeoDataViewer, you can easily open, visualize, and inspect GML files online, making geospatial workflows faster and more accessible.