<html><head></head><body><div class="ydpc245ac3ayahoo-style-wrap" style="font-family: Helvetica Neue, Helvetica, Arial, sans-serif; font-size: 13px;"><div></div>
        <div dir="ltr" data-setdir="false">OK, so forget what I said about geometry specific, I think you want to look in the other direction, go up not down:</div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><span><a class="ydp66355051code" href="https://qgis.org/api/2.18/classQgsRectangle.html" style="color: rgb(70, 101, 162); font-family: monospace, fixed; white-space: pre-wrap; background-color: rgb(251, 253, 251);" rel="nofollow" target="_blank">QgsRectangle</a><span style="color: rgb(0, 0, 0); font-family: monospace, fixed; white-space: pre-wrap; background-color: rgb(251, 253, 251);"> </span><a class="ydp66355051code" href="https://qgis.org/api/2.18/classQgsAbstractGeometryV2.html#a03299e9ffd822ca658aca201458471a5" style="color: rgb(70, 101, 162); font-family: monospace, fixed; white-space: pre-wrap; background-color: rgb(251, 253, 251);" rel="nofollow" target="_blank">QgsAbstractGeometryV2::calculateBoundingBox</a><span style="color: rgb(0, 0, 0); font-family: monospace, fixed; white-space: pre-wrap; background-color: rgb(251, 253, 251);">()</span><span class="ydp66355051keyword" style="color: rgb(0, 128, 0); font-family: monospace, fixed; white-space: pre-wrap; background-color: rgb(251, 253, 251);"> const</span></span><br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><a href="https://qgis.org/api/2.18/qgsabstractgeometryv2_8" rel="nofollow" target="_blank">https://qgis.org/api/2.18/qgsabstractgeometryv2_8</a><a href="https://qgis.org/api/2.18/qgsabstractgeometryv2_8cpp_source.html#l00111" rel="nofollow" target="_blank">cpp_source.html#l00111</a><br></div><div dir="ltr" data-setdir="false"><br></div><div dir="ltr" data-setdir="false"><br></div><div><br></div>
        
        </div><div id="ydpf62361bbyahoo_quoted_3102284068" class="ydpf62361bbyahoo_quoted">
            <div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;">
                
                <div>
                    On Thursday, October 8, 2020, 03:28:59 PM EDT, Thayer Young <thayeray@yahoo.com> wrote:
                </div>
                <div><br></div>
                <div><br></div>
                <div><div id="ydpf62361bbyiv0033842491"><div><div class="ydpf62361bbyiv0033842491ydp4f06bcf4yahoo-style-wrap" style="font-family:Helvetica Neue, Helvetica, Arial, sans-serif;font-size:13px;"><div></div>
        <div dir="ltr">Hi Marian,</div><div dir="ltr"><br clear="none"></div><div dir="ltr">I think you are looking at an abstract method, that is implemented differently for each type of geometry.</div><div dir="ltr">So you need to dig deeper into the code to find the specific implementation of the bounding box or boundary method for polygons.</div><div dir="ltr">The link below at line 138 gives the boundary method for the multipolygonv2 geometry.</div><div dir="ltr"><a shape="rect" href="https://qgis.org/api/2.18/qgsmultipolygonv2_8cpp_source.html#l00138" rel="nofollow" target="_blank">https://qgis.org/api/2.18/qgsmultipolygonv2_8cpp_source.html#l00138</a><br clear="none"></div><div><br clear="none"></div><div dir="ltr">This may not specifically be what you are looking for, but hopefully it will help you find it.</div><div dir="ltr"><br clear="none"></div><div dir="ltr">-Thayer</div><div class="ydpf62361bbyiv0033842491yqt2130153973" id="ydpf62361bbyiv0033842491yqtfd02352"><div dir="ltr"><br clear="none"></div><div dir="ltr"><br clear="none"></div><div><br clear="none"></div></div></div><div class="ydpf62361bbyiv0033842491yqt2130153973" id="ydpf62361bbyiv0033842491yqtfd98784"><div class="ydpf62361bbyiv0033842491ydp36c73fd3yahoo_quoted" id="ydpf62361bbyiv0033842491ydp36c73fd3yahoo_quoted_2749264778"><div style="font-family:'Helvetica Neue', Helvetica, Arial, sans-serif;font-size:13px;color:#26282a;"><div><div dir="ltr">Message: 3<br clear="none"></div><div dir="ltr">Date: Thu, 8 Oct 2020 18:17:25 +0000<br clear="none"></div><div dir="ltr">From: "Tudorache, Marian" <<a shape="rect" href="mailto:Marian.Tudorache@navcanada.ca" rel="nofollow" target="_blank">Marian.Tudorache@navcanada.ca</a>><br clear="none"></div><div dir="ltr">To: "<a shape="rect" href="mailto:qgis-user@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user@lists.osgeo.org</a>" <<a shape="rect" href="mailto:qgis-user@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user@lists.osgeo.org</a>>,<br clear="none"></div><div dir="ltr">    "Qgis-user <<a shape="rect" href="mailto:qgis-user-bounces@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user-bounces@lists.osgeo.org</a>><br clear="none"></div><div dir="ltr">    (<a shape="rect" href="mailto:qgis-user-bounces@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user-bounces@lists.osgeo.org</a>)"<br clear="none"></div><div dir="ltr">    <<a shape="rect" href="mailto:qgis-user-bounces@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user-bounces@lists.osgeo.org</a>>,<br clear="none"></div><div dir="ltr">    "<a shape="rect" href="mailto:qgis-user-request@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user-request@lists.osgeo.org</a>"<br clear="none"></div><div dir="ltr">    <<a shape="rect" href="mailto:qgis-user-request@lists.osgeo.org" rel="nofollow" target="_blank">qgis-user-request@lists.osgeo.org</a>><br clear="none"></div><div dir="ltr">Subject: [Qgis-user] bounding box algorithm<br clear="none"></div><div dir="ltr">Message-ID:<br clear="none"></div><div dir="ltr">    <<a shape="rect" href="mailto:YTBPR01MB36777A269FA5AB1C954B8F23E60B0@YTBPR01MB3677.CANPRD01.PROD.OUTLOOK.COM" rel="nofollow" target="_blank">YTBPR01MB36777A269FA5AB1C954B8F23E60B0@YTBPR01MB3677.CANPRD01.PROD.OUTLOOK.COM</a>><br clear="none"></div><div dir="ltr">    <br clear="none"></div><div dir="ltr">Content-Type: text/plain; charset="utf-8"<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Hi,<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">The question is for the developers of QGIS.<br clear="none"></div><div dir="ltr">In my python classes I use a lot the boundingBox function for QgsGeometry class.<br clear="none"></div><div dir="ltr">I would like to know if it is possible to see the algorithm for this function.<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">I found this but it is not really the algorithm<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">  858<<a shape="rect" href="https://qgis.org/api/2.18/classQgsGeometry.html#adfc04c94b51cdeb55942b699fdd4d564" rel="nofollow" target="_blank">https://qgis.org/api/2.18/classQgsGeometry.html#adfc04c94b51cdeb55942b699fdd4d564</a>> QgsRectangle<<a shape="rect" href="https://qgis.org/api/2.18/classQgsRectangle.html" rel="nofollow" target="_blank">https://qgis.org/api/2.18/classQgsRectangle.html</a>> QgsGeometry::boundingBox<<a shape="rect" href="https://qgis.org/api/2.18/classQgsGeometry.html#adfc04c94b51cdeb55942b699fdd4d564" rel="nofollow" target="_blank">https://qgis.org/api/2.18/classQgsGeometry.html#adfc04c94b51cdeb55942b699fdd4d564</a>>() const<br clear="none"></div><div dir="ltr">  859 {<br clear="none"></div><div dir="ltr">  860  if ( d->geometry<<a shape="rect" href="https://qgis.org/api/2.18/structQgsGeometryPrivate.html#ac49a8dd9cb78a9d041d1a46ac6a7ef15" rel="nofollow" target="_blank">https://qgis.org/api/2.18/structQgsGeometryPrivate.html#ac49a8dd9cb78a9d041d1a46ac6a7ef15</a>> )<br clear="none"></div><div dir="ltr">  861  {<br clear="none"></div><div dir="ltr">  862  return d->geometry<<a shape="rect" href="https://qgis.org/api/2.18/structQgsGeometryPrivate.html#ac49a8dd9cb78a9d041d1a46ac6a7ef15" rel="nofollow" target="_blank">https://qgis.org/api/2.18/structQgsGeometryPrivate.html#ac49a8dd9cb78a9d041d1a46ac6a7ef15</a>>->boundingBox<<a shape="rect" href="https://qgis.org/api/2.18/classQgsAbstractGeometryV2.html#ac6806e752aeda4f347741a0c7eb37167" rel="nofollow" target="_blank">https://qgis.org/api/2.18/classQgsAbstractGeometryV2.html#ac6806e752aeda4f347741a0c7eb37167</a>>();<br clear="none"></div><div dir="ltr">  863  }<br clear="none"></div><div dir="ltr">  864  return QgsRectangle<<a shape="rect" href="https://qgis.org/api/2.18/classQgsRectangle.html" rel="nofollow" target="_blank">https://qgis.org/api/2.18/classQgsRectangle.html</a>>();<br clear="none"></div><div dir="ltr">  865 }<br clear="none"></div><div dir="ltr">  866<br clear="none"></div><div dir="ltr">Where<br clear="none"></div><div dir="ltr">I create some polygons with QGIS which are exported to another system which use a bounding box formula that gives infinity.<br clear="none"></div><div dir="ltr">The other system includes a check of the South Pole in the bounding box it also takes in consideration the orientation of the polygon coordinates.<br clear="none"></div><div dir="ltr">It seems in one of the orientation the South Pole is inside the bounding box and if I switch the orientation the South Pole is not anymore inside.<br clear="none"></div><div dir="ltr">QGIS seems to be immune of how the coordinates are oriented. Regardless of the order QGIS gives a finite bounding box without having a South Pole inside.<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">Can someone help me?<br clear="none"></div><div dir="ltr">Thank you,<br clear="none"></div><div dir="ltr">Marian<br clear="none"></div><div dir="ltr">Anyone can help me?<br clear="none"></div><div dir="ltr"><br clear="none"></div><div dir="ltr">________________________________</div></div>
            </div>
        </div></div></div></div></div>
            </div>
        </div></body></html>