Skip to main content

Create static map images with markers, geodesic lines, ...

Project description

Build Status

StaticMapMaker

  • Markers
  • Geodesic lines
  • Automatic guessing of the maps center and zoom (based on added objects)
  • Full anti-aliasing of drawn objects (via cairo)
  • Caching of tile images

Installation

StaticMapMaker is available as a Python package, which can be installed via pip:

pip install staticmapmaker

All the rendering is done with pycairo which depends on the cairo libraries (Ubuntu package: libcairo2-dev).

Usage

import staticmapmaker as sm

ctx = sm.Context()
ctx.add_object(sm.Marker(sm.latlng(12, 34)))
ctx.add_object(sm.Line([sm.latlng(12, 34), sm.latlng(12.5, 34.5)]))
image = ctx.render(800, 600)
image.write_to_png('my-map.png')

See the examples directory for more detailed usage examples.

Setting-Up a Development Environment

(Instructions for Ubuntu)

sudo apt-get install libcairo2-dev

git clone https://github.com/flopp/staticmapmaker

cd staticmapmaker

virtualenv -p python3 env
source env/bin/activate

pip install -r requirements.txt -r requirements-dev.txt

# run linter (flake8)
make lint

# run unit-tests (pytest)
make test

# run example scripts
PYTHONPATH=. examples/zrh_swiss_destinations.py
PYTHONPATH=. cli/main.py --help

License

Copyright 2017 Florian Pigorsch & Contributors. All rights reserved.

Use of this source code is governed by a MIT-style license that can be found in the LICENSE file.

Project details


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
staticmapmaker-0.1.2-py3-none-any.whl (13.1 kB) Copy SHA256 hash SHA256 Wheel py3
staticmapmaker-0.1.2.tar.gz (10.2 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page