<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2900.2668" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hi All,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>I'm using MapServer 4.6.0 with Oracle Spatial and 
PostGIS data sources via PHP/MapScript.&nbsp; Part of my application code looks 
like this&nbsp; pseudo-code :</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;&nbsp;&nbsp; 
$map-&gt;setLayerFilter("ThematicData", "REQUEST_ID=121");<BR>&nbsp;&nbsp;&nbsp; 
$map-&gt;zoomToLayer("ThematicData");<BR></FONT></DIV>
<DIV><FONT face=Arial size=2>Here i'm setting a specific FILTER expression for a 
layer, and then zooming to the extent of the (now filtered) layer.&nbsp; I use 
the layerObj-&gt;getExtent() and then mapObj-&gt;setExtent() functions to 
achieve this behind the scenes. &nbsp;This works great for Oracle, the query is 
fast and makes for nice, tidy code in my application without the need for Oracle 
specific SQL statements to derive the new extent.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>However when&nbsp;I try this on PostGIS I just get 
a massive (useless) extent returned.&nbsp; Digging into the code I can see that 
the msPOSTGISLayerGetExtent() function in mappostgis.c is effectively doing 
nothing although a lot of code is commented out.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Working on my local code I have re-enabled this 
code, fixed the compilation errors and changed it so that when a FILTER is 
applied to the layer this is used as part of the SQL call to PG.&nbsp; It seems 
to work great (from PHP/MapScript) and performance is fine and is really useful 
for me meaning I don't need to calculate the extents for a map myself - 
MapServer can supply the information in a generic and abstract 
fashion.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Ideally I would like to get this code fed back into 
MapServer, but of course only if it's acceptable to you all.&nbsp; </FONT><FONT 
face=Arial size=2>So,&nbsp; should I instead post this to mapserver-dev or can I 
pass on the new code to someone from here?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>There may be good, historical, reasons why this 
wasn't ever implemented though so please let me know!</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Many thanks,</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Steve Hall</FONT></DIV>
<DIV><FONT face=Arial size=2>&nbsp;</DIV></FONT></BODY></HTML>