ST_Raster

Definition

ST_Raster creates an ST_Raster type object.

Syntax

Oracle

sde.st_raster (filename IN VARCHAR2)

sde.st_raster (filename IN VARCHAR2, 
               options IN VARCHAR2)

sde.st_raster (data IN ST_PIXELDATA)

sde.st_raster (data IN ST_PIXELDATA, 
               options IN VARCHAR2)

PostgreSQL

st_raster (filename IN TEXT)

st_raster (filename IN TEXT, 
           options IN TEXT)

st_raster (data IN ST_PIXELDATA)

st_raster (data IN ST_PIXELDATA, 
           options IN TEXT)

SQL Server

st_raster (filename IN NVARCHAR, 
           data IN ST_PIXELDATA, 
           options IN NVARCHAR)

Parameters

Parameter

Description

filename

The name of the source raster data

data

A predefined ST_PixelData object

options

A comma-delimited list enclosed in single quotes that may include the following:

  • align—Automatically shifts the source pixels by a maximum of one-half a pixel cell width or height to agree with the ST_Raster's pixel cell alignment; the default is to not shift the data and return an error if it is not aligned.
  • compression <lz77 | jpeg | jp2>—The compression algorithm to be applied to the ST_Raster object; the default is to not compress the data.
  • interleave <separate | contiguous>—This option applies to ST_Raster objects that will store three-band 8-bit pixel data. Specifying a separate interleave indicates that the pixel data will be stored in separate RGB bands, while specifying a contiguous interleave indicates that the pixel data will be stored in a single band of a contiguous series of red, green, and blue pixels.
  • recursive—Directs the constructor to search the folder specified in the filename argument and any subfolders for image files that have names that match the search criteria.
  • conversion <rgb | grayscale>—When set to rgb, the conversion parameter directs the constructor to convert single-band color-mapped source images to a three-band RGB ST_Raster object. A conversion parameter set to grayscale indicates that the constructor should convert 1-bit black and white source images to insert into an 8-bit grayscale ST_Raster object.
  • quality <value>—The compression quality of the ST_Raster option for JPEG or JPEG 2000 variable compression
  • bitrate <value>—The bit rate for JPEG 2000 compression
  • nodata <(r,g,b) | value>—The pixel values of the source image that will be converted to nodata as they are inserted into the ST_Raster
  • nocolormap—Indicates that the color map will be removed from a color-mapped source image when it is inserted into the ST_Raster
  • edge <value>:<tolerance>—Removes the unwanted boundary pixels around an ST_Raster that are marked as NoData; edge indicates that only the pixels in the specified value range will be removed and only from the outside edge of the raster. This prevents pixels of the same value within the raster from being removed.
  • level=<pyramid level>—The maximum pyramid level that will be created after the source image is inserted into the ST_Raster
  • origin (x,y)—The pyramid reference origin of the ST_Raster
  • skipLevel1—Indicates that the first level of the ST_Raster's pyramid is not created
  • tile (width,height)—The width and height of the tile storage for the ST_Raster
  • nearest | bilinear | bicubic—The interpolation algorithm that will be used to create the ST_Raster object's pyramid
  • log <logfile name>—The log file to which the constructor will write the results.

Examples

Oracle

This example inserts a GeoTIFF image file into an ST_Raster object by explicitly calling the ST_Raster constructor.

INSERT INTO NOVA (image)
 VALUES (sde.st_raster('nova.tif','compression=lz77'));

This example copies ST_Raster object values from the source table called world into a target table called nova. In this case, the ST_Raster constructor is implicitly called by the INSERT statement to create the ST_Raster objects in the target table.

INSERT INTO NOVA (image)
SELECT image 
FROM WORLD;

In this example, an ST_PixelData object is populated with the pixels of an ST_Raster object and inserted into another ST_Raster object.

DECLARE
  	  data ST_PixelData;
BEGIN
  	  SELECT image.getPixelData('level=1') INTO DATA FROM NOVA;
  	  INSERT INTO NOVA VALUES (sde.st_raster(data, 'compression=lz77'));
     END; 
     /

PostgreSQL

This example inserts a GeoTIFF image file into an ST_Raster object by explicitly calling the ST_Raster constructor.

INSERT INTO nova (image)
VALUES (sde.st_raster('nova.tif','compression=lz77'));

This example copies ST_Raster object values from the source table called world into a target table called nova. In this case, the ST_Raster constructor is implicitly called by the INSERT statement to create the ST_Raster objects in the target table.

INSERT INTO nova (image)
SELECT image 
FROM world;

In this example, an ST_PixelData object is populated with the pixels of an ST_Raster object and inserted into another ST_Raster object.

DECLARE data st_pixeldata; 
BEGIN 
		SELECT getPixelData(image, 'level=1') 
  INTO data 
  FROM nova; 
  INSERT into nova 
  VALUES (sde.st_raster(data,''compression=lz77'')); 
END;

SQL Server

This example inserts a GeoTIFF image file into an ST_Raster object by explicitly calling the ST_Raster constructor.

 INSERT INTO nova (image)
 VALUES (ST_Raster::construct('nova.tif',NULL,'compression=lz77'));

This example copies ST_Raster object values from the source table called world into a target table called nova. In this case, the ST_Raster constructor is implicitly called by the INSERT statement to create the ST_Raster objects in the target table.

INSERT INTO nova (image)
SELECT image 
FROM world;

In this example, an ST_PixelData object is populated with the pixels of an ST_Raster object and inserted into another ST_Raster object.

DECLARE
@data ST_Pixeldata;
SET @data =
(SELECT image.getPixelData('level=1')
 FROM nova);
 INSERT INTO nova
 
VALUES (ST_Raster::construct(NULL, @data, 'compression=lz77')) ;

3/7/2012