Exporting a TIFF file from an ST_Raster column
Use the ST_Raster export function to generate a TIFF image file of all or part of a raster value.
You can define the path name of the TIFF file to be created as well as the band, pyramid level, extent, and output compression type of the data that the TIFF file will include.
Steps:
-
Use the SELECT statement appropriate to your database to generate the all_cities.tif file from the ST_Raster value that is in the row with a name column value that equals all_cities. Specify lzw compression for the TIFF file compression to save space and enhance disk I/O performance.
Oracle
SELECT t.raster.export('c:\tiffs\all_cities.tif', 'compression=lzw') FROM URBAN_AREA t WHERE NAME = 'ALL_CITIES';
PostgreSQL
SELECT export(raster,'c:\tiffs\all_cities.tif', 'compression=lzw') FROM urban_area WHERE name = 'all_cities';
SQL Server
SELECT raster.export('c:\tiffs\all_cities.tif', 'compression=lzw') FROM urban_area WHERE name = 'all_cities';
Caution:Be sure the path you specify for the export is a valid path for the server where the database is installed.
Related Topics
6/19/2015