IMHO, index out of range is an error condition, an exception, and as such it should result with error.<br><br>-- <br>Mateusz Łoskot, http::/mateusz.loskot.net<br>(Sent from my mobile)<br><br>----- Reply message -----<br>From: "Pierre Racine" <Pierre.Racine@sbf.ulaval.ca><br>Date: Thu, Mar 24, 2011 23:13<br>Subject: [postgis-devel] What to return when refering to an invalid band     number<br>To: "Mateusz Loskot" <mateusz@loskot.net>, "PostGIS Development Discussion" <postgis-devel@postgis.refractions.net><br><br>The question is more “returning an error or a warning (with null values)…” I will deal with the message text…<br><br>From: Mateusz Loskot [mailto:mateusz@loskot.net]<br>Sent: 24 mars 2011 19:11<br>To: Pierre Racine; PostGIS Development Discussion<br>Subject: Re: [postgis-devel] What to return when refering to an invalid band number<br><br>Pierre,<br>What about returning "band index is out of range" for any<br>invalid band index?<br><br>Regards,<br>--<br>Mateusz Łoskot, http::/mateusz.loskot.net<br>(Sent from my mobile)<br><br>----- Reply message -----<br>From: "Pierre Racine" <Pierre.Racine@sbf.ulaval.ca><br>Date: Thu, Mar 24, 2011 22:37<br>Subject: [postgis-devel] What to return when refering to an invalid band number<br>To: "PostGIS Development Discussion" <postgis-devel@postgis.refractions.net><br><br>Right now if I do this query on a raster having only one band:<br><br> SELECT ST_Value(rast, 0, 1, 1) FROM myraster<br><br>I get "ERROR:  RASTER_getPixelValue: Invalid band index (must use 1-based)"<br><br>If I do:<br><br> SELECT ST_Value(rast, 2, 1, 1) FROM myraster<br><br>I get "NOTICE:  Could not find raster band of index 2 when getting pixel value. Returning NULL"<br><br>and a NULL value.<br><br>The answer should be the same if I ask for band 0 or band 2 but which one? An error or a warning with a NULL (or a set of NULL for a tiled coverage)?<br><br>This symptom is generalised to every other function getting band properties (st_bandnodatavalue, st_bandpixeltype, etc...).<br><br>Pierre<br><br>_______________________________________________<br>postgis-devel mailing list<br>postgis-devel@postgis.refractions.net<br><a href="http://postgis.refractions.net/mailman/listinfo/postgis-devel">http://postgis.refractions.net/mailman/listinfo/postgis-devel</a><br><br><br><br>