OpenStreetMap tiles to pdf
mrkvon fd73c5b2a2 v2.2.4 7 months ago
fonts/OpenSans add forgotten files, add Apache License to OpenSans font 7 months ago
src consider elevation in counting distance 7 months ago
.gitignore code of osm2pdf v1 rewritten in typescript and refactored 1 year ago
.prettierrc Setup package 1 year ago
README.md add distance labels, refactor code 7 months ago
example.png add example and improve readme 9 months ago
jestconfig.json Setup package 1 year ago
package.json v2.2.4 7 months ago
tsconfig.json code of osm2pdf v1 rewritten in typescript and refactored 1 year ago
tslint.json Setup package 1 year ago
yarn.lock add forgotten files, add Apache License to OpenSans font 7 months ago

README.md

OSM map to pdf

Generate pdf with OpenStreetMap tiles.

example output of osm2pdf with --path parameter

Video

How to download OpenStreetMap with osm2pdf

Install

sudo yarn global add osm2pdf
# or
sudo npm install -g osm2pdf

Use

Download a route

You need to provide a route in gpx format. You can download it on graphhopper website. Find your route and click GPX export button.

osm2pdf --route --zoom=10 --input=path/to/route.gpx --output=path/to/output

or if you want to also draw the path on the map

osm2pdf --path --zoom=10 --input=path/to/route.gpx --output=path/to/output --distance --distance-step=20

Download a map

You need to provide boundaries of the area you want to download.

osm2pdf --north=70.923 --west=-4.373 --south=55.756 --east=27.872 --zoom=9 --output=path/to/output

Help

osm2pdf -h
# or
osm2pdf --help

Node compatibility

We use ECMAScript Modules which are supported since Node v8.

Use responsibly

OpenStreetMap is run by a not-for-profit foundation. This application uses resources provided by them. Please read the OSM Tile Usage Policy and follow it. Use osm2pdf responsibly and consider donating to OSM Foundation.

The authors are not affiliated with OSM Foundation.