ST_PixelData

Definition

The ST_PixelData constructor creates an ST_PixelData object.

Syntax

Oracle

sde.st_pixeldata()

sde.st_pixeldata(width INTEGER, 
                 height INTEGER, 
                 numBands INTEGER, 
                 parameter_list VARCHAR2)

PostgreSQL

sde.st_pixeldata()

st_pixeldata(width IN INT, 
             height IN INT, 
             numBands IN INT, 
             parameter_list IN TEXT)

SQL Server

<sde or dbo>.ST_Pixeldata::construct(width IN INTEGER, 
                                     height IN INTEGER, 
                                     numBands IN INTEGER, 
                                     parameter_list IN NVARCHAR)

Returns

Oracle

Number

PostgreSQL

Integer

SQL Server

Integer

Parameters

Parameter

Description

width

The pixel width of the pixel data buffer

height

The pixel height of the pixel data buffer

numBands

The number of bands to be created

parameter_list

A comma-delimited list of parameters enclosed in single quotes that can include the following:

pixelType=[{1bit | 4bit | uint8 | int8 | uint16 | int16 | uint32 | int32 | float | double},

interleave={separate | contiguous}]

Examples

The following create a table and insert an ST_PixelData object into the table.

Oracle

CREATE TABLE foo (image sde.st_raster);
BEGIN
sde.ST_RasterUtil.initialize ('foo','image',4326,'DEFAULTS');
	END;
	/
DECLARE
  p sde.ST_PixelData := sde.ST_PixelData(256, 256, 1, 'pixelType=uint8');
BEGIN
  INSERT INTO FOO VALUES (p);
END;
/

PostgreSQL

CREATE TABLE foo (image st_raster);
SELECT st_raster_util_initialize ('foo','image',4326,'DEFAULTS');

DROP FUNCTION IF EXISTS insert_pixeldata();

CREATE OR REPLACE FUNCTION insert_pixeldata() 
RETURNS integer AS '
DECLARE p st_pixeldata; 
BEGIN  
INSERT INTO foo VALUES (ST_RASTER(p));
      END;' 
      LANGUAGE plpgsql; 

      SELECT insert_pixeldata();

DROP FUNCTION IF EXISTS insert_pixeldata();

SQL Server

CREATE TABLE foo (image st_raster);
EXECUTE ST_RASTER_UTIL.initialize
'myb','ted','foo','image',4326,NULL,'DEFAULTS'
DECLARE @p ST_Pixeldata;
SET @p = ST_Pixeldata::construct(256, 256, 1,'pixelType=uint8');
 INSERT INTO foo VALUES
(ST_Raster::construct(NULL,@p,NULL));

11/18/2013