Ticket #35 (closed enhancement: fixed)
Comments on Postgis Functions
|Reported by:||dane.springmeyer||Owned by:||robe|
This is a small feature request / question.
I'm curious if there has been any thought about adding comments to postgis functions?
I've written several sql functions to take advantage of function comments (when they exist) which are included in this thread: http://postgis.refractions.net/pipermail/postgis-devel/2008-April/002989.html
I've also started writing a python script which parses out all the documentation notes in chapter six of the official documentation using this file: http://svn.refractions.net/postgis/trunk/doc/postgis.xml.
The idea is to insert them as database comments. Whenever the official documentation is updated this script could be re-run to regenerate the .sql to attach comments.
If this is of interest to the developers I would be happy to work on getting the function inserts working (I assume that proper matching could be tricky).
A user would then be able to do add them like: $ psql -f postgis_func_comments.sql -d your_spatial_database
And in the psql interpreter a user would not only be able to say...
wind=# wind=# \df *ewkt*
List of functions
Schema | Name | Result data type | Argument data types
public | asewkt | text | geometry public | geomfromewkt | geometry | text public | st_asewkt | text | geometry public | st_geomfromewkt | geometry | text
But also say, for example, 'select postgis_help('ewkt');' be able to say...
wind=# select * from postgis_help('ewkt');
usage | comments
asewkt(geometry) | Deprecated Function (use ST_AsEWKT instead): Returns a Geometry in EWKT format (as text). geomfromewkt(text) | Deprecated Function(use ST_GeomFromEWKT instead): Makes a Geometry from EWKT. st_asewkt(geometry) | Returns a Geometry in EWKT format (as text). st_geomfromewkt(text) | Makes a Geometry from EWKT.
wind=# \dd *ewkt*
Schema | Name | Object | Description
public | asewkt | function | Deprecated Function (use ST_AsEWKT instead): Returns a Geometry in EWKT format (as text). public | geomfromewkt | function | Deprecated Function(use ST_GeomFromEWKT instead): Makes a Geometry from EWKT. public | st_asewkt | function | Returns a Geometry in EWKT format (as text). public | st_geomfromewkt | function | Makes a Geometry from EWKT.