3

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.

2

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.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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