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

Function: _st_convertarray4ma

 

 

Schema

public

 

Owner

postgres

 

Descriptions

There is no description for function _st_convertarray4ma

 

Options

Option

Value

Returns

double precision []

Language

plpgsql

Parameters

value double precision []

 

Definition

CREATE OR REPLACE FUNCTION public._st_convertarray4ma (
 value double precision []
)
RETURNS double precision [] AS
$span$
DECLARE

_value double precision[][][];
x int;
y int;
BEGIN
IF
array_ndims(value) != 2 THEN
RAISE EXCEPTION
'Function parameter must be a 2-dimension array';
END IF;

_value := array_fill(NULL::double precision, ARRAY[1, array_length(value, 1), array_length(value, 2)]::int[], ARRAY[1, array_lower(value, 1), array_lower(value, 2)]::int[]);

-- row
FOR y IN array_lower(value, 1)..array_upper(value, 1) LOOP
-- column
FOR x IN array_lower(value, 2)..array_upper(value, 2) LOOP
_value[1][y][x] = value[y][x];
END LOOP;
END LOOP;

RETURN _value;
END;
$span$
LANGUAGE
'plpgsql'
IMMUTABLE
RETURNS NULL ON NULL INPUT
SECURITY INVOKER
COST
100;

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