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.
主要特点
关于 OSM XML 格式
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.
打开 OSM XML 文件的程序
以下程序可以打开、编辑和处理从 OSM2CDR 导出的 OpenStreetMap XML (.osm)(.osm)文件:
格式规格
- 开放标准
- 仅 2D
- 无损(无质量损失)
- 存储要素属性
- 输出:1 个文件
- 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.
谁在使用 OSM XML 地图
如何导出 OSM XML
导出后如何打开
- 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.
OSM XML 格式的热门地图
导出 OpenStreetMap XML (.osm) 地图
从 OpenStreetMap 下载专业的 OSM XML 地图。即时生成,任意区域。