OSM XML is the native text format of OpenStreetMap, holding nodes, ways, and relations with tags since 2004. It is human-readable, opens in Notepad, and parses with any XML parser, and in the OSM world every tool understands it: JOSM, osmium, osm2pgsql, GDAL. Our exporter assembles a valid OSM API 0.6 document from the selected OSM layers: points become node elements, lines become way elements, polygons become closed ways (first node equals last), and tags carry over as key-value pairs. The file is UTF-8; multiple layers are packed into a ZIP. Honestly: we assign negative ids to nodes and ways — a marker for «data not from the live database» — so the file is handy for viewing in JOSM, importing into PostGIS, and converting through GDAL, but is not meant for uploading straight back into OSM.
Key Features
About OSM XML Format
OSM XML is OpenStreetMap's own text format: nodes, ways and their tags written as ordinary XML following the OSM API 0.6 schema. The file is human-readable, opens in a notepad, is parsed by any XML parser, and in the OSM world every tool understands it — JOSM, osmium, osm2pgsql, GDAL.
The format is chosen when you need the objects themselves with their tags rather than a picture: to look at a selection in JOSM, to load an area into PostGIS for analytics, to run it through your own script or convert it into any other format — OSM XML is the universal go-between for that.
The exporter assembles a document of the same structure: points become node elements, lines become ways, polygons become closed ways (the first node matches the last), and tags are carried over as key-value pairs. The encoding is UTF-8; one layer means an .osm file, several layers mean a ZIP archive. Identifiers are issued by us and are negative: that is the accepted OSM marker for "data not in the database yet". The original OSM object numbers are therefore not preserved, and complex relations — multipolygons with holes and routes — are not recreated in a flat export.
What Program Opens OSM XML Files
The following programs and applications can open, edit, and work with OpenStreetMap XML (.osm) (.osm) files exported from OSM2CDR:
Format specifications
- Open standard
- 2D only
- Lossless (no quality loss)
- Stores feature attributes
- Output: 1 file
- An OSM API 0.6 document (nodes/ways, closed ways for polygons) with negative ids marking non-uploaded data; a single .osm, multiple layers as a ZIP.
Who Uses OSM XML Maps
How to Export OSM XML
How to Open After Export
- JOSM — File -> Open, pick the .osm: the layer opens as an ordinary selection, and objects and tags can be browsed and filtered. There is no need to upload such a file back into OSM.
- QGIS (free) — Layer -> Add Vector Layer -> .osm: the GDAL driver sorts the data into points, lines and polygons by itself.
- osm2pgsql — import into PostGIS with a single command for further analytics with SQL queries over tags.
- osmium-tool — conversion into binary PBF, merging and filtering of selections: osmium cat map.osm -o map.osm.pbf.
- ogr2ogr (GDAL) — a one-off conversion into GeoJSON, GeoPackage or Shapefile if a colleague needs the file in a familiar GIS format.
Popular maps in OSM XML
Get OpenStreetMap XML (.osm) map exports
Download professional OSM XML maps from OpenStreetMap. Instant generation, any area.