[postgis-users] Computation of quantiles in Polygon-Raster

Pierre Racine Pierre.Racine at sbf.ulaval.ca
Tue May 5 07:14:56 PDT 2015


I guess you have two options:

1) clip and union your tiles BEFORE computing the quantile

2) use the ST_Quantile variant taking table and column names. I don't know if these function aggregates the results though.

Pierre 

> -----Original Message-----
> From: postgis-users-bounces at lists.osgeo.org [mailto:postgis-users-
> bounces at lists.osgeo.org] On Behalf Of Nick Ves
> Sent: Monday, May 04, 2015 3:53 PM
> To: postgis-users at lists.osgeo.org
> Subject: [postgis-users] Computation of quantiles in Polygon-Raster
> 
> Hi list,
> 
> I am trying to calculate the quantiles of a (tiled) raster which is
> bound by a polygon but I am stumbled.  I can calculate a desired
> quantile over a rid using ST_Quantile like so:
> 
> SELECT b.rid, q.*
> FROM raster.polygon a, raster.sat1 b,
> LATERAL
> st_quantile(st_clip(b.rast,a.geom),ARRAY[0.25,0.75]) q ORDER BY quantile;
> 
> (sample result)
> 
> rid quantile value
> 11 0,25 90
> 78 0,25 90
> 40 0,25 78
> 79 0,25 74
> 21 0,25 104
> 80 0,25 74
> 41 0,25 57
> ....
> 13 0,75 152
> 14 0,75 98
> 15 0,75 93
> 16 0,75 98
> 17 0,75 93
> 18 0,75 0
> 19 0,75 172
> 20 0,75 177
> ...
> 
> but i don't know how to aggregate the results to create a
> representative result for the whole dataset.
> 
> Anyone has any hint for me on how to proceed ?
> 
> N
> _______________________________________________
> postgis-users mailing list
> postgis-users at lists.osgeo.org
> http://lists.osgeo.org/cgi-bin/mailman/listinfo/postgis-users


More information about the postgis-users mailing list