Cropping an ST_Raster value

Use the crop function to remove all the raster data beyond a specified extent from a raster stored in an ST_Raster column.

The crop function is useful for removing unwanted pixel data from a raster value. For example, if the mosaic function was used on the wrong raster data source and now the raster value has an extent that is much larger than desired, the crop function can be used to reduce the extent.

Steps:
  1. Crop all the raster values in the urban_area table to a pixel extent of (0,0,100,100).

    Oracle

    UPDATE URBAN_AREA t
    SET RASTER = t.raster.crop ('0,0,100,100', 'pixel');

    PostgreSQL

    UPDATE urban_area
    SET raster = crop (raster, '0,0,100,100', 'pixel');

    SQL Server

    UPDATE urban_area
    SET raster = raster.crop ('0,0,100,100','pixel');

Related Topics


2/5/2013