[postgis-users] Simple ST_Value(rast, point)

Andreas Forø Tollefsen andreasft at gmail.com
Mon Sep 19 08:51:15 PDT 2011


Hi all,

I just wanted to get some feedback on my query. Basically, it is
simply to create a new table with the raster values of my 6 population
rasters overlapping my regularly separated point dataset.

Is this an optimal way of doing this? Reason I ask is that it does
take a lot of time.

DROP TABLE IF EXISTS popgrid;
	
SELECT gid,
ST_Value(p90.rast, SetSRID(p.centroid,4326)) as pop90,
ST_Value(p95.rast, SetSRID(p.centroid,4326)) as pop95,
ST_Value(p00.rast, SetSRID(p.centroid,4326)) as pop00,
ST_Value(p05.rast, SetSRID(p.centroid,4326)) as pop05,
ST_Value(p10.rast, SetSRID(p.centroid,4326)) as pop10,
ST_Value(p15.rast, SetSRID(p.centroid,4326)) as pop15
INTO popgrid
FROM pop90 p90, pop95 p95, pop00 p00, pop05 p05, pop10 p10, pop15 p15,
priogrid p
;

Best,
Andreas



More information about the postgis-users mailing list