artemp/mapnik — Issue #146: Expose the forward and inverse methods on the Coord and Envelope python classes
Author: artemp
Created: 2011-10-11 15:59:53+00:00
State: closed
Labels: Agg_Renderer

The attached patch provides the _forward and _inverse methods at class methods on the Coord and Envelope boost::python objects.

To use do:
{{{
#!python
>>> from mapnik import *
>>> e = Envelope(-122,48,68,45)
>>> c = Coord(-122,48)
>>> p = Projection('+init=epsg:3395')
>>> c.forward(p)
Coord(-13580977.8768,6075085.09006)
>>> e.forward(p)
Envelope(-13580977.8768,5591295.91855,7569725.37394,6075085.09006)
}}}

which will do the same thing as:
{{{
#!python
>>> p.forward(e)
Envelope(-13580977.8768,5591295.91855,7569725.37394,6075085.09006
}}}