[postgis-tickets] [PostGIS] #2803: [raster] ST_MapAlgebra checks callbacks parameters but not strictness
PostGIS
trac at osgeo.org
Thu Jul 3 04:01:43 PDT 2014
#2803: [raster] ST_MapAlgebra checks callbacks parameters but not strictness
--------------------+-------------------------------------------------------
Reporter: strk | Owner: dustymugs
Type: defect | Status: new
Priority: medium | Milestone:
Component: raster | Version: trunk
Keywords: |
--------------------+-------------------------------------------------------
I've spent all morning wondering why ST_MapAlgebra was not calling my
callback function, to finally find the culprit was the function being
defined as being "strict":
https://github.com/postgis/postgis/blob/svn-
trunk/raster/rt_pg/rtpg_mapalgebra.c#L476-L478
I guess the null being passed is the userarg, which I'm not requesting.
That argument, in the callback, is marked as being "variadic".
I don't know if it would be safe to call a strict function with a null
value as a variadic argument (I'd guess so) but the point of this ticket
is that silently skipping the callback invocation is not a nice thing to
do, as the user is left wondering why the callback is not being invoked.
What we could do is raise an EXCEPTION if any NULL is to be passed to a
STRICT function. For a start, that'd give the user an hint.
If there are any other possible NULL values that could get passed, and
would depend on the input raster/band/values rather than on the call to
ST_MapAlgebra then the message could become a WARNING instead, but, does
such case exist ?
--
Ticket URL: <http://trac.osgeo.org/postgis/ticket/2803>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.
More information about the postgis-tickets
mailing list