<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD><TITLE>Message</TITLE>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1400" name=GENERATOR></HEAD>
<BODY>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" size=2>I'd like to 
suggest two functions to be added to postgis, which I would find really useful. 
Hopefully others would too.</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>extent_estimated(<schema>, <relation>, 
<column>)</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" size=2>returns the 
extent of the specified spatial column as calculated when 
update_geometry_stats() was executed the last time (histogram2d contains the 
information). Obviously the result will not always be up-to-date, but often it 
will, and even if it isn't then it is quite likely within the ballpark. This 
function would allow a viewer application to zoom in quickly to where the data 
lies. Calculating the exact extent takes way too long if the table has, say, a 
couple of 100,000 rows. An outdated value of the extent is good enough 
in this case, as long as it can be found within O(1) 
time.</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>Alternatively, the geometry_columns schema could be modified by adding an 
'extent' column which gets updated whenever update_geometry_stats() is 
executed.</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>is_spatially_indexed(<schema>, <relation>, 
<column>)</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" size=2>returns true 
or false depending on whether a spatial index exists on this column in the table 
or view. Again a viewer application would benefit from knowing in advance that a 
spatial query on this column will take a very long time, in which case it would 
be better to refuse to display the geometries altogether, rather than present 
the user with an unresponsive or seemingly 'hanging' user interface for zooming 
and panning.</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>Does this make sense?</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2>Martin</FONT></SPAN></DIV>
<DIV><SPAN class=867570814-10062004><FONT face="Courier New" 
size=2></FONT></SPAN> </DIV></BODY></HTML>