ST_PixelData.setExtent

Definition

The ST_PixelData.setExtent function sets the extent of the ST_PixelData object.

Syntax

Oracle

setExtent (extent SE_EXTENT)

PostgreSQL

setExtent (data IN ST_PIXELDATA, 
           extent IN SE_EXTENT)

SQL Server

setExtent (minx IN DOUBLE, 
           miny IN DOUBLE, 
           maxx IN DOUBLE, 
           maxy IN DOUBLE)

Returns

None

Parameters

Parameters

Description

data

The ST_PixelData object to be modified

extent

The geographic extent to which the ST_PixelData object will be set

minx

The minimum x-coordinate

miny

The minimum y-coordinate

maxx

The maximum x-coordinate

maxy

The maximum y-coordinate

Examples

The following procedure sets the extent of the ST_PixelData object.

Oracle

DECLARE
  p sde.ST_PixelData:= sde.ST_PixelData(256, 256, 1, 'pixelType=uint8');
BEGIN
  p.setValue(1, 0, 0, 100);
  p.setValue(1, 0, 1, 101);
  p.setExtent(SE_EXTENT(0,0,20,20));
  INSERT INTO foo VALUES (p);
END;

PostgreSQL

CREATE OR REPLACE FUNCTION set_pixel_extent() 
RETURNS integer AS '
DECLARE
  p ST_PIXELDATA := st_pixeldata(256, 256, 1, ''pixelType=uint8'');
BEGIN
  setValue(p, 1, 0, 0, 100);
  setValue(p, 1, 0, 1, 101);
  setExtent(p, se_extent(0,0,20,20));
  INSERT INTO foo VALUES (st_raster(p));
END;' 
      LANGUAGE plpgsql; 

      SELECT set_pixel_extent();

DROP FUNCTION IF EXISTS set_pixel_extent();

SQL Server

DECLARE @p
ST_Pixeldata;
SET @p = ST_Pixeldata(256, 256, 1, 'pixelType=uint8');
SELECT @p = @p.setValue(1, 0, 0, 100);
SELECT @p = @p.setValue(1, 0, 1, 101);
SELECT @p = @p.setExtent(0,0,20,20);
 INSERT INTO foo VALUES
(ST_Raster::construct(NULL,@p,NULL));

2/5/2013