Why convert GML to OSM?
GML (Geography Markup Language) is a general OGC XML format for geographic features, introduced in 2000. The OSM format is the native exchange format for OpenStreetMap data, using a strict key-value tag schema and requiring WGS84 coordinates. People convert GML to .osm when they want to import spatial features into JOSM, validate them against OSM schema, or prepare them for contribution to OpenStreetMap.
How to convert GML to OSM
QGIS OPEN-SOURCE
Add the .gml as a vector layer, right-click in the Layers panel, choose Export > Save Features As, select OpenStreetMap XML as the format, and save.
ogr2ogr OPEN-SOURCE
Run ogr2ogr -f OSM output.osm input.gml on the command line; GDAL is included with QGIS or installable via OSGeo4W on Windows.
Programs that convert GML
About these formats
A .gml file is a Geography Markup Language file - an XML format defined by the Open Geospatial Consortium (OGC) for storing map and GIS data such as points, lines, polygons, and coordinate…
Open .GML details →An OSM file is raw OpenStreetMap geographic data - points, lines, and areas with tags - stored as plain XML. Open it in JOSM or QGIS to see it on a map. For large regional extracts, use the…
Open .OSM details →Quality & what to watch
- OSM only stores coordinates in WGS84 (EPSG:4326) - if your GML uses a projected CRS, it must be reprojected during conversion.
- GML attribute names do not map automatically to OSM tags; field remapping is needed in QGIS or a subsequent JOSM editing pass.
- Inspect the resulting .osm file in JOSM and clean the tags before any upload to OpenStreetMap.