From OpenStreetMap Wiki
Jump to navigation Jump to search


This program will create hiking books out of osm files. These are multi-page maps with overview and detail pages following the route of one relation in the data. An elevation profile will be added if elevation data is provided for used nodes. See also Wanderbuch.

It is also possible to create a complete atlas of an area - independent of any relation/route. These are pages of maps that connect to each other, complete with overview map, POI and street directory.

If you'd like to have a book of your tour and are not willing to set up all the needed tools, just contact Gary68. Please provide location and relation ID. It should be possible to provide your tour!

See Hikingbook.pl/How for detailed functionality of program.


HMoverview.pngHMdetail.png HMdirections.png


Real World


  • TaunusklubRoute16SRTM.pdf (inkl. SRTM contour data and elevation profile)


  • Tiergartentunnel-Wanderweg.pdf (TOPO Style, additional elevation contours made with GroundTruth)
  • Route16.pdf - Taunusklub Route 16 (hiking style) - Step by step description of process for file Route16.pdf: Hikingbook.pl/Process


  • Hikingbook06.pdf
  • HikingbookSwitzerland05.pdf
  • Hikingbook04.pdf
  • Hikingbook03.pdf Hikingbook02.pdf Hikingbook01.pdf


  • Maps along a route
  • Atlas creation
  • Title page
  • Step by step directions with distance, elevation, street names and other POI information
  • Overview map
  • Elevation profile (out of node data ele-tag and srtm data if present)
  • Detail maps (with autorotate optionally)
  • POI directory
  • Street directory
  • OSM file input
  • PDF output
  • Optional text description by user
  • Optional additional texts for step description

Parameters and options (v0.98)


perl hikingbook.pl -in=in.osm -out=route.pdf -relation=12345
perl hikingbook.pl -in=in.osm -out=atlas.pdf -atlas=8,50,9,51 -scale=50000

Add parameters and options to your liking:

-relation=<relation id>
-name=<relation name>
-ref=<relation ref>
-atlas=FLOAT,FLOAT,FLOAT,FLOAT (create street atlas for bounding box)
-detailstyle=<mapgen rules file for detail maps>
-overviewstyle=<mapgen rules file for overview maps>
-scale=<integer> (scale for detail maps); default = 10000

-title="title text" (for title page)
-desc=<tex file> (for long text after title page; tex format, max heading subsection
-steps=<step description file> (for descriptions of single steps or nodes; format: stepNr<space>TEXT)
-poi=<integer> (add poi directory to description, specify column number like 1,2,3)
-street=<integer> (add street directory to description, specify column number like 1,2,3)
-dirnumber=4|8 (4 or 8 different directions like N, S, E, W...); default=8
-lesssteps=INTEGER (reduce number of steps in description, step only if direction change > integer degrees)
-stepsize=INTEGER (size of step disc in map; 0 will suppress discs and labels)
-stepcolor=TEXT (color of step disc in map)
-stepfontsize=INTEGER (size of label for step disc in map)

-overlap=<percent> (10 for 10% overlap on each side; default=5)
-pnsizeoverview=INTEGER (size of page numbers in overview map)
-pnsizedetail=INTEGER (size of page numbers in detail maps)
-autorotate (rotate paper format automatically)

-reverse (reverse direction of relation/route)
-roundtrip (force route to begin/end with first way in relation)

-nodelete (temp files will not be deleted)

Step information file example

1 here we go
10 a long way to go
20 soon we are there

Description file example

\subsection*{Part 1 of the way}
some text here.
\subsection*{Part 2 of the way}
more text...


  • defaults for title and outFileName (v0.94)
  • roles of ways are checked now (v0.94)
  • elevation data will be extracted from srtm data if present in osm file (0.96)
  • street directory (v0.97)
  • Atlas creation (v0.98)

Todo / Ideas

  • missing elements details only in verbose mode
  • gpx file as route instead of relation
  • -large=INTEGER (would only draw cities, towns etc. - depending on level - in overview map) This would enable the program to create real large books with many many pages (large areas)
  • support tile server for map generation (no suitable solution found yet. taho.pl would be best, but still lots of shortcomings)
  • a5 support (problems with latex; map generation ok)
  • program that explicitly lists all valid hiking relations of one osm file (and creates hiking books)
  • Maperitive support

Hikingbook.pl/Other Ideas



  • Mapgen.pl
  • gs (ghostscript)
  • latex (latex, dvips, ps2pdf)
  • Osmosis
  • pdfjoin (package pdfjam)


perl hikingbook.pl -help