[postgis-users] Help with SQL query?

Darrel Maddy darrel.maddy at newcastle.ac.uk
Mon Nov 23 04:20:15 PST 2015


Dear all,

As you know I am relatively new to postgis and SQL and therefore  I have much to learn. However, I am facing a paper deadline and need to do some quick analysis of the data I have and I am struggling to figure out how best to pursue what I need to do.

I have a significant number of rasters which have double precision values.  Without going into detail about what the rasters represent, I need to extract and sum values from one set of rasters in say table A based upon  values in another set of rasters in say table B  where the pixel value in the raster from Table B exceeds a threshold. Both tables are the same size (rasters are tiled) but I also need to figure out how I make sure the correct rasters are compared.  They have filenames like this rastervariable_10.tif, rastervariable_100.tif , presumably I need to use a logical expression to strip the numerical value (in this case this represents the year) and then order on that basis?

I can do this in QGIS one at a time but that is a little clumsy and rather time consuming.

If someone can just point me in the right direction I am sure I can figure out the rest for myself.

Apologies once more for asking what is probably a rather trivial question and yet again demonstrating my ignorance.

Many thanks

Darrel
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/postgis-users/attachments/20151123/8ef362eb/attachment.html>


More information about the postgis-users mailing list