[mapserver-users] Re: How to get full extent of the map?
Luis Treviño
ltrevinoh at gmail.com
Mon Jul 5 08:36:07 PDT 2010
If you're reading from Postgres, you can use de Extent function of postgis.
something like:
SELECT EXTENT(*geo_field*)) FROM *geotable *
and you'll get de bbox.
*
*
and you can also use de expand function to retrive the bbox expanded in all
directions by an amount specified in the sql.
take a look at.
*http://postgis.refractions.net/documentation/manual-1.3/ch06.html*
*
*
*Regards,*
*Luis
*
2010/7/3 Rahkonen Jukka <Jukka.Rahkonen at mmmtike.fi>
> Hi,
>
> Sorry, I do not make code, but you should make your application to send the
> getCapabilities request like
>
> http://localhost/cgi-bin/mapserv.exe?service=WMS&version=1.1.0&request=getCapabilities&map=c
> :\ms4w\osm-mapserver.map
>
> and capture the extents from the returned document which will have this
> kind of sections for each layer
>
> <Layer queryable="0" opaque="0" cascaded="0">
> <Name>landuse_layer5</Name>
> <!-- WARNING: Mandatory metadata '..._title' was missing in this context.
> -->
> <Title>landuse_layer5</Title>
> <SRS>EPSG:3067</SRS>
> <LatLonBoundingBox minx="-7.18554e+205" miny="-90"
> maxx="7.18554e+205" maxy="90" />
> <BoundingBox SRS="EPSG:3067"
> minx="-3.40282e+038" miny="-3.40282e+038"
> maxx="3.40282e+038" maxy="3.40282e+038" />
> <ScaleHint min="0" max="2494.51923117667" />
> </Layer>
>
> Please notice that the both bounding boxes in this example are nonsense and
> I should obviously check my mapfile for correcting them.
>
>
> -Jukka Rahkonen-
>
>
>
> Kiran Bandal wrote:
>
> > Hi,
>
> > Thanks for the reply.
>
> > Just to let you know, I am reading my vector data from PostgreSQL. So,
> can I
> use WMS GetCapabities request in that case.
>
> > It would be really helpful if you can paste any sample code for that if
> you
> have any.
>
> > Thanks and regards,
> > Kiran.
> --
> View this message in context:
> http://osgeo-org.1803224.n2.nabble.com/How-to-get-full-extent-of-the-map-tp5248342p5250366.html
> Sent from the Mapserver - User mailing list archive at Nabble.com.
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
> _______________________________________________
> mapserver-users mailing list
> mapserver-users at lists.osgeo.org
> http://lists.osgeo.org/mailman/listinfo/mapserver-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/mapserver-users/attachments/20100705/bb06e8ca/attachment.htm>
More information about the MapServer-users
mailing list