[postgis-users] Retrieving Data from PostGIS Raster using ST_Value

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Mon Oct 17 12:43:03 PDT 2011

> Thanks for the response.  A follow up question:  what if the yourLongitude,
> yourLatitude values provided in the query are not grid points in that they fall
> within a bounding pixel grid.  Only values for the intersection points are known
> so how does a non-intersecting point get assigned a value from the query?

Point outside the area covered by the grid are assigned NULL. There is not inter- or extra- polation done.

I forgot to mention that if you tile your input raster then you should add a WHERE clause:

SELECT ST_Value(rast, ST_Transform(ST_SetSRID(ST_Point(yourLongitude, yourLatitude), 4326),  ST_SRID(rast))
FROM yourTable
WHERE ST_Intersects(rast, ST_Transform(ST_SetSRID(ST_Point(yourLongitude, yourLatitude), 4326),  ST_SRID(rast)))

In this case all points outside the area covered by the raster will not be returned.


More information about the postgis-users mailing list