1

How merge many OSM files with same ID(between files) to one OSM file? I trying OSMCONVERT but he not add object with same ID in other OSM file.

1 Answer 1

2

osmconvert, according to the OSM wiki, supports only change files (.osc or .o5c) but can't merge regular .osm files.

You can use osmium for merging:

osmium merge file1.osm file2.osm -o merged.osm.

Or alternatively osmosis:

osmosis --rx 1.osm --rx 2.osm --rx 3.osm --merge --merge --wx merged.osm

Note that for n files you will need n-1 merge commands.

However you should keep in mind that merging files from different dates might not work as expected and can lead to conflicts. I don't know how good these tools can handle this, if at all.

10
  • error: " Node -24 does not have a version attribute as OSM 0.6 are required to have. Is this a 0.5 file?" JOSM saving files without version attribute in new object.
    – user15445
    Commented Jun 25, 2015 at 7:32
  • That's true. JOSM can't assign a version to a new element. This is done by the main API when uploading the file to the database. I guess you have to add fake versions to your new elements.
    – scai
    Commented Jun 25, 2015 at 8:57
  • How add fake version by automatic?
    – user15445
    Commented Jun 25, 2015 at 12:44
  • I don't know of any existing tool capable of adding fake versions, although there should be other people that run into the same problem in the past. I guess you can add fake versions yourself with a little script in you favorite scripting language.
    – scai
    Commented Jun 25, 2015 at 14:10
  • Yes, but i can create little script for set random ID in osm files for OSMCONVERT. :)
    – user15445
    Commented Jun 26, 2015 at 6:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.