Bbox in GetCapabilies for PostGIS layer

Daniel Morissette dmorissette at MAPGEARS.COM
Fri Oct 26 09:38:30 EDT 2007


Barend Köbben wrote:
>  
>> I'd suggest that you file a ticket about this.
> Can you point me to the place where I can do such a thing...?
> 

http://trac.osgeo.org/mapserver/

>> I am not sure how easy
>> that will be to fix, since we'll need a way to tell the capabilities
>> generation code that the extent returned by Postgis is not meaningful.
> My suggestion is that the error is in the way you ask the data/extent from
> PostGIS. PostGIS in it's own right is perfectly capable of providing a
> correct extent :  SELECT extent(the_geom) FROM test, if you need the
> LatlonBBOX: SELECT transform( extent(the_geom),4326) FROM test. How is
> MapServer requesting the bbox at the moment...?
> 

There is a GetExtents() method on all data providers in MapServer and 
the postgis driver seems to have a very poor implementation that just 
returns infinite extents to avoid having to do a full table scan which 
could be very expensive in some cases.

FYI this ticket discusses the issue and why "select extent() ..." was 
not used before:
   http://trac.osgeo.org/mapserver/ticket/1851

Daniel
-- 
Daniel Morissette
http://www.mapgears.com/



More information about the mapserver-users mailing list