Created
December 21, 2011 14:48
-
-
Save tmcw/1506281 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | |
*/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment