[postgis-devel] about get/set wktraster sql funtion name convention

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue Mar 17 07:12:46 PDT 2009


Hi Jiong.

 

The original design opted for 2) but then we moved to 3) because "most
database functions are getters, not setters". There are a other examples
in PostGIS:

 

-GeometryType (not GetGeometryType)

-ST_NumGeometries (not ST_GetNumGeometries)

-ST_NumPoints (not ST_GetNumPoints)

-ST_X (not ST_GetX)

-etc..

 

Actually many functions could get the "Get" prefix but they don't. This
corresponds more to 3).

 

Pierre

 

From: postgis-devel-bounces at postgis.refractions.net
[mailto:postgis-devel-bounces at postgis.refractions.net] On Behalf Of
xie_jiong
Sent: 16 mars 2009 21:03
To: PostGIS Development Discussion
Subject: [******] [postgis-devel] about get/set wktraster sql funtion
name convention

 

Hi

 

In sql/mm, it seems only one sql funtion has get/set semantic, that is
st_srid.

get version: st_srid()

set version: st_srid(srid num)

same funtion name ,and different para, we could call it as overroad
mode.

 

now we are doing with  raster, there are many get/set semantic sql
funtions, we may have 3 choices: 

(1) overroad mode: rt_value(raster, integer, integer, integer, float8)
and rt_value(raster, integer, integer, integer)

(2) explicit set/get mode: rt_setvalue(raster, integer, integer,
integer, float8) and rt_getvalue(raster, integer, integer, integer)

(3) explicit set/implict get mode: rt_setvalue(raster, integer, integer,
integer, float8) and rt_value(raster, integer, integer, integer)

 

which form of name convention should we follow? 

My view is: 

(2) is clarity, but as for many long name functions, plus get/set seems
verbose

(1) seems close to standard, but sql/mm only has jut one model - st_srid
could follow,and semantic seems not very clear when funtion in sql
statement(is it?).

(3) is OK, but lack of symmetrical beauty.

 

Jiong

________________________________

_______________________________________________
postgis-commits mailing list
postgis-commits at postgis.refractions.net
http://lists.refractions.net/mailman/listinfo/postgis-commits

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-devel/attachments/20090317/3db33b28/attachment.html>


More information about the postgis-devel mailing list