| 1883 | '''ST_Quantile(raster, nband) -> set of records'''[[BR]] |
| 1884 | In addition to determining the histogram of a raster, providing the ability to compute quantiles permits a user to reference a value in the context of the sample or population. Thus, a value could be examined to be at the raster's 25%, 50%, 75% percentile. |
| 1885 | |
| 1886 | http://en.wikipedia.org/wiki/Quantile |
| 1887 | |
| 1888 | ST_Quantile variations: |
| 1889 | |
| 1890 | 1. ST_Quantile(rast raster, nband int, hasnodata boolean, quantiles double precision[]) -> set of records |
| 1891 | |
| 1892 | each row returned is of (quantile double precision, value double precision) |
| 1893 | |
| 1894 | nband: index of band to process on |
| 1895 | |
| 1896 | hasnodata: if FALSE, any pixel who's value is nodata is ignored. |
| 1897 | |
| 1898 | quantiles: array of percentages to compute values for |
| 1899 | |
| 1900 | {{{ |
| 1901 | ST_Quantile(rast, 1, FALSE, ARRAY[0.1, 0.3, 0.7]) |
| 1902 | |
| 1903 | ST_Quantile(rast, 1, TRUE, ARRAY[0.2]) |
| 1904 | |
| 1905 | ST_Quantile(rast, 1, FALSE, ARRAY[0, 1]) |
| 1906 | }}} |
| 1907 | |
| 1908 | 2. ST_Quantile(rast raster, nband int, quantiles double precision[]) -> set of records |
| 1909 | |
| 1910 | "hasnodata" is assumed to be FALSE |
| 1911 | |
| 1912 | {{{ |
| 1913 | ST_Quantile(rast, 1, ARRAY[0.1, 0.3, 0.7]) |
| 1914 | }}} |
| 1915 | |
| 1916 | 3. ST_Quantile(rast raster, nband int, hasnodata boolean) -> set of records |
| 1917 | |
| 1918 | "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] |
| 1919 | |
| 1920 | 4. ST_Quantile(rast raster, nband int) -> set of records |
| 1921 | |
| 1922 | "hasnodata" is assumed to be FALSE and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] |
| 1923 | |
| 1924 | 5. ST_Quantile(rast raster, quantiles double precision[]) -> set of records |
| 1925 | |
| 1926 | "nband" is assumed to be 1 and "hasnodata" is FALSE |
| 1927 | |
| 1928 | 6. ST_Quantile(rast raster) -> set of records |
| 1929 | |
| 1930 | "nband" is assumed to be 1 and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] |
| 1931 | |
| 1932 | 7. ST_Quantile(rast raster, nband int, hasnodata boolean, quantile double precision) -> record |
| 1933 | |
| 1934 | quantile: the single percentile to compute |
| 1935 | |
| 1936 | 8. ST_Quantile(rast raster, nband int, quantile double precision) -> record |
| 1937 | |
| 1938 | "hasnodata" is assumed to be FALSE |
| 1939 | |
| 1940 | 9. ST_Quantile(rast raster, hasnodata boolean, quantile double precision) -> record |
| 1941 | |
| 1942 | "nband" is assumed to be 1 |
| 1943 | |
| 1944 | 10. ST_Quantile(rast raster, quantile double precision) -> record |
| 1945 | |
| 1946 | "nband" is assumed to be 1 and "hasnodata" is assumed to be FALSE |
| 1947 | |
| 1948 | ST_ApproxQuantile adds a "sample_percent" indicating the percentage of the raster to sample |
| 1949 | |
| 1950 | 1. ST_ApproxQuantile(rast raster, nband int, hasnodata boolean, sample_percent double precision, quantiles double precision[]) -> set of records |
| 1951 | |
| 1952 | nband: index of band to process on |
| 1953 | |
| 1954 | hasnodata: if FALSE, any pixel who's value is nodata is ignored |
| 1955 | |
| 1956 | sample_percent: a value between 0 and 1 indicating the percentage of the raster band's pixels to consider when computing the quantiles |
| 1957 | |
| 1958 | quantiles: array of percentages to compute values for |
| 1959 | |
| 1960 | {{{ |
| 1961 | ST_ApproxQuantile(rast, 1, FALSE, 0.1, ARRAY[0.1, 0.3, 0.7]) |
| 1962 | |
| 1963 | ST_ApproxQuantile(rast, 1, TRUE, .2, ARRAY[0.2]) |
| 1964 | |
| 1965 | ST_ApproxQuantile(rast, 1, FALSE, 0.3, ARRAY[0, 1]) |
| 1966 | }}} |
| 1967 | |
| 1968 | 2. ST_ApproxQuantile(rast raster, nband int, sample_percent double precision, quantiles double precision[]) -> set of records |
| 1969 | |
| 1970 | "hasnodata" is assumed to be FALSE |
| 1971 | |
| 1972 | {{{ |
| 1973 | ST_ApproxQuantile(rast, 1, .05, ARRAY[0.1, 0.3, 0.7]) |
| 1974 | }}} |
| 1975 | |
| 1976 | 3. ST_ApproxQuantile(rast raster, nband int, sample_percent double precision) -> set of records |
| 1977 | |
| 1978 | "hasnodata" is assumed to be FALSE and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] |
| 1979 | |
| 1980 | 4. ST_ApproxQuantile(rast raster, sample_percent double precision, quantiles double precision[]) -> set of records |
| 1981 | |
| 1982 | "nband" is assumed to be 1 |
| 1983 | |
| 1984 | 5. ST_ApproxQuantile(rast raster, nband int, sample_percent double precision, quantile double precision) -> record |
| 1985 | |
| 1986 | quantile: the single percentile to compute |
| 1987 | |
| 1988 | 6. ST_ApproxQuantile(rast raster, sample_percent double precision, quantile double precision) -> record |
| 1989 | |
| 1990 | "nband" is assumed to be 2 |
| 1991 | |
| 1992 | 7. ST_ApproxQuantile(rast raster, sample_percent double precision) -> set of records |
| 1993 | |
| 1994 | "nband" is assumed to be 1 and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] |
| 1995 | |
| 1996 | 8. ST_ApproxQuantile(rast raster, nband int, quantile double precision) -> record |
| 1997 | |
| 1998 | "sample_percent" assumed to be 0.1 |
| 1999 | |
| 2000 | 9. ST_ApproxQuantile(rast raster, quantiles double precision[]) -> set of records |
| 2001 | |
| 2002 | "nband" is assumed to be 1 and "sample_percent" assumed to be 0.1 |
| 2003 | |
| 2004 | 10. ST_ApproxQuantile(rast raster, quantile double precision) -> record |
| 2005 | |
| 2006 | "nband" assumed to be 1 and "sample_percent" assumed to be 0.1 |
| 2007 | |
| 2008 | 11. ST_ApproxQuantile(rast raster, nband int) -> set of records |
| 2009 | |
| 2010 | "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] and "sample_percent" assumed to be 0.1 |
| 2011 | |
| 2012 | 12. ST_ApproxQuantile(rast raster) -> set of records |
| 2013 | |
| 2014 | "nband" is assumed to be 1, "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] and "sample_percent" assumed to be 0.1 |
| 2015 | |
| 2016 | ---- |