What is the ST_Raster storage type?

ST_Raster is a user-defined data type. It is stored in a single row, in a single column of object type ST_Raster in a user-defined table. ST_Raster provides full geodatabase support as well as SQL access to raster data. This enables you to write SQL applications using your database management system (DBMS) that can access and use raster operations and queries.

ST_Raster is supported in Oracle, Microsoft SQL Server, and PostgreSQL databases. It is not supported in SQL Server Express.

To use the ST_Raster type, you must configure it in the DBMS. See Installing the ST_Raster type in Oracle, Installing the ST_Raster type in PostgreSQL, or Installing the ST_Raster type in SQL Server for instructions.

The ST_Raster object type is defined as follows:

CREATE TYPE ST_Raster AS OBJECT (
  raster_id			    INTEGER,
  type				        INTEGER,
  extent			       SE_EXTENT,
  properties			   SE_RASTERPROPERTY_LIST,
  rasterband_list	ST_RASTERBAND_LIST
	 data					       ST_PIXELDATA);

Attribute

Descriptions

raster_id

Uniquely identifies each raster within a table column defined as ST_Raster

type

Currently reserved for internal use only

extent

An optional attribute that stores the search extent

properties

Used to store various attributes associated with the raster but not individual raster bands

rasterband_list

A collection of raster bands that store band specific attributes

data

Reserved field

The ST_Raster object is made up of several subobjects.

Object model diagram of the ST_Raster type

ST_RASTERBAND and ST_RASTERBAND_LIST

The ST_RASTERBAND_LIST type is defined as follows:

CREATE TYPE st_rasterband_list 
AS VARRAY(4096) OF ST_RASTERBAND; 

The ST_RASTERBAND type is defined as follows:

CREATE TYPE st_rasterband AS OBJECT (
  rasterband_id	INTEGER,
  sequence			   INTEGER,
  types			      INTEGER,
  width			      INTEGER,
  height			     INTEGER,
  extent			     SE_EXTENT,
  block_origin		SE_COORD,
  block_width		 INTEGER,
  block_height		INTEGER,
  flags			      INTEGER);

Attribute

Description

rasterband_id

Uniquely identifies each raster band within the ST_Raster type column

sequence

Maintains sequence of each band within the raster band collection; for a given raster band collection, the sequence value for each band within the collection must be unique.

types

A bitmask used to store various raster band metadata; individual attributes contained in the bitmask can be assessed and assigned through SQL functions. The value of this attribute should not be modified directly.

width

Defines the pixel width of the raster band

height

Defines the pixel height of the raster band

extent

The geographic extent of the raster band

block_origin

Maintains the geographic coordinate of the block origin

block_width

Defines the pixel width of the raster band tile

block_height

Defines the pixel height of the raster band tile

flags

Holds a bitmask of raster band metadata; individual attributes contained in the bitmask can be accessed and assigned by SQL functions. This value of this attribute should not be modified directly.

SE_RASTERPROPERTY and SE_RASTERPROPERTY_LIST

The SE_RASTERPROPERTY_LIST type is defined as:

CREATE TYPE se_rasterproperty_list
  AS VARRAY(1048576) OF SE_RASTERPROPERTY;

The SE_RASTERPROPERTY type is defined as follows:

CREATE TYPE se_rasterproperty AS OBJECT (
  name				 VARCHAR2(65),
  intvalue	INTEGER,
  strvalue	VARCHAR2(160));

Attribute

Description

name

The name of the raster property

intvalue

Stores the integer value of the raster property

strvalue

Stores the string value of the raster property

SE_EXTENT

The SE_EXTENT type is defined as follows:

CREATE TYPE se_extent AS OBJECT (
  minx				FLOAT(64),
  miny				FLOAT(64),
  maxx				FLOAT(64),
  maxy				FLOAT(64));

Attribute

Description

minx

The minimum X-coordinate value

miny

The minimum Y-coordinate value

maxx

The maximum X-coordinate value

maxy

The maximum Y-coordinate value

SE_COORD

The SE_COORD type is defined as follows:

CREATE TYPE se_coord AS OBJECT (
  x				FLOAT(64),
  y				FLOAT(64));

Attribute

Description

x

The X-coordinate value

y

The Y-coordinate value

ST_PIXELDATA

The ST_PIXELDATA type is defined as:

CREATE TYPE st_pixeldata AS OBJECT (
width    INTEGER,
height   INTEGER,
numbands INTEGER,
extent   SE_EXTENT,
types    INTEGER,
data     BLOB,
mask     BLOB);

Attribute

Description

width

The pixel width of the object

height

The pixel height of the object

numbands

Defines the number of bands of the object

extent

The geographic extent of object

types

A bitmask used to store various raster metadata; individual attributes contained in the bitmask can be assessed and assigned through SQL functions. The value of this attribute should not be modified directly.

data

The array of pixel values of the object

mask

The NoData bitmask array of the object

Related Topics


8/19/2013