[postgis-devel] Function suggestion
Martin Schäfer
Martin.Schaefer at cadcorp.com
Thu Jun 10 07:52:24 PDT 2004
Hi,
I'd like to suggest two functions to be added to postgis, which I would find really useful. Hopefully others would too.
extent_estimated(<schema>, <relation>, <column>)
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.
Alternatively, the geometry_columns schema could be modified by adding an 'extent' column which gets updated whenever update_geometry_stats() is executed.
is_spatially_indexed(<schema>, <relation>, <column>)
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.
Does this make sense?
Martin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20040610/262aaab1/attachment.html>
More information about the postgis-devel
mailing list