Calculating statistics on a raster value in an ST_Raster column

Raster statistics include the mean, standard deviation, minimum value, and maximum value. Raster statistics are used by applications. Among other things, raster statistics are used to stretch the data to enhance its display.

Steps:
  1. Use the buildStats function to calculate statistics on the raster value stored in an ST_Raster column.
    In these examples, statistics are calculated on the raster column value that is in a row with a name column value equal to ALL_CITIES.

    Oracle

    UPDATE URBAN_AREA t
    SET raster = t.raster.buildStats()
    WHERE NAME = 'ALL_CITIES';
    

    PostgreSQL

    UPDATE urban_area
    SET raster = buildStats(raster)
    WHERE name = 'all_cities';
    

    SQL Server

    UPDATE urban_area
    SET raster = raster.buildStats(NULL)
    WHERE name = 'all_cities';
    

Related Topics

6/19/2015