diff --git a/include/mapnik/ctrans.hpp b/include/mapnik/ctrans.hpp index 251fbee80..7be47dfc4 100644 --- a/include/mapnik/ctrans.hpp +++ b/include/mapnik/ctrans.hpp @@ -186,6 +186,20 @@ public: return c; } + inline box2d forward(const box2d& e,proj_transform const& prj_trans) const + { + double x0 = e.minx(); + double y0 = e.miny(); + double x1 = e.maxx(); + double y1 = e.maxy(); + double z = 0.0; + prj_trans.backward(x0,y0,z); + forward(&x0,&y0); + prj_trans.backward(x1,y1,z); + forward(&x1,&y1); + return box2d(x0,y0,x1,y1); + } + inline box2d forward(const box2d& e) const { double x0 = e.minx(); @@ -197,6 +211,20 @@ public: return box2d(x0,y0,x1,y1); } + inline box2d backward(const box2d& e,proj_transform const& prj_trans) const + { + double x0 = e.minx(); + double y0 = e.miny(); + double x1 = e.maxx(); + double y1 = e.maxy(); + double z = 0.0; + backward(&x0,&y0); + prj_trans.forward(x0,y0,z); + backward(&x1,&y1); + prj_trans.forward(x1,y1,z); + return box2d(x0,y0,x1,y1); + } + inline box2d backward(const box2d& e) const { double x0 = e.minx();