#935 closed task (fixed)
[raster] ST_Quantile and ST_ApproxQuantile
Reported by: | dustymugs | Owned by: | dustymugs |
---|---|---|---|
Priority: | medium | Milestone: | PostGIS 2.0.0 |
Component: | raster | Version: | master |
Keywords: | history | Cc: |
Description
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.
http://en.wikipedia.org/wiki/Quantile
ST_Quantile variations:
- ST_Quantile(rast raster, nband int, hasnodata boolean, quantiles double precision[]) → set of records
nband: index of band to process on
hasnodata: if FALSE, any pixel who's value is nodata is ignored.
quantiles: array of percentages to compute values for
ST_Quantile(rast, 1, FALSE, ARRAY[0.1, 0.3, 0.7]) ST_Quantile(rast, 1, TRUE, ARRAY[0.2]) ST_Quantile(rast, 1, FALSE, ARRAY[0, 1])
- ST_Quantile(rast raster, nband int, quantiles double precision[]) → set of records
"hasnodata" is assumed to be FALSE
ST_Quantile(rast, 1, ARRAY[0.1, 0.3, 0.7])
- ST_Quantile(rast raster, nband int, hasnodata boolean) → set of records
"quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1]
- ST_Quantile(rast raster, nband int) → set of records
"hasnodata" is assumed to be FALSE and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1]
- ST_Quantile(rast raster, quantiles double precision[]) → set of records
"nband" is assumed to be 1 and "hasnodata" is FALSE
- ST_Quantile(rast raster, nband int, quantile double precision) → record
quantile: the single percentile to compute
- ST_Quantile(rast raster, quantile double precision) → record
"nband" is assumed to be 1
- ST_Quantile(rast raster) → set of records
"nband" is assumed to be 1 and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1]
ST_ApproxQuantile adds a "sample_percent" indicating the percentage of the raster to sample
- ST_ApproxQuantile(rast raster, nband int, hasnodata boolean, sample_percent double precision, quantiles double precision[]) → set of records
nband: index of band to process on
hasnodata: if FALSE, any pixel who's value is nodata is ignored
sample_percent: a value between 0 and 1 indicating the percentage of the raster band's pixels to consider when computing the quantiles
quantiles: array of percentages to compute values for
ST_ApproxQuantile(rast, 1, FALSE, 0.1, ARRAY[0.1, 0.3, 0.7]) ST_ApproxQuantile(rast, 1, TRUE, .2, ARRAY[0.2]) ST_ApproxQuantile(rast, 1, FALSE, 0.3, ARRAY[0, 1])
- ST_ApproxQuantile(rast raster, nband int, sample_percent double precision, quantiles double precision[]) → set of records
"hasnodata" is assumed to be FALSE
ST_ApproxQuantile(rast, 1, .05, ARRAY[0.1, 0.3, 0.7])
- ST_ApproxQuantile(rast raster, nband int, sample_percent double precision) → set of records
"hasnodata" is assumed to be FALSE and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1]
- ST_ApproxQuantile(rast raster, sample_percent double precision, quantiles double precision[]) → set of records
"nband" is assumed to be 1
- ST_ApproxQuantile(rast raster, nband int, sample_percent double precision, quantile double precision) → record
quantile: the single percentile to compute
- ST_ApproxQuantile(rast raster, sample_percent double precision, quantile double precision) → record
"nband" is assumed to be 2
- ST_ApproxQuantile(rast raster, sample_percent double precision) → set of records
"nband" is assumed to be 1 and "quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1]
- ST_ApproxQuantile(rast raster, nband int, quantile double precision) → record
"sample_percent" assumed to be 0.1
- ST_ApproxQuantile(rast raster, quantiles double precision[]) → set of records
"nband" is assumed to be 1 and "sample_percent" assumed to be 0.1
- ST_ApproxQuantile(rast raster, quantile double precision) → record
"nband" assumed to be 1 and "sample_percent" assumed to be 0.1
- ST_ApproxQuantile(rast raster, nband int) → set of records
"quantiles" assumed to be ARRAY[0, 0.25, 0.5, 0.75, 1] and "sample_percent" assumed to be 0.1
- ST_ApproxQuantile(rast raster) → set of records
"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
Attachments (1)
Change History (4)
by , 14 years ago
Attachment: | st_quantile.patch added |
---|
comment:1 by , 14 years ago
Owner: | changed from | to
---|---|
Status: | new → assigned |
Adds ST_Quantile function, which requires ST_SummaryStats. Merges cleanly against r7145.
The following patches must be merged first for this patch to merge cleanly:
- ST_Band
- ST_SummaryStats
- ST_Mean
- ST_StdDev
- ST_MinMax
- ST_Histogram
comment:2 by , 14 years ago
Keywords: | history added |
---|---|
Resolution: | → fixed |
Status: | assigned → closed |
Added in r7153
comment:3 by , 13 years ago
Milestone: | PostGIS Raster Future → PostGIS 2.0.0 |
---|
Add ST_Quantile function.