<html><head><style type="text/css"><!-- DIV {margin:0px;} --></style></head><body><div style="font-family:arial,helvetica,sans-serif;font-size:10pt"><div style="font-family: arial,helvetica,sans-serif; font-size: 10pt;">I'm thinking the most accurate way to do it is to use a projection that supports miles that is close to your current extent...&nbsp; or&nbsp; use something crappy like Mercator.<br><br>This code is off the top of my head, without looking at any docs... so bear with me if there are errors.<br><br>$latlon = ms_newProjectionObj("proj=EPSG:4230"); # IIRC<br>$proj = ms_newProjectionObj("proj=EPSG:3758"); # Popular Web-mapping projection<br><br>$centerPoint = ms_newPointObj($x, $y); # in lat long<br><br>$centerPoint-&gt;project($latlon, $proj);<br><br>$minPoint = ms_newPointObj();<br>$maxPoint = ms_newPointObj();<br><br>$mInM = 1609; # mile in meters, as 3758 is in meters<br>$minPoint-&gt;setXY($centerPoint.x - $mInM, $centerPoint.y -
 $mInM);<br>$maxPoint-&gt;setXY($centerPoint.x + $mInM, $centerPoint.y + $mInM);<br><br>$minPoint-&gt;project($proj, $latlon);<br>$maxPoint-&gt;project($proj, $latlon);<br><br>return implode(',',array($minPoint-&gt;x,$minPoint-&gt;y,$maxPoint-&gt;x,$maxPoint-&gt;y));<br><br><br><br><br><div style="font-family: times new roman,new york,times,serif; font-size: 12pt;"><font face="Tahoma" size="2"><hr size="1"><b><span style="font-weight: bold;">From:</span></b> Oscar Fdez. &lt;ofarcis@gmail.com&gt;<br><b><span style="font-weight: bold;">To:</span></b> mapserver-dev@lists.osgeo.org<br><b><span style="font-weight: bold;">Sent:</span></b> Wednesday, March 11, 2009 11:53:26 PM<br><b><span style="font-weight: bold;">Subject:</span></b> [mapserver-dev] Calculate Bounding Box...<br></font><br>



 
 
<style>
<!--
 
 _filtered {font-family:Calibri;panose-1:2 15 5 2 2 2 4 3 2 4;}
 _filtered {font-family:Tahoma;panose-1:2 11 6 4 3 5 4 4 2 4;}
 
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;margin-bottom:.0001pt;font-size:12.0pt;font-family:"Times New Roman", "serif";}
a:link, span.MsoHyperlink
        {color:blue;text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {color:purple;text-decoration:underline;}
p.MsoAcetate, li.MsoAcetate, div.MsoAcetate
        {margin:0cm;margin-bottom:.0001pt;font-size:8.0pt;font-family:"Tahoma", "sans-serif";}
span.EstiloCorreo17
        {font-family:"Calibri", "sans-serif";color:windowtext;}
span.TextodegloboCar
        {font-family:"Tahoma", "sans-serif";}
.MsoChpDefault
        {}
 _filtered {margin:70.85pt 3.0cm 70.85pt 3.0cm;}
div.Section1
        {}
-->
</style>



<div class="Section1">

<p class="MsoNormal"><span style="color: black;" lang="EN-US">Hi to all,<br>
<br>
Any people know how to calculate the bounding box from lon/lat coordinates.<br>
<br>
An example:<br>
<br>
I have a point in -8.0572,42.4702 (lon/lan). I like a bounding box arround 1
mile of this site. Can use any SRS like EPSG:4230 or another.<br>
<br>
</span><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black;" lang="EN-US">Any solution is accepted independent of language. I translate to
my need. I hope develop in php mapscript, but the solution can made in any
languageā€¦</span></p> 

<p class="MsoNormal"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black;" lang="EN-US"> &nbsp;</span></p> 

<p class="MsoNormal"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black;" lang="EN-US">Thanks for all,</span></p> 

<p class="MsoNormal"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;; color: black;" lang="EN-US">Oscar.</span></p> 

<p class="MsoNormal"> &nbsp;</p> 

<p class="MsoNormal"> &nbsp;</p> 

<p class="MsoNormal"><span style="font-size: 11pt; font-family: &quot;Calibri&quot;,&quot;sans-serif&quot;;"> &nbsp;</span></p> 

</div>

</div></div></div><br>

      </body></html>