pggeodb.nancy.inra.fr/db_robot - db_robot on pggeodb.nancy.inra.fr
Previous topic Chapter index Next topic

Function: st_astiff

 

 

Schema

public

 

Owner

albenard

 

Descriptions

args: rast, options=', srid=sameassource - Return the raster selected bands as a single TIFF image (byte array). If no band is specified, then will try to use all bands.

 

Options

Option

Value

Returns

bytea

Language

plpgsql

Parameters

rast public.raster

options text [] = NULL::text[]

srid integer = NULL::integer

 

Definition

CREATE OR REPLACE FUNCTION public.st_astiff (
 rast public.raster,
 options text [] = NULL::text[],
 srid integer = NULL::integer
)
RETURNS bytea AS
$span$
DECLARE

i int;
num_bands int;
nodata double precision;
last_nodata double precision;
BEGIN
IF
rast IS NULL THEN
RETURN NULL
;
END IF;

num_bands := st_numbands($1);

-- TIFF only allows one NODATA value for ALL bands
FOR i IN 1..num_bands LOOP
nodata := st_bandnodatavalue($1, i);
IF last_nodata IS NULL THEN
last_nodata := nodata;
ELSEIF nodata != last_nodata THEN
RAISE NOTICE
'The TIFF format only permits one NODATA value for all bands.  The value used will be the last band with a NODATA value.';
END IF;
END LOOP;

RETURN st_asgdalraster($1, 'GTiff', $2, $3);
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
CALLED ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.st_astiff(rast public.raster, options text [], srid integer)
IS 'args: rast, options='', srid=sameassource - Return the raster selected bands as a single TIFF image (byte array). If no band is specified, then will try to use all bands.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 26/02/2014 11:51
Previous topic Chapter index Next topic