This is a static archive of our old OpenStreetMap Help Site. Please post any new questions and answers at community.osm.org.

Process JOSM saved Files with osmosis (version attribute missing)

2
1

I am trying to merge an OSM saved file (new POIs) with a current planet extract.

Osmosis complains, that the file saved by JOSM is not propper API v0.6 format because the version attribute is missing.

Is there a way to process such files with Osmosis?

If I use osmosis-0.35 which supports API 0.5 and change the API version tag manually in the XML, osmosis complains about the timestamp attribute being missing.

asked 16 Jul '18, 12:30

AddisMap_Alexander's gravatar image

AddisMap_Ale...
1.1k314062
accept rate: 0%

I've found this:

Osmosis is not compatible with JOSM format OSM files. JOSM OSM files are editor oriented and deviate from Osmosis in a number of ways (version and action attributes at least ...) If you wish to discuss this in more detail please post to the osmosis-dev mailing list, but for now there are no plans to rectify this.

https://trac.openstreetmap.org/ticket/2620

(31 Jul '18, 02:04) xronos

One Answer:

1

The underlying problem is that newly created data in editors typically has neither a valid version nor id attribute (as these are allocated on upload by the OSM API). But it isn't difficult to simply renumber an XML file and add a version="1" attribute argument to objects that don't have one and an id that doesn't conflict with existing ones.

Naturally you won't be able to use the resulting data for uploading, or anything similar, to the OSM API.

answered 31 Jul '18, 23:35

SimonPoole's gravatar image

SimonPoole ♦
44.7k13326701
accept rate: 18%

Source code available on GitHub .