kartograph/kartograph.py — Issue #6: Rework Python API
Author: gka
Created: 2011-12-29 01:23:05+00:00
State: open

The Python API definitely needs some love.

By now, to render a map via Python script, one must write the following code. That KartographOptions part is not very intuitive..

from lib.kartograph import Kartograph, KartographOptions
import lib.proj

opt = KartographOptions()
opt.out_height = 600
opt.round_coordinates = True
opt.out_padding_perc = 0.03
opt.projection = lib.proj.projections['laea']
opt.applyDefaults()

k = Kartograph(opt)
k.render_country_and_context("USA")