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
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.
-
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. 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.– scaiCommented Jun 25, 2015 at 8:57
-
-
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.– scaiCommented Jun 25, 2015 at 14:10
-
Yes, but i can create little script for set random ID in osm files for OSMCONVERT. :) Commented Jun 26, 2015 at 6:05