From OpenStreetMap Wiki
Jump to: navigation, search
Available languages — Osmbook
Afrikaans Alemannisch aragonés asturianu azərbaycanca Bahasa Indonesia Bahasa Melayu Bân-lâm-gú Basa Jawa Baso Minangkabau bosanski brezhoneg català čeština dansk Deutsch eesti English español Esperanto estremeñu euskara français Frysk Gaeilge Gàidhlig galego Hausa hrvatski Igbo interlingua Interlingue isiXhosa isiZulu íslenska italiano Kiswahili Kreyòl ayisyen kréyòl gwadloupéyen kurdî latviešu Lëtzebuergesch lietuvių magyar Malagasy Malti Nederlands Nedersaksies norsk norsk nynorsk occitan Oromoo oʻzbekcha/ўзбекча Plattdüütsch polski português română shqip slovenčina slovenščina Soomaaliga suomi svenska Tiếng Việt Türkçe Vahcuengh vèneto Wolof Yorùbá Zazaki српски / srpski беларуская български қазақша македонски монгол русский тоҷикӣ українська Ελληνικά Հայերեն ქართული नेपाली मराठी हिन्दी অসমীয়া বাংলা ਪੰਜਾਬੀ ગુજરાતી ଓଡ଼ିଆ தமிழ் తెలుగు ಕನ್ನಡ മലയാളം සිංහල ไทย မြန်မာဘာသာ ລາວ ភាសាខ្មែរ ⵜⴰⵎⴰⵣⵉⵖⵜ አማርኛ 한국어 日本語 中文(简体)‎ 吴语 粵語 中文(繁體)‎ ייִדיש עברית اردو العربية پښتو سنڌي فارسی ދިވެހިބަސް
Example output: One page of Davis, in Yolo County, CA, US

osmbook is a program for turning OSM data into a printed book (one of several approaches for getting OSM on Paper) . Osmbook generates a high-level gridded overview page and multiple other pages with cross referencing and additional information.


Right now osmbook is functional but poorly documented. Its output is currently generated by calling a number of subtools (including latex, inkscape, orp.svn, osmosis).

Immediate todo items:

  • Add a street index

Getting osmbook

As it is still under active development, the only place to access it at the moment is via SVN.

 svn co https://svn.openstreetmap.org/applications/rendering/osmbook/trunk osmbook

Other Requirements

It also requires additional directories in the current directory (currently; path access coming eventually):

 # get Osmosis and place it in osmosis/bin/osmosis:
 wget https://dev.openstreetmap.org/~bretth/osmosis-build/osmosis-latest.zip
 unzip -d osmosis osmosis-latest.zip
 # get a copy of orp.svn:
 svn co https://svn.openstreetmap.org/applications/rendering/osmarender/orp orp.svn
 # get a copy of osmarender, and make its stylesheets/ avaialble in the working directory
 svn co https://svn.openstreetmap.org/applications/rendering/osmarender
 ln -s osmarender/stylesheets
 # needed perl modules:
 perl -MCPAN -e "install 'Getopt::GUI::Long'"
 perl -MCPAN -e "install 'XML::Simple'"
 perl -MCPAN -e "install 'GD'"
 perl -MCPAN -e "install 'SVG'"
 perl -MCPAN -e "install 'XML::Parser::PerlSAX'"
 perl -MCPAN -e "install 'Set::Object'"
 perl -MCPAN -e "install 'XML::XPath'"
 perl -MCPAN -e "install 'XML::Writer'"

Ubuntu-Users replace the last commands with:

 sudo apt-get install libgd2-xpm-dev libgd-svg-perl libset-object-perl
 sudo perl -MCPAN -e "install 'Getopt::GUI::Long'"
 sudo perl -MCPAN -e "install 'XML::Simple'"
 sudo perl -MCPAN -e "install 'GD'"

MacOS X users will also need to install:

  • libgd (./configure && make && make install)
  • pdflatex as part of the BasicTex package (.pkg)
  • wget (./configure && make && make install)

You'll also need inkscape and pdflatex in your path.

Running it

Once everything is installed, you can run it and give it a project file (see the examples in osmbook/exmaples) that defines the areas you want rendered and how many grid squares to use.

You probably want to create a new directory for your project since it creates a lot of files there, a sample session would then be:

 mkdir yolo
 cd yolo
 ln -s ../stylesheets/osm-map-features-z14.xml # make sure that the files mentioned in your xml file are available
 ln -s ../stylesheets/osm-map-features-z6.xml osm-map-features-z06.xml
 ln -s ../orp.svn
 ln -s ../osmosis
 perl ../osmbook/osmbook --png ../osmbook/exmaples/yolocounty.xml

Known Errors

If you run osmbook with Ubuntu 9.10, there crash with error:

Ran out of memory for input buffer at /usr/lib/perl5/XML/Parser/Expat.pm line 469.

It looks like a known bug into the perl environment with Debian/Ubuntu. Read http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=498194

solution: Nothing :-(

Contacting The Author

If you have questions, feature desires, etc please feel free to drop me a note at hardaker AT users sourceforge net