Hikingmap

Introduction

This document describes how to use the hikingmap application. The script takes one or more GPS tracks as input and will try to calculate the minimum amount of pages needed to print the complete track, choosing between portrait and landscape on the fly. The actual rendering of the maps will be done by an external script.

Disclaimer

The scripts in this document are written and verified to work in a Linux environment. There is no reason it shouldn't work on Windows, Mac OS or other operating systems, but it might require additional steps or a slightly different approach. If you have any questions or feedback, you are welcome to contact me on roel.derickx --at-- gmail.

Table of contents

  1. Download
  2. Rendering
    1. Renderer projects
    2. Writing your own renderer
  3. Hikingmap
    1. Usage
    2. Results
    3. Roadmap

Download

You can find the hikingmap package on github, to run the scripts you need a working installation of Python.

Return to table of contents

Rendering

Hikingmap will only calculate the page boundaries, the actual rendering will be done by an external render script. You can either choose one from the list below or write your own.

Renderer projects

Writing your own renderer

All you have to do to write your own renderer is to create a directory with a render.py script inside. Hikingmap passes certain parameters, you are free to use or ignore them as you wish. A good start is the dummy renderer included in the hikingmap package, it contains already a class for parsing all parameters.
-o Minimum longitude of the area boundaries
-O Maximum longitude of the area boundaries
-a Minimum latitude of the area boundaries
-A Maximum latitude of the area boundaries
-w Page width in cm
-h Page height in cm
-t Temp track file to render. This is used to draw the page boundaries of the overview map, hikingmap will save those as a temporary GPX file.
-y Temp waypoints file to render. This is used to render the distance each kilometer or mile, hikingmap will save those waypoints as a temporary GPX file.
-v, --verbose Display extra information while processing.
-h, --help Display help
gpxfiles The GPX track(s) to render.

Return to table of contents

Hikingmap

Usage

hikingmap.py [OPTION]... gpxfiles... Options:
-s --scale The scale denominator
--pagewidth The width of the resulting map in portrait orientation. The application will automatically use pageheight when rendering in landscape orientation. The value should be the width of the desired papersize minus the horizontal margins on both sides.
--pageheight The height of the resulting map in portrait orientation. The application will automatically use pagewidth when rendering in landscape orientation. The value should be the height of the desired papersize minus the vertical margins on both sides.
--pageoverlap The amount of overlap between two consecutive pages, in cm.
--overview Generate overview map.
-w --waypoints If this parameter is given the cumulative distance from the origin will be rendered each N kilometers or miles.
-u --unit Length unit in which the value of the waypoints parameter is expressed. Possible values are km or mi.
-o --page-order Order in which pages are generated. Possible values are naturalorder, rectoverso or book.
-b --basename Output filename base. All output file names will start with this parameter, followed by a sequence number and a file extension depending on the specified format.
-r --renderdir Directory containing the renderscript.
-v --verbose Display extra information while processing.
-h --help Display help
gpxfiles The GPX track(s) to follow. More than one GPX file can be given, the script will render all tracks given.
The hikingmap script will try to render the complete track on a minimum of pages. Because it is particularly hard for an algorithm to decide what should be on the map and what shouldn't, the following rules are implemented:

Results

Below you can find part of a rendered track. The maps were rendered on a 1:50000 scale for A4 paper size. The resulting PDF files were converted to PNG and subsequently scaled down to save bandwith, they are included here only as an example to show how the track is rendered and how pages fit together. Click on the image for a larger view.

Roadmap

Return to table of contents

Creative Commons License
This page is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.

This page was last updated on october 11, 2019