O'Reilly logo

OpenStreetMap by Jonathan Bennett

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Splitting and merging data streams

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="ukbike-
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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required