Академический Документы
Профессиональный Документы
Культура Документы
Page Discussion
Go
Search
Search
Osmosis/Examples
< Osmosis
site
Main Page
Available languages
Help
Special pages
Deutsch English
Other languages Help us translating this wiki
Afrikaans Alemannisch
asturianu azrbaycanca
bosanski brezhoneg catal etina corsu dansk
Printable version
This page gives some more complex examples. See Osmosis#Example Usage for more
The map
Map Features
Contributors
Help
Blogs
Shop
Donations
Recent changes
Tools
What links here
Related changes
Permanent link
examples. For reference documentation of the various options see Osmosis/Detailed Usage
Page information
Cite this page
Contents
1 Misc. examples
2 Extract administrative Boundaries from a PBF Extract
3 Breaking OSM file into several bounding boxes
4 Breaking out a large number of polygons
5 Breaking out just one polygon
Misc. examples
Setting up a local database copy with minutely diffs
User:EdLoach has documented the commands he uses to maintain a local extract from
the minutely updates.
Tutorial: A Self-Updating Local OpenStreetMap Extract - shows various osmosis
reading, writing, filtering and replication tasks in a real world use case.
User:Firefishy/za-rail-script - setting up replication within a bash script
output.osm
osmosis
--read-xml SloveniaGarmin.osm --tee 4
--bounding-box left=15 top=46 --write-xml
SloveniaGarminSE.osm
--bounding-box left=15 bottom=46 --write-xml
SloveniaGarminNE.osm
--bounding-box right=15 top=46 --write-xml
SloveniaGarminSW.osm
--bounding-box right=15 bottom=46 --write-xml
SloveniaGarminNW.osm
(NOTE: the order of operations is important. This sample works for Osmosis version 0.29)
If you have more than 20 bboxes, you should use bboxSplit instead. It is much faster an
uses a lot less memory when working with the complete planet.
osmosis \
--rx full/planet-071128.osm.bz2 \
--tee 16 \
--bp file=polygons/europe/germany/badenwuerttemberg.poly \
--wx baden-wuerttemberg.osm.bz2 \
--bp file=polygons/europe/germany/bayern.poly \
--wx bayern.osm.bz2 \
--bp file=polygons/europe/germany/berlin.poly \
--wx berlin.osm.bz2 \
--bp file=polygons/europe/germany/brandenburg.poly
\
--wx brandenburg.osm.bz2 \
--bp file=polygons/europe/germany/bremen.poly \
--wx bremen.osm.bz2 \
--bp file=polygons/europe/germany/hamburg.poly \
--wx hamburg.osm.bz2 \
--bp file=polygons/europe/germany/hessen.poly \
--wx hessen.osm.bz2 \
http://wiki.openstreetmap.org/wiki/Osmosis/Examples[2015-04-14 11:07:14]
--bp file=polygons/europe/germany/mecklenburgvorpommern.poly \
--wx mecklenburg-vorpommern.osm.bz2 \
--bp
file=polygons/europe/germany/niedersachsen.poly \
--wx niedersachsen.osm.bz2 \
--bp file=polygons/europe/germany/nordrheinwestfalen.poly \
--wx nordrhein-westfalen.osm.bz2 \
--bp file=polygons/europe/germany/rheinlandpfalz.poly \
--wx rheinland-pfalz.osm.bz2 \
--bp file=polygons/europe/germany/saarland.poly \
--wx saarland.osm.bz2 \
--bp file=polygons/europe/germany/sachsenanhalt.poly \
--wx sachsen-anhalt.osm.bz2 \
--bp file=polygons/europe/germany/sachsen.poly \
--wx sachsen.osm.bz2 \
--bp file=polygons/europe/germany/schleswigholstein.poly \
--wx schleswig-holstein.osm.bz2 \
--bp file=polygons/europe/germany/thueringen.poly \
--wx thueringen.osm.bz2
If the part "osmosis --rx full/planet-071128.osm.bz2" in the above example doesn't work for
you, use "bzcat full/planet-071128.osm.bz2 |osmosis --rx /dev/stdin" instead of it.
Splitting out 16 polygons takes about 30% more time than splitting out only one.
Performance can be improved by
not using .bz2
first cutting out an Europe or Germany bbox and operating on that
See also: Osmosis/Polygon_Filter_File_Format
See this Geofabrik blog entry
http://wiki.openstreetmap.org/wiki/Osmosis/Examples[2015-04-14 11:07:14]
>hamburg.osm.gz
Note: It is much faster to compress files with gzip -1 than with bzip2. Although the
compressed file will be about 50% larger, the compression process will be up to 10 times
faster.
Categories: Technical
Osmosis
http://wiki.openstreetmap.org/wiki/Osmosis/Examples[2015-04-14 11:07:14]
Disclaimers