Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mapnik::projection const *_merc = new mapnik::projection("+init=epsg:3857");
- mapnik::projection const *_wgs84 = new mapnik::projection("+init=epsg:4326");
- mapnik::proj_transform const *transformer_ = new mapnik::proj_transform(*_merc, *_wgs84);
- std::clog << "before reprojection:\n";
- mapnik::coord2d c = bb.center();
- std::clog << std::setw(10) << c.y << "," << c.x << "\n";
- {
- std::clog << "after reprojection:\n";
- transformer_->backward(bb);
- transformer_->forward(bb);
- mapnik::coord2d c = bb.center();
- std::clog << std::setw(10) << c.y << "," << c.x << "\n";
- }
- /*
- produces output:
- before reprojection:
- 85.0483,-179.967
- after reprojection:
- 85.0442,-179.967
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement