Package: hm-render-mapnik
Render paper maps from Openstreetmap data using mapnikThis program renders an area with given boundaries using data from Openstreetmap. It is designed to work with hikingmap but it can be used standalone as well if desired.InstallationClone this repository and run the following command in the created directory.pythonsetup.pyinstallUsagehm-render-mapnik [OPTION]... [gpxfiles]... bbox|center ...Options:ParameterDescription--pagewidthPage width in cm--pageheightPage height in cm-b, --basenameBase filename without extension-tTemp track file to render. This is used by hikingmap to draw the page boundaries of the overview map, the tracks will be saved as a temporary GPX file.-yTemp waypoints file to render. This is used by hikingmap to render the distance each kilometer or mile, the waypoints will be saved as a temporary GPX file.-v, --verboseDisplay extra information while processing.-h, --helpDisplay help-d, --dpiAmount of detail to render in dots per inch, default 300-S, --scale-factorScale factor, default 1.0-m, --mapstyleMapnik stylesheet file, default mapnik_style.xml--hikingmapstyleHikingmap stylesheet file, contains the CartoCSS for the tracks and the waypoints. The default is hikingmapstyle.xml, see the repository for an example.-f, --formatOutput format. Consult themapnik documentationfor possible values, default pnggpxfilesThe GPX track(s) to render.After these parameters you are required to make a choice between bbox and center. In bbox mode the rendered area will be a defined bounding box and in center mode you can specify a center coordinate and a scale.Options for bbox mode:ParameterDescription-o, --minlonMinimum longitude of the page-O, --maxlonMaximum longitude of the page-a, --minlatMinimum latitude of the page-A, --maxlatMaximum latitude of the pageNote that mapnik will maintain the aspect ratio, the rendered area may not correspond exactly to the given boundary.Options for center mode:ParameterDescription--lonLongitude of the center of the page--latLatitude of the center of the page--scaleScale denominator, default 50000Configuration fileBecause most of the time you will want to use the same parameters, you can optionally override the defaults in a configuration file. hm-render-mapnik will search for a file hm-render-mapnik.config.xml in the current directory, if not found it will resort to ~/.hm-render-mapnik.config.xml<?xml version="1.0" encoding="utf-8"?>
<hm-render-mapnik>
    <mapstyle>mapnik_style.xml</mapstyle>
    <hikingmapstyle>hikingmap_style.xml</hikingmapstyle>
    <outputformat>pdf</outputformat>
    <dpi>300</dpi>
    <scalefactor>1.0</scalefactor>
    <fontdirs>
        <fontdir>/usr/share/fonts/noto</fontdir>
        <fontdir>/usr/share/fonts/noto-cjk</fontdir>
        <fontdir>/usr/share/fonts/TTF</fontdir>
    </fontdirs>
</hm-render-mapnik>Options:TagDescriptionmapstyleMapnik stylesheet file, contains the style to draw the map.hikingmapstyleHikingmap stylesheet file, contains the CartoCSS for the tracks and the waypoints, see the repository for an example.outputformatOutput format. Consult themapnik documentationfor possible values.dpiAmount of detail to render in dots per inch. This value is unrelated to the setting on your printer, a higher value will simply result in smaller icons, thinner roads and unreadable text.scalefactorThe scale factor to compensate for a higher dpi value.fontdirsOptional. Can contain one or more fontdir subtags with additional font directories to be used by mapnik.PrerequisitesTo run this script you should have a working installation ofpython 3andmapnik. Make sure you also havepython-mapnikinstalled.Configuration of the mapnik stylesheetThe mapnik stylesheet should be configured before use and you need to set up a datasource as well. Consult CONFIG.md in this repository for a detailed explanation on how to achieve this.RoadmapCopyright text on the bottom of each page, as requested byOpenStreetMap.A new stylesheet allowing the map to be printed in black and white. There is nothing wrong with the OpenStreetMap stylesheet, but when printed the difference between for example water and forest is not clear. Text is not always readable and some information is irrelevant for hiking or cycling.Hillshading. There is an experimental script to import elevation data as hillshading in the database but it is probably better to work with a geotiff file. The subject needs more studying first.