Changeset 5654


Ignore:
Timestamp:
May 27, 2010 11:35:11 AM (6 years ago)
Author:
pracine
Message:

Added functions defaulting to band 1 for functions accessing and setting band parameters when no band is specified.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • spike/wktraster/rt_pg/rtpostgis.sql.in.c

    r5651 r5654  
    186186    LANGUAGE 'C' _IMMUTABLE STRICT;
    187187
     188CREATEFUNCTION st_bandhasnodatavalue(raster)
     189    RETURNS boolean
     190        AS $$ SELECT st_bandhasnodatavalue($1, 1) $$
     191        LANGUAGE SQL;
     192
    188193CREATEFUNCTION st_bandnodatavalue(raster, integer)
    189194    RETURNS float4
     
    191196    LANGUAGE 'C' _IMMUTABLE_STRICT;
    192197
     198CREATEFUNCTION st_bandnodatavalue(raster)
     199    RETURNS float4
     200        AS $$ SELECT st_bandnodatavalue($1, 1) $$
     201        LANGUAGE SQL;
     202
    193203CREATEFUNCTION st_bandpath(raster, integer)
    194204    RETURNS text
     
    196206    LANGUAGE 'C' _IMMUTABLE_STRICT;
    197207
     208CREATEFUNCTION st_bandpath(raster)
     209    RETURNS text
     210        AS $$ SELECT st_bandpath($1, 1) $$
     211        LANGUAGE SQL;
     212
    198213CREATEFUNCTION st_bandpixeltype(raster, integer)
    199214    RETURNS text
    200215    AS 'MODULE_PATHNAME','RASTER_getBandPixelTypeName'
    201216    LANGUAGE 'C' _IMMUTABLE_STRICT;
     217
     218CREATEFUNCTION st_bandpixeltype(raster)
     219    RETURNS text
     220        AS $$ SELECT st_bandpixeltype($1, 1) $$
     221        LANGUAGE SQL;
    202222
    203223CREATEFUNCTION st_bandmetadata(rast raster,
     
    208228                               OUT isoutdb boolean,
    209229                               OUT path text)
    210 AS $$
    211 SELECT st_bandpixeltype($1, $2),
     230    AS $$
     231    SELECT st_bandpixeltype($1, $2),
    212232       st_bandhasnodatavalue($1, $2),
    213233       st_bandnodatavalue($1, $2),
    214234       st_bandpath($1, $2) IS NOT NULL,
    215235       st_bandpath($1, $2)
    216 $$
    217 LANGUAGE SQL;
     236    $$
     237    LANGUAGE SQL;
     238
     239CREATEFUNCTION st_bandmetadata(rast raster,
     240                               OUT pixeltype text,
     241                               OUT hasnodatavalue boolean,
     242                               OUT nodatavalue float4,
     243                               OUT isoutdb boolean,
     244                               OUT path text)
     245    AS $$
     246    SELECT st_bandpixeltype($1, 1),
     247       st_bandhasnodatavalue($1, 1),
     248       st_bandnodatavalue($1, 1),
     249       st_bandpath($1, 1) IS NOT NULL,
     250       st_bandpath($1, 1)
     251    $$
     252    LANGUAGE SQL;
    218253
    219254-----------------------------------------------------------------------
     
    225260    AS 'MODULE_PATHNAME','RASTER_getPixelValue'
    226261    LANGUAGE 'C' _IMMUTABLE_STRICT;
     262
     263CREATEFUNCTION st_value(raster, integer, integer)
     264    RETURNS float8
     265        AS $$ SELECT st_value($1, 1, $2, $3) $$
     266        LANGUAGE SQL;
    227267
    228268-----------------------------------------------------------------------
     
    381421    LANGUAGE 'C' _IMMUTABLE STRICT;
    382422
     423CREATEFUNCTION st_setbandhasnodatavalue(raster, boolean)
     424    RETURNS raster
     425        AS $$ SELECT st_setbandhasnodatavalue($1, 1, $2) $$
     426        LANGUAGE SQL;
     427
    383428CREATEFUNCTION st_setbandnodatavalue(raster, integer, float8)
    384429    RETURNS raster
    385430    AS 'MODULE_PATHNAME','RASTER_setBandNoDataValue'
    386431    LANGUAGE 'C' _IMMUTABLE_STRICT;
    387    
     432
     433CREATEFUNCTION st_setbandnodatavalue(raster, float8)
     434    RETURNS raster
     435        AS $$ SELECT st_setbandnodatavalue($1, 1, $2) $$
     436        LANGUAGE SQL;
     437   
    388438-----------------------------------------------------------------------
    389439-- Raster Pixel Editors
     
    416466    LANGUAGE 'C' _IMMUTABLE_STRICT;
    417467
     468CREATEFUNCTION st_dumpaspolygons(raster, integer) RETURNS SETOF geomval AS $$
     469        SELECT st_geomfromtext(wktgeomval.wktgeom, wktgeomval.srid), wktgeomval.val
     470        FROM dumpaswktpolygons($1, $2) AS wktgeomval;
     471    $$ LANGUAGE 'SQL' _IMMUTABLE_STRICT;
     472
    418473CREATEFUNCTION st_dumpaspolygons(raster) RETURNS SETOF geomval AS $$
    419474        SELECT st_geomfromtext(wktgeomval.wktgeom, wktgeomval.srid), wktgeomval.val
    420475        FROM dumpaswktpolygons($1, 1) AS wktgeomval;
    421     $$ LANGUAGE 'SQL' _IMMUTABLE_STRICT;
    422 
    423 CREATEFUNCTION st_dumpaspolygons(raster, integer) RETURNS SETOF geomval AS $$
    424         SELECT st_geomfromtext(wktgeomval.wktgeom, wktgeomval.srid), wktgeomval.val
    425         FROM dumpaswktpolygons($1, $2) AS wktgeomval;
    426476    $$ LANGUAGE 'SQL' _IMMUTABLE_STRICT;
    427477
Note: See TracChangeset for help on using the changeset viewer.