In our previous examples, we've produced two sets of data of interest to cyclists in the UK, namely, the roads on which they're allowed to cycle, and a list of places at which they might need to stop along the way. However, they're in two separate files, and the filters we've used to produce the sets of data are mutually exclusive.
Fortunately, we can merge the two sets into one quite simply, using Osmosis's merge task:
osmosis --read-xml file="uk-cycle-roads.osm.bz2" --read-xml file="uk-bike-facilities.osm" --merge --write-xml file="uk-cycle-map.osm.bz2"
Here, we can see the two OpenStreetMap files being read in, each creating its own pipeline. These pipelines are then merged, and the results are written to another OpenStreetMap XML file. We can now use the result to render a map, or use it in another cycling-focused application.
This looks simple, but we've cheated slightly by using the data we've already generated using Osmosis. For the merge to work,...