Boost C++ Libraries: Ticket #12439: Problems with 180 and -180 meridian, using bg::cs::geographic<bg::degree> https://svn.boost.org/trac10/ticket/12439 <p> While calculating the envelope: </p> <pre class="wiki"> #include &lt;boost/range.hpp&gt; #include &lt;boost/iterator/iterator_facade.hpp&gt; #include &lt;boost/geometry/geometries/concepts/ring_concept.hpp&gt; #include &lt;boost/geometry/geometries/register/ring.hpp&gt; #include &lt;boost/geometry.hpp&gt; #include &lt;boost/geometry/geometries/geometries.hpp&gt; namespace bg = boost::geometry; namespace bgi = boost::geometry::index; typedef bg::model::point&lt;double, 2, bg::cs::geographic&lt; bg::degree&gt;&gt; point_t; typedef bg::model::ring&lt;point_t&gt; ring_t; ring_t ring {{-180, 0}, {180, 0}, {180, -85}, {-180, -85}, {-180, 0}}; auto aabb = bg::return_envelope&lt; bg::model::box&lt;point_t&gt; &gt;(ring); std::cout &lt;&lt; "max_corner lon =" &lt;&lt; aabb.max_corner().get&lt;0&gt;(); std::cout &lt;&lt; "min_corner lon =" &lt;&lt; aabb.min_corner().get&lt;0&gt;(); </pre><p> It prints both max_corner and min_corner longitude as 180 </p> en-us Boost C++ Libraries /htdocs/site/boost.png https://svn.boost.org/trac10/ticket/12439 Trac 1.4.3 awulkiew Tue, 03 Jan 2017 17:06:15 GMT <link>https://svn.boost.org/trac10/ticket/12439#comment:1 </link> <guid isPermaLink="false">https://svn.boost.org/trac10/ticket/12439#comment:1</guid> <description> <p> It's because in spherical and geographic coordinate systems degrees <code>-180</code> and <code>180</code> are the same longitude. The Geometry you created is segment-like Ring (invalid, with area = 0) lying on antimeridian so the envelope of this Ring should be <code>BOX(180 -85, 180 0)</code>. Or am I missing something? </p> </description> <category>Ticket</category> </item> </channel> </rss>