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

Function: st_aspng

 

 

Schema

public

 

Owner

postgres

 

Descriptions

args: rast, nbands, compression - Return the raster tile selected bands as a single portable network graphics (PNG) image (byte array). If 1, 3, or 4 bands in raster and no bands are specified, then all bands are used. If more 2 or more than 4 bands and no bands specified, then only band 1 is used. Bands are mapped to RGB or RGBA space.

 

Options

Option

Value

Returns

bytea

Language

plpgsql

Parameters

rast public.raster

nbands integer []

compression integer

 

Definition

CREATE OR REPLACE FUNCTION public.st_aspng (
 rast public.raster,
 nbands integer [],
 compression integer
)
RETURNS bytea AS
$span$
DECLARE

compression2 int;
options text[];
BEGIN
IF
compression IS NOT NULL THEN
IF
compression > 9 THEN
compression2 := 9;
ELSEIF compression < 1 THEN
compression2 := 1;
ELSE
compression2 := compression;
END IF;

options := array_append(options, 'ZLEVEL=' || compression2);
END IF;

RETURN st_aspng(st_band($1, $2), options);
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST
100;

COMMENT ON FUNCTION public.st_aspng(rast public.raster, nbands integer [], compression integer)
IS 'args: rast, nbands, compression - Return the raster tile selected bands as a single portable network graphics (PNG) image (byte array). If 1, 3, or 4 bands in raster and no bands are specified, then all bands are used. If more 2 or more than 4 bands and no bands specified, then only band 1 is used. Bands are mapped to RGB or RGBA space.';

This file was generated with SQL Manager for PostgreSQL (www.pgsqlmanager.com) at 13/03/2014 13:23
Previous topic Chapter index Next topic