Closed gorishaa9 closed 4 years ago
Hi,
I am running into an unexpected problem. A snippet of the code is as follows:
cout << minX << "\t" << minY << "\t" << maxX << "\t" << maxY << "\n"; boost::shared_ptr<osmium::Box> box{new osmium::Box(minX, minY, maxX, maxY)}; cout << box->bottom_left().x() << "\t" << box->bottom_left().y() << "\t" << box->top_right().x() << "\t" << box->top_right().y() << "\n \n";
cout << minX << "\t" << minY << "\t" << maxX << "\t" << maxY << "\n";
boost::shared_ptr<osmium::Box> box{new osmium::Box(minX, minY, maxX, maxY)};
cout << box->bottom_left().x() << "\t" << box->bottom_left().y() << "\t" << box->top_right().x() << "\t" << box->top_right().y() << "\n \n";
And I obtain the following result:
1011805074 2682240255 1011814894 2682245203 -2147483648 -2147483648 -2147483648 -2147483648
1011805074 2682240255 1011814894 2682245203
-2147483648 -2147483648 -2147483648 -2147483648
What could be the possible reason for this? I tried this for different coordinates but the result was the same. Please let me know. Thanks.
Box expects coordinates in WGS84 when you are using that constructor. Your coordinates are way out of bounds so you get an invalid Box object. I'll amend the documentation to make this clearer.
Okay, thanks.
Hi,
I am running into an unexpected problem. A snippet of the code is as follows:
cout << minX << "\t" << minY << "\t" << maxX << "\t" << maxY << "\n";
boost::shared_ptr<osmium::Box> box{new osmium::Box(minX, minY, maxX, maxY)};
cout << box->bottom_left().x() << "\t" << box->bottom_left().y() << "\t" << box->top_right().x() << "\t" << box->top_right().y() << "\n \n";
And I obtain the following result:
1011805074 2682240255 1011814894 2682245203
-2147483648 -2147483648 -2147483648 -2147483648
What could be the possible reason for this? I tried this for different coordinates but the result was the same. Please let me know. Thanks.