<div dir="ltr">Thanks Carlos, we've employed the method you've suggested already but not getting the results we are looking for, perhaps the linked image will help illustrate my problem  <div><br></div><div><a href="https://drive.google.com/file/d/0BwWJtNuZjvCUR1AtVEZVLTdCbk0/view?usp=sharing">https://drive.google.com/file/d/0BwWJtNuZjvCUR1AtVEZVLTdCbk0/view?usp=sharing</a><br></div><div> </div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">On 8 September 2017 at 16:25, Carlos Ruiz <span dir="ltr"><<a href="mailto:boolean10001@yahoo.com" target="_blank">boolean10001@yahoo.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div style="font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:13px"><div><div>Travis,</div><div><br></div><div>Do you have the polygons in PostGIS ? Maybe you can get the extent by using st_extent(geom) and retrieve it on PHP/Python to set the map extent. You could also get a margin by multiplying extent b 1.1 (10%).</div><div><br></div><br></div><div><br></div>
            
            </div><div id="m_1727125107000336384ydpe0229a2fyahoo_quoted_4918075102" class="m_1727125107000336384ydpe0229a2fyahoo_quoted">
                <div style="font-family:'Helvetica Neue',Helvetica,Arial,sans-serif;font-size:13px;color:#26282a"><span class="">
                    
                    <div>
                        On Thursday, September 7, 2017, 1:27:06 PM CDT, Travis Kirstine <<a href="mailto:traviskirstine@gmail.com" target="_blank">traviskirstine@gmail.com</a>> wrote:
                    </div>
                    <div><br></div>
                    <div><br></div>
                    </span><div><span class=""><div id="m_1727125107000336384ydpe0229a2fyiv0111190909"><div dir="ltr">I have a bunch of polygons that represent 8.5 x 11 printed map sheets.  I'd like to produce images for each sheet that best fits the polygon within the outputted image.  We've tried using mapscript by setting the map extent based on the bbox of the source polygon and rotation but results aren't great depending on the orientation of the source polygon.  Is there a way to set the "extent" based on a polygon? </div></div></span>______________________________<wbr>_________________<br>mapserver-users mailing list<br><a href="mailto:mapserver-users@lists.osgeo.org" rel="nofollow" target="_blank">mapserver-users@lists.osgeo.<wbr>org</a><br><a href="https://lists.osgeo.org/mailman/listinfo/mapserver-users" rel="nofollow" target="_blank">https://lists.osgeo.org/<wbr>mailman/listinfo/mapserver-<wbr>users</a></div>
                </div>
            </div></div></div></blockquote></div><br></div>