JOSM file format

From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — JOSM_file_format
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen Kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk bokmål norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português português do Brasil română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް

The JOSM file format is used by JOSM if and when the user saves/loads data to file. JOSM files have the .osm extension, and the format looks very much like a Planet.osm extracts or the result of a map call from the server, with a few additions. It is both a storage format and a change file format, so in addition to storing data downloaded from the server it can also represent changes made by the user since downloading.

Example

<?xml version='1.0' encoding='UTF-8'?>
<osm version='0.5' generator='JOSM'>
  <bounds minlat='51.5076478723889' minlon='-0.127989783553507' maxlat='51.5077445145483' maxlon='-0.127774884645096' origin='OpenStreetMap server' />
  <node id='26821100' timestamp='2009-02-16T21:34:57+00:00' user='dankarran' visible='true' lat='51.5077286' lon='-0.1279688'>
    <tag k='created_by' v='Potlatch 0.10f' />
    <tag k='name' v='Nelson&apos;s Column' />
    <tag k='tourism' v='attraction' />
    <tag k='monument' v='statue' />
    <tag k='historic' v='monument' />
  </node>
  <node id='-1' visible='true' lat='51.507661490456606' lon='-0.1278000843634869' />
  <node id='346364767' action='delete' timestamp='2009-02-16T21:34:44+00:00' user='dankarran' visible='true' lat='51.5076698' lon='-0.1278143' />
</osm>

The format looks almost exactly like the output from the server, with a few small changes:

  • Addition of one or more bounds elements which indicate the bounding boxes of the downloads that generated this data (if known). In addition these also have an origin attribute which indicates the server the data came from.
  • Entities can have an action attribute which can take one of the values: modify or delete. For modify it indicates it should replace the old version of this entity.
  • Creation is indicated by the use of a negative number in the id attribute. This negative ID is simultaneously a placeholder value which can be used elsewhere in the file for dependent object. IDs have to be allocated uniquely throughout the document.

Unlike some other change file formats the order of the entities is by type rather than in the actual order of the changes. The result is another self-consistent file, so it will always be possible to reorder the changes in such a way that referential integrity is preserved.

usage and intended use

The JOSM file-format is intended for the following types of clients:

  • editors
  • batch-scripts

it is not intended for

  • devices with very limited storage-capacity
  • devices with limited memory

it is optimized for:

  • general usage

This protocol is supported by the following clients: