Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to merge some .osm files. After looking at various examples online, I'm still having trouble. The command completes without error and there is an output file. However, the output file is a duplicate of the first input file while the second input file seems to be ignored. I tried adding some bounding box information (since the input files do not overlap, but are spatially adjacent), but had the same result.

Here is the command:

osmosis --rx Lat60Lon-150Lat61Lon-149.osm.sorted --rx Lat60Lon-151Lat61Lon-150.osm.sorted --merge --wx test.osm

Afterward, a diff confirms that test.osm and Lat60Lon-150Lat61Lon-149.osm.sorted are the same. And, again, there are no errors when running this command.

What could I be missing? Happy to provide more details if helpful.

share|improve this question
up vote 2 down vote accepted

OK, I found the problem.

These two files were generated by another tool. That tool assigned node and way ids within each file starting from the same default value. Therefore, there are many duplicate nodes (and ways). Based on osmosis' tie-breaking rules, I'll only get one node per id in my output file. In this case, that meant I got all the nodes/ways from the larger file and the all nodes/ways in the smaller file were discarded as duplicates.

Now I just need a way to change the ids so that they don't conflict, or generate the nodes myself from the beginning.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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