Hi all,<br><br>I've been experimenting with PostGIS raster lately and I'd like to comment on st_value() from my experience working with it lastly. Overall, I'd like to say It has been pretty useful to me.<br><br>
In <a href="http://trac.osgeo.org/postgis/ticket/606">Ticket 606</a> there a suggestion that either :<br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
<div style="text-align: left;"><i>1) Nodata values are REAL nodata values and there is NO value, period. In this case ST_Value should return NULL.
<br>2) We want to be able to do computation with nodata values. In this case ST_Value should return the nodata value.
<br>Up to now I have a strong preference for 2) and plan to change the 
behavior of ST_Value. Still thinking about the impacts though...</i></div></blockquote><div style="text-align: right;" class="searchable">

              </div><br>I'd like to vote for option 1. Always return NULL (and even store NULL in the table). No data is... having no data. If you are in a database this is represented by NULL value. It is not -9999 or any other value that are used to represent NULL outside the db, like in a raster file. If you want a value, you should compute it. If you need to know if you are in the range of the raster, I guess you should do it using box() or something like that.<br>
<br>Returning the "true value" of no data is bringing complexity and require more management from the user. Let's say I'm merging two files in a raster layer in PostGIS... they could have two different ways of representing no data: PostGIS raster should stick to NULL. It the more sensible way of doing it in my opinion.<br>
<br>Other thing is, there's a Warning raised if the value asked is outside the raster. <br><blockquote style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;" class="gmail_quote">
WARNING:  Attempting to get pixel value with out of range raster coordinates<br>CONTEXT:  PL/pgSQL function "st_value" line 12 at RETURN<br></blockquote><div>I'm really not sure this message is appropriate. I think it should only return NULL value, that's it. we are in a place where there is no value then return NULL. the thing is when you compute the value of a raster for 1 billion points (my experience), you get a few outside the raster. This is flooding my console with, finally, not really interesting information. I don't learn anything there that I couldn't learn from looking at the output.<br>
<br>I'm open to other arguments, I just felt like I could bring my experience as the thing is pretty young... and promising.<br><br>Etienne <br></div>