artemp/mapnik — Issue #770: exposing more robust transform functions as an option during rendering
Author: artemp
Created: 2011-10-11 16:36:03+00:00
State: open
Labels: Core_Library

This appears to be a scenario where either a maximum-extent is needed (ahead of time for lambert conformal conic) or we need to move to using at least 16 points to reproject bbox's during rendering:

{{{
#!python
>>> from mapnik2 import *
>>>
>>> lcc = Projection('+proj=lcc +lat_1=47.5 +lat_2=48.73333333333333 +lat_0=47 +lon_0=-120.8333333333333 +x_0=500000 +y_0=0 +ellps=GRS80 +units=m +no_defs +over')
>>>
>>> wgs84 = Projection('+proj=longlat +ellps=WGS84 +datum=WGS84 +no_defs +over')
>>>
>>> tr = ProjTransform(lcc,wgs84)
>>>
>>> box = Box2d(-970507.3298693972,-2500904.488569449,5147823.114829574,1577982.474563198) # cumulative extent of layers in wgs84 back projected into lcc
>>>
>>> tr.forward(box)
Box2d(-134.241136638,23.9718668905,-57.1852565094,42.8527416834)
>>> tr.forward(box,8)
Box2d(-146.32467905,15.2636742033,-57.1852565096,58.9035299023)
>>> tr.forward(box,16)
Box2d(-146.32467905,15.2636742033,-57.1852565096,61.0546815177)
}}}