If you'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'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"><<a href="mailto:Jukka.Rahkonen@mmmtike.fi">Jukka.Rahkonen@mmmtike.fi</a>></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&version=1.1.0&request=getCapabilities&map=c" target="_blank">http://localhost/cgi-bin/mapserv.exe?service=WMS&version=1.1.0&request=getCapabilities&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>
<Layer queryable="0" opaque="0" cascaded="0"><br>
<Name>landuse_layer5</Name><br>
<!-- WARNING: Mandatory metadata '..._title' was missing in this context. --><br>
<Title>landuse_layer5</Title><br>
<SRS>EPSG:3067</SRS><br>
<LatLonBoundingBox minx="-7.18554e+205" miny="-90" maxx="7.18554e+205" maxy="90" /><br>
<BoundingBox SRS="EPSG:3067"<br>
minx="-3.40282e+038" miny="-3.40282e+038" maxx="3.40282e+038" maxy="3.40282e+038" /><br>
<ScaleHint min="0" max="2494.51923117667" /><br>
</Layer><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>
> Hi,<br>
<br>
> Thanks for the reply.<br>
<br>
> 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>
> It would be really helpful if you can paste any sample code for that if you<br>
have any.<br>
<br>
> Thanks and regards,<br>
> 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>