Changes between Version 176 and Version 177 of WKTRaster/SpecificationWorking03


Ignore:
Timestamp:
Nov 11, 2011, 11:16:13 AM (12 years ago)
Author:
Bborie Park
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • WKTRaster/SpecificationWorking03

    v176 v177  
    15631563}}}
    15641564
     1565This set of 2-raster ST_MapAlgebra functions require a user-provided function instead of expressions.  The user-provided function must receive three parameters (two double precision and one VARIADIC text array) and returns one double precision value.  A template for this user-provided function would be:
     1566
     1567{{{
     1568CREATE OR REPLACE FUNCTION userfunction(rast1 double precision, rast2 double precision, VARIADIC arg text[])
     1569        RETURNS double precision
     1570        AS $$
     1571        DECLARE
     1572        BEGIN
     1573                -- your code here
     1574        END;
     1575        $$
     1576        LANGUAGE 'plpgsql';
     1577}}}
     1578
     1579The function should be able to support a NULL input parameter.  The function may also be STRICT.
     1580
     15811. ST_MapAlgebraFct(
     1582        rast1 raster, band1 integer,[[BR]]
     1583        rast2 raster, band2 integer,[[BR]]
     1584        userfunction regprocedure,[[BR]]
     1585        pixeltype text DEFAULT NULL, extenttype text DEFAULT 'INTERSECTION',[[BR]]
     1586        VARIADIC userargs text[] DEFAULT NULL
     1587)
     1588
     1589{{{
     1590ST_MapAlgebraFct(r1.rast, 1, r2.rast, 1, 'raster_mapalgebra_intersection(double precision, double precision, text[])'::regprocedure, '32BF', 'INTERSECTION')
     1591}}}
     1592
     15932. ST_MapAlgebraFct(
     1594        rast1 raster,[[BR]]
     1595        rast2 raster,[[BR]]
     1596        userfunction regprocedure,[[BR]]
     1597        pixeltype text DEFAULT NULL, extenttype text DEFAULT 'INTERSECTION',[[BR]]
     1598        VARIADIC userargs text[] DEFAULT NULL
     1599)
     1600
     1601{{{
     1602ST_MapAlgebraFct(r1.rast, r2.rast, 'raster_mapalgebra_intersection(double precision, double precision, text[])'::regprocedure, '32BF', 'INTERSECTION')
     1603}}}
     1604
     16053. ST_MapAlgebraFct(
     1606        rast1 raster,[[BR]]
     1607        rast2 raster,[[BR]]
     1608        userfunction regprocedure,[[BR]]
     1609        VARIADIC userargs text[]
     1610)
     1611
     1612{{{
     1613ST_MapAlgebraFct(r1.rast, r2.rast, 'raster_mapalgebra_intersection(double precision, double precision, text[])'::regprocedure, '32BF', 'INTERSECTION')
     1614}}}
    15651615
    15661616----