[postgis-users] Point geom, ST_Value, ST_Intersects and out of range raster coordinates

Peter Devoy peter at 3xe.co.uk
Wed Jan 8 06:28:34 PST 2020

Hi list

I am trying to sample a value in a raster using ST_Value and a point geometry.
With the same point geometry I tried to use ST_Intersects to sample from only
the relevant row in the raster table but if the point is on the boundary of
multiple raster tiles a row is returned for each.

However, at the cell level, ST_Value seems to play by different rules and raises
"NOTICE: Attempting to get pixel value with out of range raster coordinates..."
for all but one of the rows.  Resulting in NULL values for all but one row.

Please does anyone know if there is there a method or function I can use to get
more "consistent" spatial logic without modifying the input point geometry?

E.g. either to filter out all rows where the sampled cell would be out of range;
or, to have ST_Value return a value for each row found by ST_Intersects.

My postgis_version() = "2.5 USE_GEOS=1 USE_PROJ=1 USE_STATS=1".

Kind regards


More information about the postgis-users mailing list