I have a table tmax_2016 that contains tiled raster data.
I believe the following query retrieves the raster value at a point on the given rast_date:
SELECT ST_Value(rast, ST_SetSRID(ST_MakePoint(-83.54005,31.59668),4269)) AS tmax FROM tmax_2016 WHERE rast_date='2016-09-28';
However since it's tiled, I always get 1 valid result and a bunch of nulls for the tiles that don't contain the asked for lat/long. How do I modify the query to not return the nulls?
The following pukes I believe because ST_Value is an agregate function?
SELECT ST_Value(rast, ST_SetSRID(ST_MakePoint(-83.54005,31.59668),4269)) AS tmax FROM tmax_2016 WHERE rast_date='2016-09-28' WHERE tmax IS NOT NULL;
I could get rid of the nulls using a nested select but is there a better way?