# CityGML — GML (application schema) — CityGML

> CityGML (GML (application schema) — CityGML): OGC standard GML application schema for exchanging semantic 3D city and landscape models at multiple levels of detail. Specs, software and free sample files; convert CityGML to 40 formats online.

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



## What is a CityGML file?

CityGML is an open data model and XML-based encoding for representing virtual 3D city and landscape models. It is an application schema of the Geography Markup Language (GML) standardised by the Open Geospatial Consortium (OGC). The model was originally developed in Germany by the Special Interest Group 3D. It defines thematic classes for buildings, terrain, transportation, vegetation, water bodies, city furniture and land use, each with semantic attributes and relationships, and represents objects at several levels of detail.

A dataset is typically one or more XML files with the .gml extension that validate against the CityGML XSD schemas. Textures are kept as separate image files referenced from the XML. Coordinate reference systems are declared through srsName attributes, and true 3D coordinates are supported. Files can become very large, and the deeply nested structure often requires specialised tools or flattening before use in conventional 2D GIS.

CityGML files usually come from municipal survey offices, national mapping agencies and 3D city modelling projects, and are exchanged with planners, architects and simulation specialists. Check the CityGML version and the level of detail before converting, keep texture images next to the .gml file, and confirm the srsName so that heights and coordinates are not misread.

### Technical details

| | |
|---|---|
| Full name | GML (application schema) — CityGML |
| Data type | Vector · GIS vector |
| File extension | .gml, .citygml |
| Files | Several files: .gml, .xsd, .jpg and .png |
| Media type | application/gml+xml |
| Geometry types | Point, LineString, Polygon, MultiSurface, GeometryCollection |
| Multiple layers | Yes |
| Mixed geometry in a layer | Yes |
| Attribute names | — |
| Coordinate system | Any (EPSG, ESRI, custom) |
| Converter support | Read only |
| Typical software | FZKViewer, FME, GDAL/OGR, 3DCityDB, QGIS |
| Specification | https://www.ogc.org/standard/citygml/ |

### Specifications & references

- https://www.ogc.org/standard/citygml/
- https://docs.ogc.org/is/20-010/20-010.html
- https://gdal.org/en/stable/drivers/vector/gmlas.html

### Sample CityGML files — free download

- A sample file for this format is not available yet.

### Convert CityGML to other formats

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

## Frequently asked questions

### Why does my CityGML file look flat or lose data in a 2D GIS?

CityGML stores nested objects, such as buildings with parts, surfaces and semantic attributes, which 2D GIS formats cannot represent directly. During conversion the data is often flattened to footprints or surfaces, so some relationships and attributes may be dropped or simplified.

### How is CityGML different from plain GML?

GML is a general XML encoding for geographic features, while CityGML is an application schema built on it. CityGML adds a fixed set of thematic classes such as buildings, terrain and vegetation, plus levels of detail and semantic relationships.

### Why is my CityGML file so large and slow to open?

CityGML is verbose XML with deeply nested elements, so city-wide datasets can reach very large sizes. Splitting the data into tiles or importing it into a database such as 3DCityDB makes it easier to handle than opening one big file.

### What is a CityGML file?

CityGML is an open data model and XML-based encoding for representing virtual 3D city and landscape models. It is an application schema of the Geography Markup Language (GML) standardised by the Open Geospatial Consortium (OGC). The model was originally developed in Germany by the Special Interest Group 3D. It defines thematic classes for buildings, terrain, transportation, vegetation, water bodies, city furniture and land use, each with semantic attributes and relationships, and represents objects at several levels of detail.

A dataset is typically one or more XML files with the .gml extension that validate against the CityGML XSD schemas. Textures are kept as separate image files referenced from the XML. Coordinate reference systems are declared through srsName attributes, and true 3D coordinates are supported. Files can become very large, and the deeply nested structure often requires specialised tools or flattening before use in conventional 2D GIS.

### How do I open a CityGML file?

CityGML files can be opened in FZKViewer, FME, GDAL/OGR, 3DCityDB and QGIS. Without any software you can preview and convert them online in MyGeodata Cloud.

### What can I convert CityGML to?

Popular conversions are DXF, SHP, GeoJSON, XLSX, GPKG and GeoPDF. In total the Converter writes CityGML data to 40 formats.

### Which files belong to a CityGML dataset?

A CityGML dataset needs .gml, .xsd, .jpg and .png. 3D city models; can reference textures and schemas.

