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

Regina Obe lr at pcorp.us
Wed Jan 8 07:47:26 PST 2020

ST_Value has a exclude_no_data value which I think defaults to true.  You could try changing it to false to see if the error goes away.  You'll probably get garbage back if anything.


I thought ST_Intersects had the same feature, but I guess I'm mistaken or it was taken out a while ago as I don't see it documented and don't see a function signature for it either.


-----Original Message-----
From: postgis-users [mailto:postgis-users-bounces at lists.osgeo.org] On Behalf Of Peter Devoy
Sent: Wednesday, January 8, 2020 9:29 AM
To: PostGIS Users Discussion <postgis-users at lists.osgeo.org>
Subject: [postgis-users] Point geom, ST_Value, ST_Intersects and out of range raster coordinates

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

postgis-users mailing list
postgis-users at lists.osgeo.org

More information about the postgis-users mailing list