Pastebin launched a little side project called HostCabi.net, check it out ;-)Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Jun 15th, 2012  |  syntax: None  |  size: 0.67 KB  |  hits: 29  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. mapnik::projection const *_merc =  new mapnik::projection("+init=epsg:3857");
  2. mapnik::projection const *_wgs84 = new mapnik::projection("+init=epsg:4326");
  3. mapnik::proj_transform const *transformer_ = new mapnik::proj_transform(*_merc, *_wgs84);
  4.  
  5. std::clog << "before reprojection:\n";
  6. mapnik::coord2d c = bb.center();
  7. std::clog << std::setw(10) << c.y << "," << c.x << "\n";
  8.  
  9. {
  10.     std::clog << "after reprojection:\n";
  11.     transformer_->backward(bb);
  12.     transformer_->forward(bb);
  13.     mapnik::coord2d c = bb.center();
  14.     std::clog << std::setw(10) << c.y << "," << c.x << "\n";
  15. }
  16.  
  17. /*
  18. produces output:
  19.  
  20. before reprojection:
  21.    85.0483,-179.967
  22. after reprojection:
  23.    85.0442,-179.967
  24. */