Skip to main content

Create map images from slippy map tiles.

Project description

Map Maker

mapmaker is a simple script to generate map images for “Slippy Tile” maps. Map tiles are downloaded from services such as OpenStreetMap and are combined into a single image.

Installation

Use the installation script:

$ python setup.py install

Or install using pip:

$ pip install mapmaker

Command Line Usage

Use mapmaker --help to show a detailed list of options.

Basic Usage

This will create a file map.png in the current directory. The map will cover the bounding box specified with two pairs of lat/lon coordinates:

$ mapmaker  47.44,10.95 47.37,11.13

One can also specify a center point and a radius:

$ mapmaker 63.0695,-151.0074 100km

If the coordinates start with a negative value, use -- to indicate the end of command line flags:

$ mapmaker -- -32.653197,-70.0112 100km

You can also specify the output file (default is map.png):

$ mapmaker 63.0695,-151.0074 100km denali.png

Additional Options

Specify the zoom level with the --zoom flag. The default is 8. Higher values mean more detail and result in larger map images.

$ mapmaker --zoom 12 63.0695,-151.0074 100km

Use --style to control the look of the map:

$ mapmaker --style human 63.0695,-151.0074 100km

Use the --shading flag to overlay a hillshading layer over the map image. Note that hillshading is not available for all reagions.

$ mapmaker --shading 45.83,6.88 100km

Note that some map styles already come with hillshading.

Configuration

The configuration file is located at ~/.config/mapmaker/config.ini

Styles (Tile Servers)

You can specify additional map styles like this:

# ~/.config/mapmaker/config.ini

[services]
osm   = https://tile.openstreetmap.org/{z}/{x}/{y}.png
topo  = https://{s}.tile.opentopomap.org/{z}/{x}/{y}.png

Where osm is the name of the style (as used in the --style flag) and the URL is the URL pattern for downloading tiles.

The URL pattern contains three variables:

z:

zoom level

x:

X-coordinate of the tile

y:

Y-coordinate of the tile

See for example https://wiki.openstreetmap.org/wiki/Tiles.

The URL may contain an additional placeholder for an API Key (see below):

atlas = https://tile.thunderforest.com/atlas/{z}/{x}/{y}.png?apikey={api}
                                                                     ^^^

Authorization

Authorization is needed for the following services:

Domain

Type

Homepage

tile.thunderforest.com

API Key

https://www.thunderforest.com/

maps.geoapify.com

API Key

https://www.geoapify.com/

Most services offer a free plan for limited/non-commercial use. Check out the URL from the table above.

Once you have registered, place your API Keys in a config file like this:

# ~/.config/mapmaker/config.ini

[keys]
tile.thunderforest.com  = YOUR_API_KEY
maps.geoapify.com       = YOUR_API_KEY

Where tile.thunderforest.com is the domain from which the image tiles are requested.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mapmaker-1.0.0.tar.gz (10.9 kB view details)

Uploaded Source

Built Distribution

mapmaker-1.0.0-py3-none-any.whl (10.8 kB view details)

Uploaded Python 3

File details

Details for the file mapmaker-1.0.0.tar.gz.

File metadata

  • Download URL: mapmaker-1.0.0.tar.gz
  • Upload date:
  • Size: 10.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for mapmaker-1.0.0.tar.gz
Algorithm Hash digest
SHA256 48a078e405a68f3b58290016802c061ebb39ce7b16a033cfb1644705d78ad6bf
MD5 1750a3de92e1c6a49ddc990ce12a49b8
BLAKE2b-256 348c06d5100564349309f32384250ea7fd6810fb7a233464b19e7cbb6ea89b51

See more details on using hashes here.

File details

Details for the file mapmaker-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: mapmaker-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 10.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.4.2 importlib_metadata/4.8.1 pkginfo/1.7.1 requests/2.25.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.9.7

File hashes

Hashes for mapmaker-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f29195988d9bf327782108a03c43b9dd657985ca72b92855e252ac52e9d65a76
MD5 43c76f457df524f1e5e5ee1f0a1e914c
BLAKE2b-256 5f7ce19884b076c9274126730c6766d6679f704c8c131db138ff24461f33ac24

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page