Database Reference
In-Depth Information
SELECT
(ST_Quantile(rast, 1)).*
FROM prism
WHERE rid = 550;
The output of the preceding code is as follows:
quantile | value
----------+-------0 | 9430.25 | 11560.5 |
12960.75 | 13601 | 1798
The75thpercentilevalueof 1360 alignsnicelywiththehistogramresultofabout78
percent of the values that are at or below 1370.50 .
Let's see what the top 10 occurring values are in the raster tile with
ST_ValueCount() .
SELECT
(ST_ValueCount(rast, 1)).*
FROM prism
WHERE rid = 550
ORDER BY count DESC, value
LIMIT 10;
The output of the code is as follows:
value | count
-------+-------1341 | 411334 | 401348
| 391352 | 381360 | 371331 | 361344
| 361324 | 351343 | 351314 | 34
How it works...
In the first part of this recipe, we looked at the metadata of the prism raster table
andasinglerastertile.Wefocusedonthatsinglerastertiletorunavarietyofstat-
istics. The statistics provided some ideaof what the data looks like.
Search WWH ::




Custom Search