[postgis-users] Help with SQL query?

Rasmus Aveskogh rasmus at defero.se
Mon Nov 23 07:33:22 PST 2015


Regarding filename matching etc. I would just wrap everything in a scripting language of your choice (bash, python, ruby etc.) considering all the GMT programs, including grdmath, are command line tools.

-ra

On 23 Nov 2015, at 16:27, Rasmus Aveskogh <rasmus at defero.se> wrote:

> 
> Though this is probably possible in PostGIS nowadays I would personally solve such a use case with GMT (http://gmt.soest.hawaii.edu/), for example with grdmath (http://gmt.soest.hawaii.edu/doc/5.2.1/grdmath.html) which lets you perform rather complex computations on multiple grids (for examples rasters) using reverse polish notation.
> 
> -ra
> 
> On 23 Nov 2015, at 13:20, Darrel Maddy <darrel.maddy at newcastle.ac.uk> wrote:
> 
>> 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
>> _______________________________________________
>> postgis-users mailing list
>> postgis-users at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/postgis-users
> 

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


More information about the postgis-users mailing list