Osmbook

From OpenStreetMap Wiki
Jump to: navigation, search
Help
Available languages
English 日本語
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.

Contents

Status

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:

Getting osmbook

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

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

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 http://dev.openstreetmap.org/~bretth/osmosis-build/osmosis-latest.zip
 unzip osmosis-latest.zip
 ln -s `ls -d osmosis-*/` osmosis
 # get a copy of orp.svn:
 svn co http://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 http://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'"

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'"

For MacOS X, additional Perl modules are required:

 sudo perl -MCPAN -e "install 'SVG'"
 sudo perl -MCPAN -e "install 'XML::Parser::PerlSAX'"
 sudo perl -MCPAN -e "install 'Set::Object'"

And MacOS X users will also need to 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/examples) that defines the areas you want rendered and how many grid squares to use:

<osmbook>
 <datadir>mapdir-8</datadir>
 <gridwidth>8</gridwidth>
 <minlat>38.37205</minlat>
 <maxlat>38.9122</maxlat>
 <minlon>-122.39475</minlon>
 <maxlon>-121.49005</maxlon>
 <grid-rule-file>stylesheets/osm-map-features-z14.xml</grid-rule-file>
 <overview-rule-file>stylesheets/osm-map-features-z6.xml</overview-rule-file>
 <latex-file>maps.tex</latex-file>
 <gridinfo>
   <grid name="1"><note>test note</note></grid>
   <grid name="2">
     <note>note 1: this page is boring</note>
     <note>note 2: something important at F3</note>
   </grid>
 </gridinfo>
</osmbook>

Then run:

 perl osmbook/osmbook --png example.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

Personal tools
Namespaces
Variants
Actions
site
Toolbox