If you&#39;re reading from Postgres, you can use de Extent function of postgis.<div>something like: </div><div>SELECT EXTENT(<i>geo_field</i>)) FROM <i>geotable </i></div><div>and you&#39;ll get de bbox.</div><div><i><br></i></div>
<div>and you can also use de expand function to retrive the bbox expanded in all directions by an amount specified in the sql.</div><div><br></div><div>take a look at.</div><div><br></div><div><i><a href="http://postgis.refractions.net/documentation/manual-1.3/ch06.html">http://postgis.refractions.net/documentation/manual-1.3/ch06.html</a></i></div>
<div><i><br></i></div><div><i>Regards,</i></div><div><i>Luis<br></i><br><div class="gmail_quote">2010/7/3 Rahkonen Jukka <span dir="ltr">&lt;<a href="mailto:Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>&gt;</span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">Hi,<br>
<br>
Sorry, I do not make code, but you should make your application to send the getCapabilities request like<br>
<a href="http://localhost/cgi-bin/mapserv.exe?service=WMS&amp;version=1.1.0&amp;request=getCapabilities&amp;map=c" target="_blank">http://localhost/cgi-bin/mapserv.exe?service=WMS&amp;version=1.1.0&amp;request=getCapabilities&amp;map=c</a>:\ms4w\osm-mapserver.map<br>

<br>
and capture the extents from the returned document which will have this kind of sections for each layer<br>
<br>
   &lt;Layer queryable=&quot;0&quot; opaque=&quot;0&quot; cascaded=&quot;0&quot;&gt;<br>
        &lt;Name&gt;landuse_layer5&lt;/Name&gt;<br>
&lt;!-- WARNING: Mandatory metadata &#39;..._title&#39; was missing in this context. --&gt;<br>
        &lt;Title&gt;landuse_layer5&lt;/Title&gt;<br>
        &lt;SRS&gt;EPSG:3067&lt;/SRS&gt;<br>
        &lt;LatLonBoundingBox minx=&quot;-7.18554e+205&quot; miny=&quot;-90&quot; maxx=&quot;7.18554e+205&quot; maxy=&quot;90&quot; /&gt;<br>
        &lt;BoundingBox SRS=&quot;EPSG:3067&quot;<br>
                    minx=&quot;-3.40282e+038&quot; miny=&quot;-3.40282e+038&quot; maxx=&quot;3.40282e+038&quot; maxy=&quot;3.40282e+038&quot; /&gt;<br>
        &lt;ScaleHint min=&quot;0&quot; max=&quot;2494.51923117667&quot; /&gt;<br>
      &lt;/Layer&gt;<br>
<br>
Please notice that the both bounding boxes in this example are nonsense and I should obviously check my mapfile for correcting them.<br>
<font color="#888888"><br>
<br>
-Jukka Rahkonen-<br>
</font><div><div></div><div class="h5"><br>
<br>
<br>
 Kiran Bandal wrote:<br>
<br>
&gt; Hi,<br>
<br>
&gt; Thanks for the reply.<br>
<br>
&gt; Just to let you know, I am reading my vector data from PostgreSQL. So, can I<br>
use WMS GetCapabities request in that case.<br>
<br>
&gt; It would be really helpful if you can paste any sample code for that if you<br>
have any.<br>
<br>
&gt; Thanks and regards,<br>
&gt; Kiran.<br>
--<br>
View this message in context: <a href="http://osgeo-org.1803224.n2.nabble.com/How-to-get-full-extent-of-the-map-tp5248342p5250366.html" target="_blank">http://osgeo-org.1803224.n2.nabble.com/How-to-get-full-extent-of-the-map-tp5248342p5250366.html</a><br>

Sent from the Mapserver - User mailing list archive at Nabble.com.<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
<br>
_______________________________________________<br>
mapserver-users mailing list<br>
<a href="mailto:mapserver-users@lists.osgeo.org">mapserver-users@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/mapserver-users" target="_blank">http://lists.osgeo.org/mailman/listinfo/mapserver-users</a><br>
</div></div></blockquote></div><br></div>