[postgis-users] ST_Quantile

Stephen Woodbridge woodbri at swoodbridge.com
Fri Jan 27 11:31:12 PST 2012


Joan,

Looking at the function the Bborie posted:

st_quantile(rastertable text, rastercolumn text, nband int DEFAULT
    1, exclude_nodata_value boolean DEFAULT TRUE, quantiles double
    precision[] DEFAULT NULL)

The 3rd parameter is the band number. What is the 0.75 supposed to 
represent? My guess is that is getting truncated to 0 and it is trying 
to process band=0 which might not be valid.

But it should not crash, so please write two bugs against this:
1. for the missing doc
2. for the crash if you enter 0.75

Thanks,
   -Steve

On 1/27/2012 2:19 PM, Joan wrote:
> Hi Steve,
>
> I have gotten the same problem (db server stopped running).
>
> Joan
>
> On 27 January 2012 20:05, Stephen Woodbridge <woodbri at swoodbridge.com
> <mailto:woodbri at swoodbridge.com>> wrote:
>
>     Joan,
>
>     I've never used these function, but try doing:
>
>     select st_quantile('kbd_ext', 'rast', 0.75);
>
>     Since you probably do not want this called once for every row in the
>     table.
>
>     -Steve
>
>
>     On 1/27/2012 2:03 PM, Joan wrote:
>
>         Hi Bborie,
>
>         This is my query and it crashes the db server.
>         select st_quantile('kbd_ext', 'rast', 0.75) from kbd_ext limit 10;
>
>         Joan
>
>         On 27 January 2012 19:14, Bborie Park <bkpark at ucdavis.edu
>         <mailto:bkpark at ucdavis.edu>
>         <mailto:bkpark at ucdavis.edu <mailto:bkpark at ucdavis.edu>>> wrote:
>
>             Hey Joan,
>
>             Assuming your whole coverage is in a table, you should use the
>             table/column version of ST_Quantile (which by the looks of it is
>             undocumented for some reason).
>
>             The function definition of ST_Quantile(rastertable,
>         rastercolumn) is...
>
>             st_quantile(rastertable text, rastercolumn text, nband int
>         DEFAULT
>             1, exclude_nodata_value boolean DEFAULT TRUE, quantiles double
>             precision[] DEFAULT NULL)
>
>             At the moment an aggregate version of ST_Quantile (and the other
>             basic stats functions) does not exist.  It is expected that
>         one will
>             be written for PostGIS 2.1 assuming dev-time is available.
>
>             -bborie
>
>
>             On 01/27/2012 09:06 AM, Joan wrote:
>
>                 Hi,
>
>                 I would like to find the quantile values of a whole raster
>                 coverage, but
>                 ST_Quantile returns quantile values of each tile. Which
>         would be
>                 the best
>                 method to approximate the quantile value of the whole
>         coverage?
>
>                 Regards,
>
>                 Joan
>
>
>
>
>                 ______________________________ _________________
>                 postgis-users mailing list
>                 postgis-users at postgis. refractions.net
>         <http://refractions.net>
>         <mailto:postgis-users at postgis. refractions.net
>         <mailto:postgis-users at postgis.refractions.net>>
>         http://postgis.refractions. net/mailman/listinfo/postgis- users
>
>         <http://postgis.refractions. net/mailman/listinfo/postgis- users
>         <http://postgis.refractions.net/mailman/listinfo/postgis-users>>
>
>
>             --
>             Bborie Park
>             Programmer
>             Center for Vectorborne Diseases
>             UC Davis
>             530-752-8380
>         bkpark at ucdavis.edu <mailto:bkpark at ucdavis.edu>
>         <mailto:bkpark at ucdavis.edu <mailto:bkpark at ucdavis.edu>>
>
>             ______________________________ _________________
>             postgis-users mailing list
>             postgis-users at postgis. refractions.net <http://refractions.net>
>         <mailto:postgis-users at postgis. refractions.net
>         <mailto:postgis-users at postgis.refractions.net>>
>         http://postgis.refractions. net/mailman/listinfo/postgis- users
>         <http://postgis.refractions. net/mailman/listinfo/postgis- users
>         <http://postgis.refractions.net/mailman/listinfo/postgis-users>>
>
>
>
>
>
>         ______________________________ _________________
>         postgis-users mailing list
>         postgis-users at postgis. refractions.net
>         <mailto:postgis-users at postgis.refractions.net>
>         http://postgis.refractions. net/mailman/listinfo/postgis- users
>         <http://postgis.refractions.net/mailman/listinfo/postgis-users>
>
>
>     ______________________________ _________________
>     postgis-users mailing list
>     postgis-users at postgis. refractions.net
>     <mailto:postgis-users at postgis.refractions.net>
>     http://postgis.refractions. net/mailman/listinfo/postgis- users
>     <http://postgis.refractions.net/mailman/listinfo/postgis-users>
>
>
>
>
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users




More information about the postgis-users mailing list